tomaae / homeassistant-mikrotik_router

Mikrotik router integration for Home Assistant
Apache License 2.0
309 stars 53 forks source link

Addon won't start #178

Closed ryanlenard closed 2 years ago

ryanlenard commented 2 years ago

Addon won't start with "Port Traffic Sensors" turned on.

CCR1016-12G RouterOS 6.48.4

This error originated from a custom integration.

Logger: homeassistant.config_entries Source: custom_components/mikrotik_router/mikrotik_controller.py:767 Integration: Mikrotik Router (documentation, issues) First occurred: 12:26:58 AM (1 occurrences) Last logged: 12:26:58 AM

Error setting up entry Mikrotik for mikrotik_router Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/config_entries.py", line 327, in async_setup result = await component.async_setup_entry(hass, self) File "/config/custom_components/mikrotik_router/init.py", line 57, in async_setup_entry await controller.async_update() File "/config/custom_components/mikrotik_router/mikrotik_controller.py", line 596, in async_update await self.hass.async_add_executor_job(self.get_interface_traffic) File "/usr/local/lib/python3.9/concurrent/futures/thread.py", line 52, in run result = self.fn(*self.args, **self.kwargs) File "/config/custom_components/mikrotik_router/mikrotik_controller.py", line 767, in get_interface_traffic interface_list += self.data["interface"][uid]["name"] + "," TypeError: unsupported operand type(s) for +: 'int' and 'str'

Screenshot 2022-02-26 002412

tomaae commented 2 years ago

Its because one of your interfaces is just a number. See #151 It will be fixed in next version, but you can easy fix it by renaming the interface. Adding any character to it will do it.