Skip to content

Commit

Permalink
Fixes/zha ieee tail (#28160)
Browse files Browse the repository at this point in the history
* Fix ZHA entity_id assignment.

* Update tests.
  • Loading branch information
Adminiuga authored and dmulcahey committed Oct 24, 2019
1 parent b1fcecd commit 969322e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion homeassistant/components/zha/entity.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def __init__(self, unique_id, zha_device, channels, skip_entity_id=False, **kwar
self._unique_id = unique_id
if not skip_entity_id:
ieee = zha_device.ieee
ieeetail = "".join(["%02x" % (o,) for o in ieee[-4:]])
ieeetail = "".join([f"{o:02x}" for o in ieee[:4]])
self.entity_id = "{}.{}_{}_{}_{}{}".format(
self._domain,
slugify(zha_device.manufacturer),
Expand Down
2 changes: 1 addition & 1 deletion tests/components/zha/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ def make_entity_id(domain, device, cluster, use_suffix=True):
machine so that we can test state changes.
"""
ieee = device.ieee
ieeetail = "".join(["%02x" % (o,) for o in ieee[-4:]])
ieeetail = "".join([f"{o:02x}" for o in ieee[:4]])
entity_id = "{}.{}_{}_{}_{}{}".format(
domain,
slugify(device.manufacturer),
Expand Down

0 comments on commit 969322e

Please sign in to comment.