forked from platypush/platypush
A more elegant logic to infer the manufacturer name.
This commit is contained in:
parent
b568876474
commit
6e9263c4e4
1 changed files with 1 additions and 3 deletions
|
@ -236,9 +236,7 @@ def device_to_entity(device: BLEDevice, data: AdvertisementData) -> BluetoothDev
|
||||||
theengs_entity = _parse_advertisement_data(data)
|
theengs_entity = _parse_advertisement_data(data)
|
||||||
props = (device.details or {}).get('props', {})
|
props = (device.details or {}).get('props', {})
|
||||||
manufacturer = theengs_entity.manufacturer or company.get(
|
manufacturer = theengs_entity.manufacturer or company.get(
|
||||||
list(device.metadata['manufacturer_data'].keys())[0]
|
next(iter(key for key in device.metadata['manufacturer_data']), 0xFFFF)
|
||||||
if device.metadata.get('manufacturer_data', {})
|
|
||||||
else None
|
|
||||||
)
|
)
|
||||||
|
|
||||||
parent_entity = BluetoothDevice(
|
parent_entity = BluetoothDevice(
|
||||||
|
|
Loading…
Reference in a new issue