Skip to content

Commit

Permalink
0.27.2 (#759)
Browse files Browse the repository at this point in the history
* Add device info connections for clients (#756)

* Bump version to `0.27.2`

* Explicitly assign empty string for pc rule name when not provided (#758)
  • Loading branch information
Vaskivskyi authored Jan 3, 2024
1 parent b0b1409 commit 60e978d
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion custom_components/asusrouter/bridge.py
Original file line number Diff line number Diff line change
Expand Up @@ -594,7 +594,7 @@ def _pc_device2rule(

return ParentalControlRule(
mac=mac.upper(),
name=device.get("name", None),
name=device.get("name", ""),
type=rule_type,
)

Expand Down
2 changes: 1 addition & 1 deletion custom_components/asusrouter/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@
"manufacturer": "ASUSTeK Computer Inc."
}
],
"version": "0.27.1"
"version": "0.27.2"
}
5 changes: 3 additions & 2 deletions custom_components/asusrouter/switch.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from homeassistant.components.switch import SwitchEntity
from homeassistant.config_entries import ConfigEntry
from homeassistant.core import HomeAssistant, callback
from homeassistant.helpers.device_registry import format_mac
from homeassistant.helpers import device_registry as dr
from homeassistant.helpers.dispatcher import async_dispatcher_connect
from homeassistant.helpers.entity import DeviceInfo
from homeassistant.helpers.entity_platform import AddEntitiesCallback
Expand Down Expand Up @@ -150,7 +150,7 @@ def __init__(

self._router = router
self._rule = rule
self._mac = format_mac(rule.mac)
self._mac = dr.format_mac(rule.mac)
self._attr_unique_id = to_unique_id(f"{router.mac}_{self._mac}_block_internet")
self._attr_name = f"{rule.name} Block Internet"

Expand All @@ -162,6 +162,7 @@ def _compile_device_info(self) -> DeviceInfo:
"""Compile device info."""

return DeviceInfo(
connections={(dr.CONNECTION_NETWORK_MAC, self._mac)},
identifiers={
(DOMAIN, self._mac),
},
Expand Down

0 comments on commit 60e978d

Please sign in to comment.