Skip to content

Commit 44e4eba

Browse files
authored
fix: device ui name (#509)
Fix client naming by adding ui_device_name attribute
1 parent f54d369 commit 44e4eba

2 files changed

Lines changed: 3 additions & 0 deletions

File tree

custom_components/tplink_deco/const.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
ATTR_SIGNAL_BAND2_4 = "signal_band2_4"
3535
ATTR_SIGNAL_BAND5 = "signal_band5"
3636
ATTR_UP_KILOBYTES_PER_S = "up_kilobytes_per_s"
37+
ATTR_UI_DEVICE_NAME = "ui_device_name"
3738

3839
# Config
3940
CONF_CLIENT_PREFIX = "client_prefix"

custom_components/tplink_deco/device_tracker.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
from .const import ATTR_MASTER
3030
from .const import ATTR_SIGNAL_BAND2_4
3131
from .const import ATTR_SIGNAL_BAND5
32+
from .const import ATTR_UI_DEVICE_NAME
3233
from .const import ATTR_UP_KILOBYTES_PER_S
3334
from .const import CONF_CLIENT_POSTFIX
3435
from .const import CONF_CLIENT_PREFIX
@@ -404,6 +405,7 @@ def extra_state_attributes(self) -> dict[str:Any]:
404405
ATTR_UP_KILOBYTES_PER_S: self._client.up_kilobytes_per_s,
405406
ATTR_DECO_DEVICE: None if deco is None else deco.name,
406407
ATTR_DECO_MAC: self._attr_deco_mac,
408+
ATTR_UI_DEVICE_NAME: self._attr_name,
407409
}
408410

409411
@property

0 commit comments

Comments
 (0)