mirror of
https://github.com/tomaae/homeassistant-mikrotik_router.git
synced 2025-07-13 10:54:33 +02:00
Disable switch for wlans managed by caps #73
This commit is contained in:
parent
d4d76e3089
commit
117fec7654
2 changed files with 7 additions and 0 deletions
|
@ -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"},
|
||||
|
|
|
@ -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]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue