Skip to content

Commit

Permalink
Manage DR-HSH006S device model and Fix preset and target temperature …
Browse files Browse the repository at this point in the history
…due to control errors (#215)

* Update README.md

* Add DR-HSH006S heater model

* Fix control ranges for heater heat level and target temperature
  • Loading branch information
thomasGomes authored Oct 10, 2024
1 parent 5eacf76 commit 40ec374
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ Models that have been specifically tested can be found below.
### Space Heaters

- DR-HSH004S
- DR-HSH006S
- DR-HSH009S
- DR-HSH009AS
- DR-HSH0017S
Expand Down
12 changes: 12 additions & 0 deletions custom_components/dreo/pydreo/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,18 @@ def __init__(
],
swing_modes=[SWING_OFF, SWING_ON],
),
"DR-HSH006S": DreoDeviceDetails(
device_type=DreoDeviceType.HEATER,
preset_modes=["H1", "H2", "H3"],
device_ranges={HEAT_RANGE: (1, 3), ECOLEVEL_RANGE: (41, 95)},
hvac_modes=[
HEATER_MODE_COOLAIR,
HEATER_MODE_HOTAIR,
HEATER_MODE_ECO,
HEATER_MODE_OFF,
],
swing_modes=[SWING_OFF, SWING_ON],
),
"DR-HSH009S": DreoDeviceDetails(
device_type=DreoDeviceType.HEATER,
preset_modes=["H1", "H2", "H3"],
Expand Down
4 changes: 2 additions & 2 deletions custom_components/dreo/pydreo/pydreoheater.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ def htalevel(self):
def htalevel(self, htalevel : int) :
"""Set the heat level."""
_LOGGER.debug("PyDreoHeater:htalevel.setter(%s, %s)", self.name, htalevel)
if (htalevel not in self._device_definition.device_ranges[HEAT_RANGE]):
if (self._device_definition.device_ranges[HEAT_RANGE][0] > htalevel > self._device_definition.device_ranges[HEAT_RANGE][1]):
_LOGGER.error("Heat level %s is not in the acceptable range: %s",
htalevel,
self._device_definition.device_ranges[HEAT_RANGE])
Expand All @@ -138,7 +138,7 @@ def ecolevel(self):
def ecolevel(self, ecolevel : int):
"""Set the target temperature."""
_LOGGER.debug("PyDreoHeater:ecolevel(%s)", ecolevel)
if ecolevel not in self._device_definition.device_ranges[ECOLEVEL_RANGE]:
if self._device_definition.device_ranges[ECOLEVEL_RANGE][0] > ecolevel > self._device_definition.device_ranges[ECOLEVEL_RANGE][1]:
_LOGGER.error("Target Temperature %s is not in the acceptable range: %s",
ecolevel,
self._device_definition.device_ranges[ECOLEVEL_RANGE])
Expand Down

0 comments on commit 40ec374

Please sign in to comment.