Compare commits

...

3 Commits

Author SHA1 Message Date
f1818bbc5d Bump version 2023-07-09 23:59:27 +02:00
3d5c8405ea Improve error handling 2023-07-09 23:58:55 +02:00
e234ef3bbb Remove old code in ov hon#88 2023-07-09 01:36:03 +02:00
4 changed files with 9 additions and 11 deletions

View File

@ -109,7 +109,7 @@ class HonAppliance:
@property
def nick_name(self) -> str:
result = self._check_name_zone("nickName")
if not result or re.findall("^[xX1\\s]+$", result):
if not result or re.findall("^[xX1\\s-]+$", result):
return self.model_name
return result

View File

@ -14,11 +14,4 @@ class Appliance(ApplianceBase):
data["parameters"]["remainingTimeMM"].value = "0"
data["active"] = data["parameters"]["onOffStatus"] == "1"
if program := int(data["parameters"]["prCode"].value):
if (setting := self.parent.settings["startProgram.program"]) and isinstance(
setting, HonParameterProgram
):
data["programName"] = setting.ids.get(program, "")
return data

View File

@ -267,8 +267,13 @@ class TestAPI(HonAPI):
_LOGGER.warning("Can't open %s", str(path))
return {}
with open(path, "r", encoding="utf-8") as json_file:
data: Dict[str, Any] = json.loads(json_file.read())
return data
text = json_file.read()
try:
data: Dict[str, Any] = json.loads(text)
return data
except json.decoder.JSONDecodeError as error:
_LOGGER.error("%s - %s", str(path), error)
return {}
async def load_appliances(self) -> List[Dict[str, Any]]:
result = []

View File

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