ha-asusrouter: [Bug] RT-AC87U in Media Bridge mode with v0.17.1 - object of type 'NoneType' has no len()

The problem

RT-AC87U in Media Bridge mode throws an error when loading after updating from v0.16.1 to v0.17.1

TypeError: object of type 'NoneType' has no len()

Your device model

RT-AC87U

Firmware type

Merlin

Firmware version

3.0.0.4.384.13_10

Integration version with the issue

0.17.1

Method of the integration installation

HACS

What version and type of Home Assistant installation do you use

2023.1.2

Is there anything useful in the logs?

Logger: homeassistant.config_entries
Source: helpers/device_registry.py:129
First occurred: 09:51:06 (1 occurrences)
Last logged: 09:51:06

Error setting up entry 192.168.45.240 for asusrouter
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 382, in async_setup
    result = await component.async_setup_entry(hass, self)
  File "/config/custom_components/asusrouter/__init__.py", line 24, in async_setup_entry
    await router.setup()
  File "/config/custom_components/asusrouter/router.py", line 665, in setup
    entry.entity_id, new_unique_id=f"{self.mac}_{uid}"
  File "/config/custom_components/asusrouter/router.py", line 1097, in mac
    return format_mac(self._identity.mac)
  File "/usr/src/homeassistant/homeassistant/helpers/device_registry.py", line 129, in format_mac
    if len(to_test) == 17 and to_test.count(":") == 5:
TypeError: object of type 'NoneType' has no len()

Diagnostics information

No response

Additional information

No response

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Comments: 22 (9 by maintainers)

Most upvoted comments

@mihsu81, @ejpenney,

Please install the new version of the asusrouter library using pip install --upgrade asusrouter==0.17.0 and then try again the first code from https://github.com/Vaskivskyi/ha-asusrouter/issues/451#issuecomment-1376054682

If you cannot install the library immediately, you might need to wait a minute and try again - the release was just published, so may take a moment to become available for everyone.

Hopefully, it will return you

MAC address: `AA:BB:11:CC:22:00`

Hey, sorry to hear, you are experiencing problems with AsusRouter. Please allow me a day to try to reproduce the issue with my device