Bump version

This commit is contained in:
Andre Basche 2023-06-21 19:53:36 +02:00
parent 55966dd52f
commit c25e898b42
3 changed files with 17 additions and 10 deletions

View file

@ -32,7 +32,7 @@ class HonAppliance:
self._api: Optional[HonAPI] = api self._api: Optional[HonAPI] = api
self._appliance_model: Dict = {} self._appliance_model: Dict = {}
self._commands: Dict = {} self._commands: Dict[str, HonCommand] = {}
self._statistics: Dict = {} self._statistics: Dict = {}
self._attributes: Dict = {} self._attributes: Dict = {}
self._zone: int = zone self._zone: int = zone
@ -112,7 +112,7 @@ class HonAppliance:
return self._appliance_model.get("options", {}) return self._appliance_model.get("options", {})
@property @property
def commands(self): def commands(self) -> Dict[str, HonCommand]:
return self._commands return self._commands
@property @property
@ -329,7 +329,9 @@ class HonAppliance:
self.attributes["parameters"][key] = str(new.intern_value) self.attributes["parameters"][key] = str(new.intern_value)
def sync_command(self, main, target=None) -> None: def sync_command(self, main, target=None) -> None:
base: HonCommand = self.commands.get(main) base: Optional[HonCommand] = self.commands.get(main)
if not base:
return
for command, data in self.commands.items(): for command, data in self.commands.items():
if command == main or target and command not in target: if command == main or target and command not in target:
continue continue

View file

@ -2,7 +2,7 @@ import logging
from typing import Optional, Dict, Any, List, TYPE_CHECKING, Union from typing import Optional, Dict, Any, List, TYPE_CHECKING, Union
from pyhon import exceptions from pyhon import exceptions
from pyhon.exceptions import ApiError from pyhon.exceptions import ApiError, NoAuthenticationException
from pyhon.parameter.base import HonParameter from pyhon.parameter.base import HonParameter
from pyhon.parameter.enum import HonParameterEnum from pyhon.parameter.enum import HonParameterEnum
from pyhon.parameter.fixed import HonParameterFixed from pyhon.parameter.fixed import HonParameterFixed
@ -113,11 +113,16 @@ class HonCommand:
ancillary_params = self.parameter_groups.get("ancillaryParameters", {}) ancillary_params = self.parameter_groups.get("ancillaryParameters", {})
ancillary_params.pop("programRules", None) ancillary_params.pop("programRules", None)
self.appliance.sync_to_params(self.name) self.appliance.sync_to_params(self.name)
result = await self.api.send_command( try:
self._appliance, self._name, params, ancillary_params result = await self.api.send_command(
) self._appliance, self._name, params, ancillary_params
if not result: )
raise ApiError("Can't send command") if not result:
_LOGGER.error(result)
raise ApiError("Can't send command")
except NoAuthenticationException:
_LOGGER.error("No Authentication")
return False
return result return result
@property @property

View file

@ -7,7 +7,7 @@ with open("README.md", "r") as f:
setup( setup(
name="pyhOn", name="pyhOn",
version="0.13.0", version="0.13.1",
author="Andre Basche", author="Andre Basche",
description="Control hOn devices with python", description="Control hOn devices with python",
long_description=long_description, long_description=long_description,