Fix missing device name with legacy flux_led discovery (#62785)

This commit is contained in:
J. Nick Koston 2022-01-06 19:43:22 -10:00 committed by GitHub
parent ff3b7489ec
commit ad68d0795e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 215 additions and 39 deletions

View file

@ -18,6 +18,11 @@ def _hass_color_modes(device: AIOWifiLedBulb) -> set[str]:
return {_flux_color_mode_to_hass(mode, color_modes) for mode in color_modes}
def format_as_flux_mac(mac: str | None) -> str | None:
"""Convert a device registry formatted mac to flux mac."""
return None if mac is None else mac.replace(":", "").upper()
def _flux_color_mode_to_hass(
flux_color_mode: str | None, flux_color_modes: set[str]
) -> str: