Skip to content

Commit

Permalink
Improve naming and attrs of hostnameless Huawei LTE device tracker en…
Browse files Browse the repository at this point in the history
…tities (#29281)
  • Loading branch information
scop authored and MartinHjelmare committed Dec 1, 2019
1 parent 22225ce commit a9baa24
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions homeassistant/components/huawei_lte/device_tracker.py
Expand Up @@ -145,11 +145,10 @@ async def async_update(self) -> None:
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"
}


Expand Down

0 comments on commit a9baa24

Please sign in to comment.