forked from platypush/platypush
Exclude more noisy BLE beacons.
Excluding Apple iBeacons and devices with no name and no services.
This commit is contained in:
parent
99382e4505
commit
cb288deb71
1 changed files with 8 additions and 0 deletions
|
@ -191,6 +191,10 @@ class EventHandler:
|
||||||
"""
|
"""
|
||||||
Check if the beacon received from the given device should be skipped.
|
Check if the beacon received from the given device should be skipped.
|
||||||
"""
|
"""
|
||||||
|
# Exclude Apple iBeacons
|
||||||
|
if device.manufacturer == 'Apple, Inc.' and device.model == 'iBeacon':
|
||||||
|
return True
|
||||||
|
|
||||||
# "Noisy" beacon devices usually have no associated friendly name. If a
|
# "Noisy" beacon devices usually have no associated friendly name. If a
|
||||||
# device has a valid name, we should probably include it.
|
# device has a valid name, we should probably include it.
|
||||||
if (
|
if (
|
||||||
|
@ -206,6 +210,10 @@ class EventHandler:
|
||||||
):
|
):
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
# If the device has no children and no manufacturer, skip it
|
||||||
|
if not (device.children and device.manufacturer):
|
||||||
|
return True
|
||||||
|
|
||||||
# If the device has any children other than services, don't skip it
|
# If the device has any children other than services, don't skip it
|
||||||
if any(not isinstance(child, BluetoothService) for child in device.children):
|
if any(not isinstance(child, BluetoothService) for child in device.children):
|
||||||
return False
|
return False
|
||||||
|
|
Loading…
Reference in a new issue