File tree Expand file tree Collapse file tree 3 files changed +5
-4
lines changed
custom_components/asusrouter Expand file tree Collapse file tree 3 files changed +5
-4
lines changed Original file line number Diff line number Diff 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
Original file line number Diff line number Diff line change 1414 "manufacturer" : " ASUSTeK Computer Inc."
1515 }
1616 ],
17- "version" : " 0.27.1 "
17+ "version" : " 0.27.2 "
1818}
Original file line number Diff line number Diff line change 99from homeassistant .components .switch import SwitchEntity
1010from homeassistant .config_entries import ConfigEntry
1111from homeassistant .core import HomeAssistant , callback
12- from homeassistant .helpers . device_registry import format_mac
12+ from homeassistant .helpers import device_registry as dr
1313from homeassistant .helpers .dispatcher import async_dispatcher_connect
1414from homeassistant .helpers .entity import DeviceInfo
1515from 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 },
You can’t perform that action at this time.
0 commit comments