Skip to content

Commit

Permalink
mts_working : moving it to the inherited (MTS960) thermostat class in…
Browse files Browse the repository at this point in the history
…stead of the base MTSClimate
  • Loading branch information
bernardpe committed Jun 9, 2024
1 parent 8ced678 commit 5682fb5
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 11 deletions.
3 changes: 0 additions & 3 deletions custom_components/meross_lan/climate.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@ class MtsClimate(me.MerossEntity, climate.ClimateEntity):
"_mts_mode",
"_mts_onoff",
"_mts_payload",
"_mts_working",
"_mts_adjust_offset",
"number_adjust_temperature",
"number_preset_temperature",
Expand All @@ -122,7 +121,6 @@ def __init__(
self._mts_active = None
self._mts_mode: int | None = None
self._mts_onoff: int | None = None
self._mts_working: int | None = None
self._mts_payload = {}
self._mts_adjust_offset = 0
super().__init__(manager, channel)
Expand All @@ -148,7 +146,6 @@ async def async_shutdown(self):
def set_unavailable(self):
self._mts_active = None
self._mts_mode = None
self._mts_working = None
self._mts_onoff = None
self._mts_payload = {}
self.preset_mode = None
Expand Down
8 changes: 7 additions & 1 deletion custom_components/meross_lan/devices/mts960.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ class Mts960Climate(MtsClimate):

preset_modes = list(MTS_MODE_TO_PRESET_MAP.values())

__slots__ = ()
__slots__ = ( "_mts_working" )

def __init__(
self,
Expand All @@ -126,6 +126,12 @@ def __init__(
None,
Mts960Schedule,
)
self._mts_working = None

def set_unavailable(self):
self._mts_working = None
super().set_unavailable()


def flush_state(self):
"""interface: MtsClimate."""
Expand Down
14 changes: 7 additions & 7 deletions tests/entities/climate.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@
mc.MTS200_MODE_MANUAL,
},
Mts960Climate: {
mc.MTS960_MODE_HEAT,
mc.MTS960_MODE_COOL,
mc.MTS960_MODE_CYCLE,
mc.MTS960_MODE_COUNTDOWN_ON,
mc.MTS960_MODE_COUNTDOWN_OFF,
mc.MTS960_MODE_SCHEDULE_HEAT,
mc.MTS960_MODE_SCHEDULE_COOL,
# mc.MTS960_MODE_HEAT,
# mc.MTS960_MODE_COOL,
# mc.MTS960_MODE_CYCLE,
# mc.MTS960_MODE_COUNTDOWN_ON,
# mc.MTS960_MODE_COUNTDOWN_OFF,
# mc.MTS960_MODE_SCHEDULE_HEAT,
# mc.MTS960_MODE_SCHEDULE_COOL,
},
}

Expand Down

0 comments on commit 5682fb5

Please sign in to comment.