Skip to content

Commit

Permalink
NSPanel Climate Control off mode fix AlexxIT#979
Browse files Browse the repository at this point in the history
  • Loading branch information
sipimokus authored Oct 26, 2022
1 parent 9d2d2e7 commit 44364eb
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions custom_components/sonoff/climate.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,9 +171,12 @@ def set_hvac_attr(self, hvac_mode: str) -> None:
if not hvac_mode:
return

if hvac_mode in (HVAC_MODE_AUTO, HVAC_MODE_OFF):
if hvac_mode in (HVAC_MODE_AUTO):
self._attr_hvac_mode = hvac_mode
self._attr_supported_features = 0
elif hvac_mode in (HVAC_MODE_OFF):
self._attr_hvac_mode = hvac_mode
self._attr_supported_features = SUPPORT_TARGET_TEMPERATURE
elif hvac_mode in (HVAC_MODE_COOL, HVAC_MODE_HEAT, HVAC_MODE_HEAT_COOL):
self._attr_hvac_mode = self._attr_hvac_modes[1]
self._attr_supported_features = SUPPORT_TARGET_TEMPERATURE
Expand Down Expand Up @@ -205,14 +208,15 @@ async def async_set_temperature(
return

# Set manual operation and temperature
params = {
"ATCMode": 0,
params = self.get_params(hvac_mode)
params.update({
"ATCMode": 0,
"ATCExpect0": temperature,
}
})

await self.ewelink.cloud.send(self.device, params)
self._attr_target_temperature = temperature
self.set_hvac_attr(self._attr_hvac_modes[1])
self.set_hvac_attr(hvac_mode)
self._async_write_ha_state()


Expand Down

0 comments on commit 44364eb

Please sign in to comment.