elbowz / ha-homie

Homie integration for Home Assistant
GNU General Public License v3.0
11 stars 5 forks source link

Error during device registry #5

Closed legovaer closed 2 years ago

legovaer commented 2 years ago

I just bumped into this issue;

Logger: homeassistant
Source: helpers/device_registry.py:131 
First occurred: 22:00:32 (1 occurrences) 
Last logged: 22:00:32

Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/config/custom_components/homie/homie/component.py", line 138, in _async_update_topic_dict
    await self._async_on_ready(self)
  File "/config/custom_components/homie/utils.py", line 33, in wrap_f
    return await f(*args, **kwargs)
  File "/config/custom_components/homie/__init__.py", line 221, in async_device_on_ready
    async_create_ha_device(hass, homie_device, entry)
  File "/config/custom_components/homie/mixins.py", line 45, in async_create_ha_device
    mac = device_registry.format_mac(device.t["$mac"])
  File "/usr/src/homeassistant/homeassistant/helpers/device_registry.py", line 131, in format_mac
    if len(to_test) == 17 and to_test.count(":") == 5:
TypeError: object of type 'NoneType' has no len()
elbowz commented 2 years ago

Try the fix-#1 branch

elbowz commented 2 years ago

If it no fix the issue feel free to reopen another one