forked from platypush/platypush
Refresh BluetoothDevice.reachable
when a device is found/lost.
This commit is contained in:
parent
d46d4e2300
commit
913ef6f8cd
2 changed files with 5 additions and 0 deletions
|
@ -183,6 +183,7 @@ class EventHandler:
|
||||||
get_bus().post(event)
|
get_bus().post(event)
|
||||||
|
|
||||||
if events:
|
if events:
|
||||||
|
new_entity.reachable = True
|
||||||
self._device_queue.put_nowait(new_entity)
|
self._device_queue.put_nowait(new_entity)
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
|
|
|
@ -176,6 +176,10 @@ class EntityCache(BaseCache):
|
||||||
if getattr(existing_device, attr, None) is None:
|
if getattr(existing_device, attr, None) is None:
|
||||||
setattr(existing_device, attr, getattr(device, attr, None))
|
setattr(existing_device, attr, getattr(device, attr, None))
|
||||||
|
|
||||||
|
# Coalesce the reachable flag
|
||||||
|
if device.reachable is not None:
|
||||||
|
existing_device.reachable = device.reachable
|
||||||
|
|
||||||
# Merge the data and meta dictionaries
|
# Merge the data and meta dictionaries
|
||||||
for attr in ('data', 'meta'):
|
for attr in ('data', 'meta'):
|
||||||
setattr(
|
setattr(
|
||||||
|
|
Loading…
Reference in a new issue