Move WiZ socket ident to upstream lib (#65958)
This commit is contained in:
parent
d82899ed2f
commit
ace74279f1
4 changed files with 7 additions and 12 deletions
|
@ -3,7 +3,7 @@ from __future__ import annotations
|
|||
|
||||
from pywizlight import BulbType
|
||||
|
||||
from .const import DEFAULT_NAME, SOCKET_DEVICE_STR
|
||||
from .const import DEFAULT_NAME
|
||||
|
||||
|
||||
def _short_mac(mac: str) -> str:
|
||||
|
@ -13,8 +13,4 @@ def _short_mac(mac: str) -> str:
|
|||
|
||||
def name_from_bulb_type_and_mac(bulb_type: BulbType, mac: str) -> str:
|
||||
"""Generate a name from bulb_type and mac."""
|
||||
if SOCKET_DEVICE_STR in bulb_type.name:
|
||||
description = "Socket"
|
||||
else:
|
||||
description = bulb_type.bulb_type.value
|
||||
return f"{DEFAULT_NAME} {description} {_short_mac(mac)}"
|
||||
return f"{DEFAULT_NAME} {bulb_type.bulb_type.value} {_short_mac(mac)}"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue