Skip to content

Commit

Permalink
Add reset_filter_change_timer function
Browse files Browse the repository at this point in the history
  • Loading branch information
jvitkauskas committed Dec 19, 2023
1 parent e13550b commit e1e3ef6
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 7 deletions.
13 changes: 7 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@ To load:
`client.poll()`

The following functions are available:
`turn_on`
`turn_off`
`set_hvac_mode`
`set_fan_mode`
`set_manual_fan_speed_percent`
`set_temperature`
`turn_on()`
`turn_off()`
`set_hvac_mode(hvac_mode: HVACMode)`
`set_fan_mode(mode: int)`
`set_manual_fan_speed_percent(speed_percent: int)`
`set_temperature(temp_celsius: int)`
`reset_filter_change_timer()`
6 changes: 6 additions & 0 deletions pybls21/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ def set_manual_fan_speed_percent(self, speed_percent: int) -> None:
def set_temperature(self, temp_celsius: int) -> None:
self._do_with_connection(lambda: self._set_temperature(temp_celsius))

def reset_filter_change_timer(self) -> None:
self._do_with_connection(self._reset_filter_change_timer)

def _do_with_connection(self, func: Callable):
with self.lock: # Device does not support multiple connections
if not self.client.open():
Expand Down Expand Up @@ -155,3 +158,6 @@ def _set_manual_fan_speed_percent(self, speed_percent: int) -> None:

def _set_temperature(self, temp_celsius: int) -> None:
self.client.write_single_register(HR_SetTEMP, temp_celsius)

def _reset_filter_change_timer(self) -> None:
self.client.write_single_coil(CL_RESET_FILTER_TIMER, True)
1 change: 1 addition & 0 deletions pybls21/constants.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Coils
CL_POWER = 0
CL_Boost_MODE = 3
CL_RESET_FILTER_TIMER = 17

# Holding registers
HR_MaxSPEED_MODE = 1
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="pybls21",
version="3.0.2",
version="3.0.4",
author="Julius Vitkauskas",
author_email="[email protected]",
description="An api allowing control of AC state (temperature, on/off, speed) of an Blauberg S21 device locally over TCP",
Expand Down

0 comments on commit e1e3ef6

Please sign in to comment.