diff --git a/custom_components/mikrotik_router/mikrotik_controller.py b/custom_components/mikrotik_router/mikrotik_controller.py index 5a47e7f..73a5707 100644 --- a/custom_components/mikrotik_router/mikrotik_controller.py +++ b/custom_components/mikrotik_router/mikrotik_controller.py @@ -536,6 +536,7 @@ class MikrotikControllerData: {"name": "link-downs"}, {"name": "tx-queue-drop"}, {"name": "actual-mtu"}, + {"name": "about", "source": ".about", "default": ""}, ], ensure_vals=[ {"name": "client-ip-address"}, diff --git a/custom_components/mikrotik_router/switch.py b/custom_components/mikrotik_router/switch.py index 89564b3..ac3200f 100644 --- a/custom_components/mikrotik_router/switch.py +++ b/custom_components/mikrotik_router/switch.py @@ -263,6 +263,9 @@ class MikrotikControllerPortSwitch(MikrotikControllerSwitch): """Turn on the switch.""" path = "/interface" param = "default-name" + if self._data["about"] == "managed by CAPsMAN": + _LOGGER.error("Unable to enable %s, managed by CAPsMAN", self._data[param]) + return "managed by CAPsMAN" if "-" in self._data["port-mac-address"]: param = "name" value = self._data[param] @@ -280,6 +283,9 @@ class MikrotikControllerPortSwitch(MikrotikControllerSwitch): """Turn on the switch.""" path = "/interface" param = "default-name" + if self._data["about"] == "managed by CAPsMAN": + _LOGGER.error("Unable to disable %s, managed by CAPsMAN", self._data[param]) + return "managed by CAPsMAN" if "-" in self._data["port-mac-address"]: param = "name" value = self._data[param]