Skip to content

Commit b0b1409

Browse files
authored
0.27.1 (#755)
* Check that parental control rules are valid before saving them (#754) * Bump version to `0.27.1`
1 parent fed171a commit b0b1409

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

custom_components/asusrouter/bridge.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@ async def _get_data_ovpn_server(self) -> dict[str, Any]:
342342

343343
return await self._get_data(AsusData.OPENVPN_SERVER)
344344

345-
async def _get_data_parental_control(self) -> dict[str, dict[str, int]]:
345+
async def _get_data_parental_control(self) -> dict[str, Any]:
346346
"""Get parental control data from the device."""
347347

348348
return await self._get_data(

custom_components/asusrouter/manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,5 @@
1414
"manufacturer": "ASUSTeK Computer Inc."
1515
}
1616
],
17-
"version": "0.27.0"
17+
"version": "0.27.1"
1818
}

custom_components/asusrouter/router.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -646,7 +646,7 @@ async def update_pc_rules(self) -> None:
646646

647647
new_flag = False
648648

649-
rules = pc_data.get("rules", {})
649+
rules: dict[str, ParentalControlRule] = pc_data.get("rules", {})
650650

651651
rules_to_save = {}
652652

@@ -664,6 +664,13 @@ async def update_pc_rules(self) -> None:
664664
new_flag = True
665665
rules_to_save[mac] = rule
666666

667+
# Check the rules for non-valid ones
668+
rules_to_save = {
669+
mac: rule
670+
for mac, rule in rules_to_save.items()
671+
if mac != "" and rule.mac is not None
672+
}
673+
667674
# Save rules
668675
self._pc_rules = rules_to_save
669676

0 commit comments

Comments
 (0)