added wifi information sensors and binary sensors

This commit is contained in:
Tomaae 2022-08-21 22:40:37 +02:00
parent c5570b6d5e
commit 0af7bc184c
No known key found for this signature in database
GPG key ID: 8360BBD8A381D1C0
4 changed files with 58 additions and 0 deletions

View file

@ -19,6 +19,7 @@ from .binary_sensor_types import (
SENSOR_SERVICES,
DEVICE_ATTRIBUTES_IFACE_ETHER,
DEVICE_ATTRIBUTES_IFACE_SFP,
DEVICE_ATTRIBUTES_IFACE_WIRELESS,
)
_LOGGER = logging.getLogger(__name__)
@ -137,4 +138,9 @@ class MikrotikPortBinarySensor(MikrotikBinarySensor):
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