From 22276832cd05d2e8a5cb02cf13f01d3d984d03b6 Mon Sep 17 00:00:00 2001 From: Andre Basche Date: Fri, 3 Mar 2023 18:24:19 +0100 Subject: [PATCH] Fix wrong values --- pyhon/device.py | 4 ++++ pyhon/parameter.py | 4 ++-- setup.py | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/pyhon/device.py b/pyhon/device.py index d76d760..c04bf79 100644 --- a/pyhon/device.py +++ b/pyhon/device.py @@ -166,3 +166,7 @@ class HonDevice: async def update(self): await self.load_attributes() + + @property + def data(self): + return self.attributes | self.parameters | self._appliance | self._statistics diff --git a/pyhon/parameter.py b/pyhon/parameter.py index 0de79b2..4513aa5 100644 --- a/pyhon/parameter.py +++ b/pyhon/parameter.py @@ -25,7 +25,7 @@ class HonParameterFixed(HonParameter): @property def value(self): - return self._value + return self._value if self._value is not None else "0" @value.setter def value(self, value): @@ -85,7 +85,7 @@ class HonParameterEnum(HonParameter): @property def value(self): - return self._value + return self._value if self._value is not None else self.values[0] @value.setter def value(self, value): diff --git a/setup.py b/setup.py index 5b77e13..c147ba3 100644 --- a/setup.py +++ b/setup.py @@ -7,7 +7,7 @@ with open("README.md", "r") as f: setup( name="pyhOn", - version="0.0.13", + version="0.0.14", author="Andre Basche", description="Control hOn devices with python", long_description=long_description,