mirror of
https://github.com/Andre0512/pyhOn.git
synced 2024-01-19 02:50:44 +00:00
Make 'code' attribute really optional
This commit is contained in:
parent
dfbc24452b
commit
9f130e2e85
|
@ -276,7 +276,7 @@ class HonAppliance:
|
||||||
extra = {n: c.data for n, c in self._commands.items() if c.data}
|
extra = {n: c.data for n, c in self._commands.items() if c.data}
|
||||||
if extra:
|
if extra:
|
||||||
data |= {"extra_command_data": extra}
|
data |= {"extra_command_data": extra}
|
||||||
for sensible in ["PK", "SK", "serialNumber", "code", "coords", "device"]:
|
for sensible in ["PK", "SK", "serialNumber", "coords", "device"]:
|
||||||
data.get("appliance", {}).pop(sensible, None)
|
data.get("appliance", {}).pop(sensible, None)
|
||||||
result = helper.pretty_print({"data": data}, whitespace=whitespace)
|
result = helper.pretty_print({"data": data}, whitespace=whitespace)
|
||||||
result += helper.pretty_print(
|
result += helper.pretty_print(
|
||||||
|
|
|
@ -72,7 +72,6 @@ class HonAPI:
|
||||||
async def load_commands(self, appliance: HonAppliance) -> Dict:
|
async def load_commands(self, appliance: HonAppliance) -> Dict:
|
||||||
params: Dict = {
|
params: Dict = {
|
||||||
"applianceType": appliance.appliance_type,
|
"applianceType": appliance.appliance_type,
|
||||||
"code": appliance.info["code"],
|
|
||||||
"applianceModelId": appliance.appliance_model_id,
|
"applianceModelId": appliance.appliance_model_id,
|
||||||
"macAddress": appliance.mac_address,
|
"macAddress": appliance.mac_address,
|
||||||
"os": const.OS,
|
"os": const.OS,
|
||||||
|
|
|
@ -83,7 +83,7 @@ class Hon:
|
||||||
)
|
)
|
||||||
except (KeyError, ValueError, IndexError) as error:
|
except (KeyError, ValueError, IndexError) as error:
|
||||||
_LOGGER.exception(error)
|
_LOGGER.exception(error)
|
||||||
_LOGGER.error(f"Device data - %s", appliance_data)
|
_LOGGER.error("Device data - %s", appliance_data)
|
||||||
self._appliances.append(appliance)
|
self._appliances.append(appliance)
|
||||||
|
|
||||||
async def setup(self) -> None:
|
async def setup(self) -> None:
|
||||||
|
|
2
setup.py
2
setup.py
|
@ -7,7 +7,7 @@ with open("README.md", "r") as f:
|
||||||
|
|
||||||
setup(
|
setup(
|
||||||
name="pyhOn",
|
name="pyhOn",
|
||||||
version="0.10.8",
|
version="0.10.9",
|
||||||
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,
|
||||||
|
|
Loading…
Reference in a new issue