mirror of
https://github.com/XiaoMi/ha_xiaomi_home.git
synced 2025-12-17 20:10:20 +08:00
Compare commits
3 Commits
4ad040d2ea
...
94583a23d1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
94583a23d1 | ||
|
|
925cf3b90f | ||
|
|
836bd01ead |
@ -170,12 +170,13 @@ class Cover(MIoTServiceEntity, CoverEntity):
|
|||||||
self._prop_status_opening.append(item.value)
|
self._prop_status_opening.append(item.value)
|
||||||
elif item_name in {
|
elif item_name in {
|
||||||
'closing', 'close', 'down', 'dowm', 'falling',
|
'closing', 'close', 'down', 'dowm', 'falling',
|
||||||
'dropping', 'downing', 'lower'
|
'fallin', 'dropping', 'downing', 'lower'
|
||||||
}:
|
}:
|
||||||
self._prop_status_closing.append(item.value)
|
self._prop_status_closing.append(item.value)
|
||||||
elif item_name in {
|
elif item_name in {
|
||||||
'stopatlowest', 'stoplowerlimit', 'lowerlimitstop',
|
'closed', 'closeover', 'stopatlowest',
|
||||||
'floor', 'lowerlimit'
|
'stoplowerlimit', 'lowerlimitstop', 'floor',
|
||||||
|
'lowerlimit'
|
||||||
}:
|
}:
|
||||||
self._prop_status_closed.append(item.value)
|
self._prop_status_closed.append(item.value)
|
||||||
self._prop_status = prop
|
self._prop_status = prop
|
||||||
|
|||||||
@ -996,7 +996,7 @@ class MIoTClient:
|
|||||||
and self._device_list_cloud[did].get('online', False)
|
and self._device_list_cloud[did].get('online', False)
|
||||||
):
|
):
|
||||||
from_new = 'cloud'
|
from_new = 'cloud'
|
||||||
if from_new == from_old:
|
if (from_new == from_old) and (from_new=='cloud' or from_new=='lan'):
|
||||||
# No need to update
|
# No need to update
|
||||||
return
|
return
|
||||||
# Unsub old
|
# Unsub old
|
||||||
@ -1492,8 +1492,6 @@ class MIoTClient:
|
|||||||
if did not in filter_dids:
|
if did not in filter_dids:
|
||||||
continue
|
continue
|
||||||
device_old = self._device_list_gateway.get(did, None)
|
device_old = self._device_list_gateway.get(did, None)
|
||||||
gw_state_old = device_old.get(
|
|
||||||
'online', False) if device_old else False
|
|
||||||
gw_state_new: bool = False
|
gw_state_new: bool = False
|
||||||
device_new = gw_list.pop(did, None)
|
device_new = gw_list.pop(did, None)
|
||||||
if device_new:
|
if device_new:
|
||||||
@ -1507,7 +1505,7 @@ class MIoTClient:
|
|||||||
device_old['online'] = False
|
device_old['online'] = False
|
||||||
# Update cache group_id
|
# Update cache group_id
|
||||||
info['group_id'] = group_id
|
info['group_id'] = group_id
|
||||||
if gw_state_old == gw_state_new:
|
if not gw_state_new:
|
||||||
continue
|
continue
|
||||||
self.__update_device_msg_sub(did=did)
|
self.__update_device_msg_sub(did=did)
|
||||||
state_old: Optional[bool] = info.get('online', None)
|
state_old: Optional[bool] = info.get('online', None)
|
||||||
|
|||||||
@ -994,6 +994,11 @@ class MipsCloudClient(_MipsClient):
|
|||||||
handler(
|
handler(
|
||||||
did, MIoTDeviceState.ONLINE if msg['event'] == 'online'
|
did, MIoTDeviceState.ONLINE if msg['event'] == 'online'
|
||||||
else MIoTDeviceState.OFFLINE, ctx)
|
else MIoTDeviceState.OFFLINE, ctx)
|
||||||
|
|
||||||
|
if did.startswith('blt.'):
|
||||||
|
# MIoT cloud may not publish BLE device online/offline state message.
|
||||||
|
# Do not subscribe BLE device online/offline state.
|
||||||
|
return True
|
||||||
return self.__reg_broadcast_external(
|
return self.__reg_broadcast_external(
|
||||||
topic=topic, handler=on_state_msg, handler_ctx=handler_ctx)
|
topic=topic, handler=on_state_msg, handler_ctx=handler_ctx)
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user