Skip to content

Commit

Permalink
Merge pull request #66 from fredericvl/min_max_water_temp
Browse files Browse the repository at this point in the history
Support min and max water temperature
  • Loading branch information
vincentwolsink authored Jun 15, 2023
2 parents 660d7cf + 588423c commit 124e733
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 10 deletions.
32 changes: 23 additions & 9 deletions py_agua_iot/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -498,17 +498,23 @@ def __get_information_item(self, item, format_string=False):
return None

def __get_information_item_min(self, item):
value = int(self.__register_map_dict[item]["set_min"])
_LOGGER.debug("GET '%s' MIN: %s", item, value)
return value
try:
value = int(self.__register_map_dict[item]["set_min"])
_LOGGER.debug("GET '%s' MIN: %s", item, value)
return value
except (KeyError, ValueError):
return None

def __get_information_item_max(self, item):
value = int(self.__register_map_dict[item]["set_max"])
_LOGGER.debug("GET '%s' MAX: %s", item, value)
return value
try:
value = int(self.__register_map_dict[item]["set_max"])
_LOGGER.debug("GET '%s' MAX: %s", item, value)
return value
except (KeyError, ValueError):
return None

def __prepare_value_for_writing(self, item, value):
value = float(value)
value = int(value)
set_min = self.__register_map_dict[item]["set_min"]
set_max = self.__register_map_dict[item]["set_max"]

Expand Down Expand Up @@ -631,11 +637,11 @@ def alarms_translated(self):
]

@property
def min_temp(self):
def min_air_temp(self):
return self.__get_information_item_min("temp_air_set")

@property
def max_temp(self):
def max_air_temp(self):
return self.__get_information_item_max("temp_air_set")

@property
Expand All @@ -662,6 +668,14 @@ def set_air_temperature(self, value):
except Error:
raise Error("Error while trying to set temperature")

@property
def min_water_temp(self):
return self.__get_information_item_min("temp_water_set")

@property
def max_water_temp(self):
return self.__get_information_item_max("temp_water_set")

@property
def water_temperature(self):
return self.__get_information_item("temp_water_get")
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

setuptools.setup(
name="py-agua-iot",
version="0.0.16",
version="0.0.17",
author="Frederic Van Linthoudt",
author_email="[email protected]",
description="py-agua-iot provides controlling heating devices connected via the IOT Agua platform of Micronova",
Expand Down

0 comments on commit 124e733

Please sign in to comment.