Skip to content

Commit 60e978d

Browse files
authored
0.27.2 (#759)
* 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)
1 parent b0b1409 commit 60e978d

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

custom_components/asusrouter/bridge.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -594,7 +594,7 @@ def _pc_device2rule(
594594

595595
return ParentalControlRule(
596596
mac=mac.upper(),
597-
name=device.get("name", None),
597+
name=device.get("name", ""),
598598
type=rule_type,
599599
)
600600

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.1"
17+
"version": "0.27.2"
1818
}

custom_components/asusrouter/switch.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
from homeassistant.components.switch import SwitchEntity
1010
from homeassistant.config_entries import ConfigEntry
1111
from homeassistant.core import HomeAssistant, callback
12-
from homeassistant.helpers.device_registry import format_mac
12+
from homeassistant.helpers import device_registry as dr
1313
from homeassistant.helpers.dispatcher import async_dispatcher_connect
1414
from homeassistant.helpers.entity import DeviceInfo
1515
from homeassistant.helpers.entity_platform import AddEntitiesCallback
@@ -150,7 +150,7 @@ def __init__(
150150

151151
self._router = router
152152
self._rule = rule
153-
self._mac = format_mac(rule.mac)
153+
self._mac = dr.format_mac(rule.mac)
154154
self._attr_unique_id = to_unique_id(f"{router.mac}_{self._mac}_block_internet")
155155
self._attr_name = f"{rule.name} Block Internet"
156156

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

164164
return DeviceInfo(
165+
connections={(dr.CONNECTION_NETWORK_MAC, self._mac)},
165166
identifiers={
166167
(DOMAIN, self._mac),
167168
},

0 commit comments

Comments
 (0)