Fixes/zha ieee tail (#28160)

* Fix ZHA entity_id assignment.

* Update tests.
This commit is contained in:
Alexei Chetroi 2019-10-24 12:23:02 -04:00 committed by David F. Mulcahey
parent b1fcecd526
commit 969322e14a
2 changed files with 2 additions and 2 deletions

View file

@ -40,7 +40,7 @@ class ZhaEntity(RestoreEntity, LogMixin, entity.Entity):
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),