diff --git a/custom_components/mikrotik_router/binary_sensor.py b/custom_components/mikrotik_router/binary_sensor.py index 63c7cdb..ad07776 100644 --- a/custom_components/mikrotik_router/binary_sensor.py +++ b/custom_components/mikrotik_router/binary_sensor.py @@ -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 diff --git a/custom_components/mikrotik_router/binary_sensor_types.py b/custom_components/mikrotik_router/binary_sensor_types.py index d112b97..23b7dc1 100644 --- a/custom_components/mikrotik_router/binary_sensor_types.py +++ b/custom_components/mikrotik_router/binary_sensor_types.py @@ -66,6 +66,29 @@ DEVICE_ATTRIBUTES_IFACE_SFP = [ "eeprom-checksum", ] +DEVICE_ATTRIBUTES_IFACE_WIRELESS = [ + "ssid", + "mode", + "radio-name", + "interface-type", + "country", + "installation", + "antenna-gain", + "frequency", + "band", + "channel-width", + "secondary-frequency", + "wireless-protocol", + "rate-set", + "distance", + "tx-power-mode", + "vlan-id", + "wds-mode", + "wds-default-bridge", + "bridge-mode", + "hide-ssid", +] + DEVICE_ATTRIBUTES_UPS = [ "name", "offline-time", diff --git a/custom_components/mikrotik_router/sensor.py b/custom_components/mikrotik_router/sensor.py index d6786c7..74d90c8 100644 --- a/custom_components/mikrotik_router/sensor.py +++ b/custom_components/mikrotik_router/sensor.py @@ -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 diff --git a/custom_components/mikrotik_router/sensor_types.py b/custom_components/mikrotik_router/sensor_types.py index 64a1b7a..11a4025 100644 --- a/custom_components/mikrotik_router/sensor_types.py +++ b/custom_components/mikrotik_router/sensor_types.py @@ -64,6 +64,29 @@ DEVICE_ATTRIBUTES_IFACE_SFP = [ "eeprom-checksum", ] +DEVICE_ATTRIBUTES_IFACE_WIRELESS = [ + "ssid", + "mode", + "radio-name", + "interface-type", + "country", + "installation", + "antenna-gain", + "frequency", + "band", + "channel-width", + "secondary-frequency", + "wireless-protocol", + "rate-set", + "distance", + "tx-power-mode", + "vlan-id", + "wds-mode", + "wds-default-bridge", + "bridge-mode", + "hide-ssid", +] + DEVICE_ATTRIBUTES_CLIENT_TRAFFIC = [ "address", "mac-address",