File tree Expand file tree Collapse file tree
custom_components/unifi_network_rules/helpers Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -442,22 +442,10 @@ def get_rule_name(rule: Any, coordinator=None) -> str | None:
442442 elif isinstance (rule , Device ):
443443 rule_type = "devices"
444444 elif isinstance (rule , NetworkConf ):
445- # Decide if this network should be exposed as a switch entity.
446- # Omit VPN networks since we already have VPN switches.
447- raw = getattr (rule , "raw" , {}) if hasattr (rule , "raw" ) else {}
448- purpose = str (raw .get ("purpose" , "" )).lower ()
449- vpn_type = str (raw .get ("vpn_type" , "" )).lower ()
450- is_vpn = (
451- purpose .startswith ("vpn" )
452- or purpose in {"remote-user-vpn" , "vpn-client" , "vpn-server" }
453- or "vpn" in vpn_type
454- or "wireguard" in vpn_type
455- or "openvpn" in vpn_type
456- )
457- if is_vpn :
458- rule_type = None # signal to caller there is no switch type
459- else :
460- rule_type = "networks"
445+ # NetworkConf objects passed here are already filtered by the coordinator
446+ # VPN networks are separated into vpn_clients/vpn_servers collections
447+ # So all NetworkConf objects should be treated as network switches
448+ rule_type = "networks"
461449 elif isinstance (rule , PortProfile ):
462450 rule_type = "port_profiles"
463451 elif isinstance (rule , dict ) and "type" in rule :
You can’t perform that action at this time.
0 commit comments