Improve airthings ble (#97905)
Co-authored-by: J. Nick Koston <nick@koston.org>
This commit is contained in:
parent
a234ab51fe
commit
b34ce3c792
7 changed files with 38 additions and 15 deletions
|
@ -162,10 +162,11 @@ class AirthingsSensor(
|
|||
super().__init__(coordinator)
|
||||
self.entity_description = entity_description
|
||||
|
||||
name = f"{airthings_device.name} {airthings_device.identifier}"
|
||||
name = airthings_device.name
|
||||
if identifier := airthings_device.identifier:
|
||||
name += f" ({identifier})"
|
||||
|
||||
self._attr_unique_id = f"{name}_{entity_description.key}"
|
||||
|
||||
self._id = airthings_device.address
|
||||
self._attr_device_info = DeviceInfo(
|
||||
connections={
|
||||
|
@ -175,9 +176,10 @@ class AirthingsSensor(
|
|||
)
|
||||
},
|
||||
name=name,
|
||||
manufacturer="Airthings",
|
||||
manufacturer=airthings_device.manufacturer,
|
||||
hw_version=airthings_device.hw_version,
|
||||
sw_version=airthings_device.sw_version,
|
||||
model=airthings_device.model,
|
||||
)
|
||||
|
||||
@property
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue