Move WiZ socket ident to upstream lib (#65958)

This commit is contained in:
J. Nick Koston 2022-02-07 10:44:52 -06:00 committed by GitHub
parent d82899ed2f
commit ace74279f1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 7 additions and 12 deletions

View file

@ -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)}"