mirror of
https://github.com/tomaae/homeassistant-mikrotik_router.git
synced 2025-06-28 19:50:06 +02:00
Turn PoE on/off when switching port on/off #71
This commit is contained in:
parent
a86eecf150
commit
c4b8c9ba5a
1 changed files with 11 additions and 0 deletions
|
@ -269,6 +269,11 @@ class MikrotikControllerPortSwitch(MikrotikControllerSwitch):
|
|||
mod_param = "disabled"
|
||||
mod_value = False
|
||||
self._ctrl.set_value(path, param, value, mod_param, mod_value)
|
||||
|
||||
if self._data["poe-out"] == "off":
|
||||
path = "/interface/ethernet"
|
||||
self._ctrl.set_value(path, param, value, "poe-out", "auto-on")
|
||||
|
||||
await self._ctrl.force_update()
|
||||
|
||||
async def async_turn_off(self):
|
||||
|
@ -281,6 +286,12 @@ class MikrotikControllerPortSwitch(MikrotikControllerSwitch):
|
|||
mod_param = "disabled"
|
||||
mod_value = True
|
||||
self._ctrl.set_value(path, param, value, mod_param, mod_value)
|
||||
|
||||
|
||||
if self._data["poe-out"] == "auto-on":
|
||||
path = "/interface/ethernet"
|
||||
self._ctrl.set_value(path, param, value, "poe-out", "off")
|
||||
|
||||
await self._ctrl.async_update()
|
||||
|
||||
# ---------------------------
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue