mirror of
https://github.com/home-assistant/core.git
synced 2025-07-13 16:27:08 +00:00
Fixes/zha ieee tail (#28160)
* Fix ZHA entity_id assignment. * Update tests.
This commit is contained in:
parent
b1fcecd526
commit
969322e14a
@ -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),
|
||||
|
@ -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),
|
||||
|
Loading…
x
Reference in New Issue
Block a user