Add friendly name support for ESPHome (#85976)

Co-authored-by: J. Nick Koston <nick@koston.org>
This commit is contained in:
Jesse Hills
2023-01-16 20:33:44 +13:00
committed by GitHub
parent 8c235357a4
commit d3c41bc31c
6 changed files with 19 additions and 7 deletions

View File

@@ -100,6 +100,13 @@ class RuntimeEntryData:
"""Return the name of the device."""
return self.device_info.name if self.device_info else self.entry_id
@property
def friendly_name(self) -> str:
"""Return the friendly name of the device."""
if self.device_info and self.device_info.friendly_name:
return self.device_info.friendly_name
return self.name
@callback
def async_update_ble_connection_limits(self, free: int, limit: int) -> None:
"""Update the BLE connection limits."""