Fix internet access switch for Fritz Wi-Fi guest devices (#63407)
This commit is contained in:
parent
c1967abfca
commit
cd5bd2ff8b
1 changed files with 9 additions and 6 deletions
|
@ -110,7 +110,7 @@ class Device:
|
||||||
ip_address: str
|
ip_address: str
|
||||||
name: str
|
name: str
|
||||||
ssid: str | None
|
ssid: str | None
|
||||||
wan_access: bool
|
wan_access: bool = True
|
||||||
|
|
||||||
|
|
||||||
class Interface(TypedDict):
|
class Interface(TypedDict):
|
||||||
|
@ -118,6 +118,7 @@ class Interface(TypedDict):
|
||||||
|
|
||||||
device: str
|
device: str
|
||||||
mac: str
|
mac: str
|
||||||
|
op_mode: str
|
||||||
ssid: str | None
|
ssid: str | None
|
||||||
type: str
|
type: str
|
||||||
|
|
||||||
|
@ -331,6 +332,7 @@ class FritzBoxTools(update_coordinator.DataUpdateCoordinator):
|
||||||
mesh_intf[interf["uid"]] = Interface(
|
mesh_intf[interf["uid"]] = Interface(
|
||||||
device=node["device_name"],
|
device=node["device_name"],
|
||||||
mac=int_mac,
|
mac=int_mac,
|
||||||
|
op_mode=interf.get("op_mode", ""),
|
||||||
ssid=interf.get("ssid", ""),
|
ssid=interf.get("ssid", ""),
|
||||||
type=interf["type"],
|
type=interf["type"],
|
||||||
)
|
)
|
||||||
|
@ -352,11 +354,12 @@ class FritzBoxTools(update_coordinator.DataUpdateCoordinator):
|
||||||
and dev_mac in hosts
|
and dev_mac in hosts
|
||||||
):
|
):
|
||||||
dev_info: Device = hosts[dev_mac]
|
dev_info: Device = hosts[dev_mac]
|
||||||
dev_info.wan_access = not self.connection.call_action(
|
if intf["op_mode"] != "AP_GUEST":
|
||||||
"X_AVM-DE_HostFilter:1",
|
dev_info.wan_access = not self.connection.call_action(
|
||||||
"GetWANAccessByIP",
|
"X_AVM-DE_HostFilter:1",
|
||||||
NewIPv4Address=dev_info.ip_address,
|
"GetWANAccessByIP",
|
||||||
).get("NewDisallow")
|
NewIPv4Address=dev_info.ip_address,
|
||||||
|
).get("NewDisallow")
|
||||||
|
|
||||||
dev_info.connected_to = intf["device"]
|
dev_info.connected_to = intf["device"]
|
||||||
dev_info.connection_type = intf["type"]
|
dev_info.connection_type = intf["type"]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue