Allow UniFi control PoE passthrough properly (#92028)
parent
828aed73af
commit
09109d093e
|
@ -131,7 +131,9 @@ async def async_poe_port_control_fn(
|
|||
"""Control poe state."""
|
||||
mac, _, index = obj_id.partition("_")
|
||||
device = api.devices[mac]
|
||||
state = "auto" if target else "off"
|
||||
port = api.ports[obj_id]
|
||||
on_state = "auto" if port.raw["poe_caps"] != 8 else "passthrough"
|
||||
state = on_state if target else "off"
|
||||
await api.request(DeviceSetPoePortModeRequest.create(device, int(index), state))
|
||||
|
||||
|
||||
|
|
|
@ -138,6 +138,7 @@ DEVICE_1 = {
|
|||
"media": "GE",
|
||||
"name": "Port 1",
|
||||
"port_idx": 1,
|
||||
"poe_caps": 7,
|
||||
"poe_class": "Class 4",
|
||||
"poe_enable": True,
|
||||
"poe_mode": "auto",
|
||||
|
@ -151,6 +152,7 @@ DEVICE_1 = {
|
|||
"media": "GE",
|
||||
"name": "Port 2",
|
||||
"port_idx": 2,
|
||||
"poe_caps": 7,
|
||||
"poe_class": "Class 4",
|
||||
"poe_enable": True,
|
||||
"poe_mode": "auto",
|
||||
|
@ -164,6 +166,7 @@ DEVICE_1 = {
|
|||
"media": "GE",
|
||||
"name": "Port 3",
|
||||
"port_idx": 3,
|
||||
"poe_caps": 7,
|
||||
"poe_class": "Unknown",
|
||||
"poe_enable": False,
|
||||
"poe_mode": "off",
|
||||
|
@ -177,6 +180,7 @@ DEVICE_1 = {
|
|||
"media": "GE",
|
||||
"name": "Port 4",
|
||||
"port_idx": 4,
|
||||
"poe_caps": 7,
|
||||
"poe_class": "Unknown",
|
||||
"poe_enable": False,
|
||||
"poe_mode": "auto",
|
||||
|
|
Loading…
Reference in New Issue