Compare commits

..

No commits in common. "f49e76937ca2afda913e611d624413aea5bad1b7" and "c04fa542a345e22e56b7db492b8a75c2987d575e" have entirely different histories.

3 changed files with 4 additions and 16 deletions

View File

@ -320,15 +320,9 @@ class FeatureSwingMode(MIoTServiceEntity, ClimateEntity):
await self.set_property_async(prop=self._prop_vertical_swing, await self.set_property_async(prop=self._prop_vertical_swing,
value=True) value=True)
elif swing_mode == SWING_HORIZONTAL: elif swing_mode == SWING_HORIZONTAL:
if self._prop_vertical_swing:
await self.set_property_async(prop=self._prop_vertical_swing,
value=False)
await self.set_property_async(prop=self._prop_horizontal_swing, await self.set_property_async(prop=self._prop_horizontal_swing,
value=True) value=True)
elif swing_mode == SWING_VERTICAL: elif swing_mode == SWING_VERTICAL:
if self._prop_horizontal_swing:
await self.set_property_async(prop=self._prop_horizontal_swing,
value=False)
await self.set_property_async(prop=self._prop_vertical_swing, await self.set_property_async(prop=self._prop_vertical_swing,
value=True) value=True)
elif swing_mode == SWING_OFF: elif swing_mode == SWING_OFF:

View File

@ -589,13 +589,6 @@ class _MipsClient(ABC):
def __mqtt_loop_handler(self) -> None: def __mqtt_loop_handler(self) -> None:
try: try:
# If the main loop is closed, stop the internal loop immediately
if self.main_loop.is_closed():
self.log_debug(
'The main loop is closed, stop the internal loop.')
if not self._internal_loop.is_closed():
self._internal_loop.stop()
return
if self._mqtt: if self._mqtt:
self._mqtt.loop_read() self._mqtt.loop_read()
if self._mqtt: if self._mqtt:

View File

@ -66,7 +66,7 @@ class MIoTSpecValueRange:
"""MIoT SPEC value range class.""" """MIoT SPEC value range class."""
min_: int min_: int
max_: int max_: int
step: int | float step: int
def __init__(self, value_range: Union[dict, list]) -> None: def __init__(self, value_range: Union[dict, list]) -> None:
if isinstance(value_range, dict): if isinstance(value_range, dict):
@ -567,8 +567,9 @@ class MIoTSpecProperty(_MIoTSpecBase):
return return
self._value_range = MIoTSpecValueRange(value_range=value) self._value_range = MIoTSpecValueRange(value_range=value)
if isinstance(value, list): if isinstance(value, list):
step_: str = format(value[2], '.10f').rstrip('0').rstrip('.') self.precision = len(str(
self.precision = len(step_.split('.')[1]) if '.' in step_ else 0 value[2]).split('.')[1].rstrip('0')) if '.' in str(
value[2]) else 0
@property @property
def value_list(self) -> Optional[MIoTSpecValueList]: def value_list(self) -> Optional[MIoTSpecValueList]: