Skip to content

Commit

Permalink
Check for shutoff valve before checking status and put in wifi signal…
Browse files Browse the repository at this point in the history
… hack
  • Loading branch information
w1ll1am23 committed Apr 11, 2021
1 parent cd2f9a4 commit 4727a5d
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 4 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Change log

## 0.1.14
- Check for shutoff valve before getting status
- WiFi signal hack

## 0.1.13
- Hard code thermostat set point limits. Fixed running and running_state for thermostats.

Expand Down
6 changes: 6 additions & 0 deletions src/pyeconet/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,12 @@ def _on_message(self, client, userdata, msg):
_equipment = self._equipment.get(key)
if _equipment is not None:
_equipment.update_equipment_info(unpacked_json)
# Nasty hack to push signal updates to the device it belongs to
elif "@SIGNAL" in str(unpacked_json):
for _equipment in self._equipment.values():
if _equipment.device_id == _name:
# Don't break after update for multi zone HVAC systems
_equipment.update_equipment_info(unpacked_json)
else:
_LOGGER.debug("Received update for non-existent equipment with device name: %s and serial number %s",
_name, _serial)
Expand Down
2 changes: 1 addition & 1 deletion src/pyeconet/equipment/thermostat.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ 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.
Thermostat set points are too extreme -100 - 200 setting reasonable limits.
"""
return 40, 95

Expand Down
6 changes: 4 additions & 2 deletions src/pyeconet/equipment/water_heater.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,11 @@ def tank_hot_water_availability(self) -> Union[int, None]:
return value

@property
def shutoff_valve_open(self) -> bool:
def shutoff_valve_open(self) -> Union[bool, None]:
"""Return if the shutoff valve is open or not"""
return self._equipment_info.get("@VALVE")["value"] == 0
if self.has_shutoff_valve:
return self._equipment_info.get("@VALVE")["value"] == 0
return None

@property
def tank_health(self) -> Union[int, None]:
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.13',
version='0.1.14',
description='Interface to the unofficial EcoNet API',
url='http://github.com/w1ll1am23/pyeconet',
author='William Scanlon',
Expand Down

0 comments on commit 4727a5d

Please sign in to comment.