Skip to content

Commit

Permalink
🛠 improve for extend_miot_specs (#2372)
Browse files Browse the repository at this point in the history
  • Loading branch information
al-one committed Feb 20, 2025
1 parent e39f75c commit 9446528
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion custom_components/xiaomi_miot/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,11 @@ async def async_setup(hass, hass_config: dict):

def extend_miot_specs():
with open(os.path.dirname(__file__) + '/core/miot_specs_extend.json') as file:
models = json.load(file) or {}
try:
models = json.load(file) or {}
except ValueError as exc:
models = {}
_LOGGER.exception('Error parsing miot_specs_extend.json: %s', exc)
for m, specs in models.items():
DEVICE_CUSTOMIZES.setdefault(m, {})
DEVICE_CUSTOMIZES[m]['extend_miot_specs'] = specs
Expand Down

0 comments on commit 9446528

Please sign in to comment.