Skip to content

Commit

Permalink
Hard code thermostat set point limits. Fixed running and running_stat…
Browse files Browse the repository at this point in the history
…e for thermostats.
  • Loading branch information
w1ll1am23 committed Jan 31, 2021
1 parent e477bf0 commit cd2f9a4
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 3 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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

Expand Down
16 changes: 15 additions & 1 deletion src/pyeconet/equipment/thermostat.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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 = {}
Expand Down
2 changes: 1 addition & 1 deletion src/pyeconet/equipment/water_heater.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/setup.py
Original file line number Diff line number Diff line change
@@ -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',
Expand Down

0 comments on commit cd2f9a4

Please sign in to comment.