mirror of
https://github.com/tomaae/homeassistant-mikrotik_router.git
synced 2025-07-02 21:44:31 +02:00
added wifi information sensors and binary sensors
This commit is contained in:
parent
c5570b6d5e
commit
0af7bc184c
4 changed files with 58 additions and 0 deletions
|
@ -11,6 +11,7 @@ from .sensor_types import (
|
|||
SENSOR_SERVICES,
|
||||
DEVICE_ATTRIBUTES_IFACE_ETHER,
|
||||
DEVICE_ATTRIBUTES_IFACE_SFP,
|
||||
DEVICE_ATTRIBUTES_IFACE_WIRELESS,
|
||||
)
|
||||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
@ -86,6 +87,11 @@ class MikrotikInterfaceTrafficSensor(MikrotikSensor):
|
|||
if variable in self._data:
|
||||
attributes[format_attribute(variable)] = self._data[variable]
|
||||
|
||||
elif self._data["type"] == "wlan":
|
||||
for variable in DEVICE_ATTRIBUTES_IFACE_WIRELESS:
|
||||
if variable in self._data:
|
||||
attributes[format_attribute(variable)] = self._data[variable]
|
||||
|
||||
return attributes
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue