From cd2f9a47ffb89979db8dc2c3ac5b8e455aa0a1ed Mon Sep 17 00:00:00 2001 From: w1ll1am23 Date: Sun, 31 Jan 2021 10:39:29 -0500 Subject: [PATCH] Hard code thermostat set point limits. Fixed running and running_state for thermostats. --- CHANGELOG.md | 3 +++ src/pyeconet/equipment/thermostat.py | 16 +++++++++++++++- src/pyeconet/equipment/water_heater.py | 2 +- src/setup.py | 2 +- 4 files changed, 20 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 014bbe4..6ec194a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ # Change log +## 0.1.13 +- Hard code thermostat set point limits. Fixed running and running_state for thermostats. + ## 0.1.12 - Added raw running state diff --git a/src/pyeconet/equipment/thermostat.py b/src/pyeconet/equipment/thermostat.py index 2d4fd4e..4e6581c 100644 --- a/src/pyeconet/equipment/thermostat.py +++ b/src/pyeconet/equipment/thermostat.py @@ -78,7 +78,12 @@ class Thermostat(Equipment): @property def running(self) -> bool: """Return if the thermostat is running or not""" - return self._equipment_info.get("@RUNNINGSTATUS") == "Running" + return self._equipment_info.get("@RUNNINGSTATUS") != "" + + @property + def running_state(self) -> str: + """Return the raw running status value""" + return self._equipment_info.get("@RUNNINGSTATUS") @property def beep_enabled(self) -> bool: @@ -177,6 +182,15 @@ def mode(self) -> Union[ThermostatOperationMode, None]: """Return the current mode""" return self.modes[self._equipment_info.get("@MODE")["value"]] + @property + def set_point_limits(self) -> Tuple: + """ + Returns a tuple of the lower limit and upper limit for the set point. + + Thermostat set points are too extream -100 - 200 setting reasonable limits. + """ + return 40, 95 + def set_mode(self, mode: ThermostatOperationMode): """Set the provided mode""" payload = {} diff --git a/src/pyeconet/equipment/water_heater.py b/src/pyeconet/equipment/water_heater.py index f377a79..d760354 100644 --- a/src/pyeconet/equipment/water_heater.py +++ b/src/pyeconet/equipment/water_heater.py @@ -90,7 +90,7 @@ def running(self) -> bool: @property def running_state(self) -> str: - """Return if the water heater is running or not""" + """Return the raw running value""" return self._equipment_info.get("@RUNNING") @property diff --git a/src/setup.py b/src/setup.py index 9671c67..dd58948 100644 --- a/src/setup.py +++ b/src/setup.py @@ -1,7 +1,7 @@ from setuptools import setup, find_packages setup(name='pyeconet', - version='0.1.12', + version='0.1.13', description='Interface to the unofficial EcoNet API', url='http://github.com/w1ll1am23/pyeconet', author='William Scanlon',