mirror of
https://github.com/home-assistant/core.git
synced 2025-07-21 20:27:08 +00:00
Improve naming and attrs of hostnameless Huawei LTE device tracker entities (#29281)
This commit is contained in:
parent
22225cea4d
commit
a9baa24fda
@ -145,11 +145,10 @@ class HuaweiLteScannerEntity(HuaweiLteBaseEntity, ScannerEntity):
|
||||
host = next((x for x in hosts if x.get("MacAddress") == self.mac), None)
|
||||
self._is_connected = host is not None
|
||||
if self._is_connected:
|
||||
self._name = host.get("HostName", self.mac)
|
||||
# HostName may be present with explicit None value
|
||||
self._name = host.get("HostName") or self.mac
|
||||
self._device_state_attributes = {
|
||||
_better_snakecase(k): v
|
||||
for k, v in host.items()
|
||||
if k not in ("MacAddress", "HostName")
|
||||
_better_snakecase(k): v for k, v in host.items() if k != "HostName"
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user