Skip to content

Commit

Permalink
Fix Tests
Browse files Browse the repository at this point in the history
  • Loading branch information
frimtec committed Jun 13, 2021
1 parent 9b85798 commit a920aea
Showing 1 changed file with 21 additions and 19 deletions.
40 changes: 21 additions & 19 deletions compal/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1049,8 +1049,8 @@ def wifi_guest_network_settings(self):
one_and_only_relevant_index = 2

interfaces = {
'2g': list(xml.iter("Interface"))[one_and_only_relevant_index],
'5g': list(xml.iter("Interface5G"))[one_and_only_relevant_index],
"2g": list(xml.iter("Interface"))[one_and_only_relevant_index],
"5g": list(xml.iter("Interface5G"))[one_and_only_relevant_index],
}

def guest_xv(band, attr, coherce=True):
Expand All @@ -1067,15 +1067,15 @@ def guest_xv(band, attr, coherce=True):
)

return GuestNetworkSettings(
GuestNetworkEnabling(guest_xv('2g', "Enable") == 1, guest_xv('2g', "GuestMac")),
GuestNetworkEnabling(guest_xv('5g', "Enable") == 1, guest_xv('5g', "GuestMac")),
GuestNetworkEnabling(guest_xv("2g", "Enable") == 1, guest_xv("2g", "GuestMac")),
GuestNetworkEnabling(guest_xv("5g", "Enable") == 1, guest_xv("5g", "GuestMac")),
GuestNetworkProperties(
guest_xv('2g', "BSSID"),
guest_xv('2g', "HideNetwork"),
guest_xv('2g', "GroupRekeyInterval"),
guest_xv('2g', "SecurityMode"),
guest_xv('2g', "PreSharedKey"),
guest_xv('2g', "WpaAlgorithm"),
guest_xv("2g", "BSSID"),
guest_xv("2g", "HideNetwork"),
guest_xv("2g", "GroupRekeyInterval"),
guest_xv("2g", "SecurityMode"),
guest_xv("2g", "PreSharedKey"),
guest_xv("2g", "WpaAlgorithm"),
)
)

Expand All @@ -1086,15 +1086,17 @@ def update_wifi_guest_network_settings(self, properties, enable):
The enabling has only effect on wifi bands that are currently switched on.
Requires at least firmware CH7465LG-NCIP-6.15.30-1p3-1-NOSH.
"""
out_settings = OrderedDict([
("wlEnable", 1 if enable else 2),
("wlSsid", properties.ssid),
("wlHiden", properties.hidden),
("wlRekey", properties.re_key),
("wlSecurity", properties.security),
("wlPSkey", properties.pre_shared_key),
("wlWpaalg", properties.wpa_algorithm),
])
out_settings = OrderedDict(
[
("wlEnable", 1 if enable else 2),
("wlSsid", properties.ssid),
("wlHiden", properties.hidden),
("wlRekey", properties.re_key),
("wlSecurity", properties.security),
("wlPSkey", properties.pre_shared_key),
("wlWpaalg", properties.wpa_algorithm),
]
)
self.modem.xml_setter(
SetFunction.WIFI_GUEST_NETWORK_CONFIGURATION, out_settings
)
Expand Down

0 comments on commit a920aea

Please sign in to comment.