Skip to content

Commit

Permalink
Fix custom config for ble/mesh models
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexxIT committed Apr 2, 2024
1 parent 7054dc4 commit 6644699
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions custom_components/xiaomi_gateway3/hass/hass_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,8 @@

def fix_yaml_devices_config(value: dict):
for uid, config in list(value.items()):
new_uid = f"0x{uid:016x}" if isinstance(uid, int) else uid.lower()
if uid != new_uid:
value[new_uid] = value.pop(uid)
if isinstance(uid, int) and uid > 100_000: # fix uid as int
value[f"0x{uid:016x}"] = value.pop(uid)
for k, v in config.items():
if isinstance(v, dict):
config[k] = dict(v) # fix NodeDictClass
Expand Down

0 comments on commit 6644699

Please sign in to comment.