Fix flux_led discovery with older models (#61413)
This commit is contained in:
parent
8383da6a5e
commit
8d483e2206
6 changed files with 71 additions and 24 deletions
|
@ -238,7 +238,14 @@ class ConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
|
|||
) -> FluxLEDDiscovery:
|
||||
"""Try to connect."""
|
||||
self._async_abort_entries_match({CONF_HOST: host})
|
||||
if device := await async_discover_device(self.hass, host):
|
||||
if (device := await async_discover_device(self.hass, host)) and device[
|
||||
ATTR_MODEL_DESCRIPTION
|
||||
]:
|
||||
# Older models do not return enough information
|
||||
# to build the model description via UDP so we have
|
||||
# to fallback to making a tcp connection to avoid
|
||||
# identifying the device as the chip model number
|
||||
# AKA `HF-LPB100-ZJ200`
|
||||
return device
|
||||
bulb = async_wifi_bulb_for_host(host)
|
||||
try:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue