mirror of
https://github.com/home-assistant/core.git
synced 2025-07-13 16:27:08 +00:00
Allow UniFi control PoE passthrough properly (#92028)
This commit is contained in:
parent
828aed73af
commit
09109d093e
@ -131,7 +131,9 @@ async def async_poe_port_control_fn(
|
|||||||
"""Control poe state."""
|
"""Control poe state."""
|
||||||
mac, _, index = obj_id.partition("_")
|
mac, _, index = obj_id.partition("_")
|
||||||
device = api.devices[mac]
|
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))
|
await api.request(DeviceSetPoePortModeRequest.create(device, int(index), state))
|
||||||
|
|
||||||
|
|
||||||
|
@ -138,6 +138,7 @@ DEVICE_1 = {
|
|||||||
"media": "GE",
|
"media": "GE",
|
||||||
"name": "Port 1",
|
"name": "Port 1",
|
||||||
"port_idx": 1,
|
"port_idx": 1,
|
||||||
|
"poe_caps": 7,
|
||||||
"poe_class": "Class 4",
|
"poe_class": "Class 4",
|
||||||
"poe_enable": True,
|
"poe_enable": True,
|
||||||
"poe_mode": "auto",
|
"poe_mode": "auto",
|
||||||
@ -151,6 +152,7 @@ DEVICE_1 = {
|
|||||||
"media": "GE",
|
"media": "GE",
|
||||||
"name": "Port 2",
|
"name": "Port 2",
|
||||||
"port_idx": 2,
|
"port_idx": 2,
|
||||||
|
"poe_caps": 7,
|
||||||
"poe_class": "Class 4",
|
"poe_class": "Class 4",
|
||||||
"poe_enable": True,
|
"poe_enable": True,
|
||||||
"poe_mode": "auto",
|
"poe_mode": "auto",
|
||||||
@ -164,6 +166,7 @@ DEVICE_1 = {
|
|||||||
"media": "GE",
|
"media": "GE",
|
||||||
"name": "Port 3",
|
"name": "Port 3",
|
||||||
"port_idx": 3,
|
"port_idx": 3,
|
||||||
|
"poe_caps": 7,
|
||||||
"poe_class": "Unknown",
|
"poe_class": "Unknown",
|
||||||
"poe_enable": False,
|
"poe_enable": False,
|
||||||
"poe_mode": "off",
|
"poe_mode": "off",
|
||||||
@ -177,6 +180,7 @@ DEVICE_1 = {
|
|||||||
"media": "GE",
|
"media": "GE",
|
||||||
"name": "Port 4",
|
"name": "Port 4",
|
||||||
"port_idx": 4,
|
"port_idx": 4,
|
||||||
|
"poe_caps": 7,
|
||||||
"poe_class": "Unknown",
|
"poe_class": "Unknown",
|
||||||
"poe_enable": False,
|
"poe_enable": False,
|
||||||
"poe_mode": "auto",
|
"poe_mode": "auto",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user