mirror of
https://github.com/home-assistant/core.git
synced 2025-07-24 05:37:44 +00:00
Fix lutron caseta discovery with newer firmwares (#61029)
This commit is contained in:
parent
9f7b8d3009
commit
f5d7adc018
@ -68,7 +68,7 @@ class LutronCasetaFlowHandler(config_entries.ConfigFlow, domain=DOMAIN):
|
||||
) -> FlowResult:
|
||||
"""Handle a flow initialized by zeroconf discovery."""
|
||||
hostname = discovery_info.hostname
|
||||
if hostname is None or not hostname.startswith("lutron-"):
|
||||
if hostname is None or not hostname.lower().startswith("lutron-"):
|
||||
return self.async_abort(reason="not_lutron_device")
|
||||
|
||||
self.lutron_id = hostname.split("-")[1].replace(".local.", "")
|
||||
|
@ -427,7 +427,7 @@ async def test_zeroconf_host_already_configured(hass, tmpdir):
|
||||
context={"source": config_entries.SOURCE_ZEROCONF},
|
||||
data=zeroconf.ZeroconfServiceInfo(
|
||||
host="1.1.1.1",
|
||||
hostname="lutron-abc.local.",
|
||||
hostname="LuTrOn-abc.local.",
|
||||
name="mock_name",
|
||||
port=None,
|
||||
properties={},
|
||||
@ -454,7 +454,7 @@ async def test_zeroconf_lutron_id_already_configured(hass):
|
||||
context={"source": config_entries.SOURCE_ZEROCONF},
|
||||
data=zeroconf.ZeroconfServiceInfo(
|
||||
host="1.1.1.1",
|
||||
hostname="lutron-abc.local.",
|
||||
hostname="LuTrOn-abc.local.",
|
||||
name="mock_name",
|
||||
port=None,
|
||||
properties={},
|
||||
@ -504,7 +504,7 @@ async def test_zeroconf(hass, source, tmpdir):
|
||||
context={"source": source},
|
||||
data=zeroconf.ZeroconfServiceInfo(
|
||||
host="1.1.1.1",
|
||||
hostname="lutron-abc.local.",
|
||||
hostname="LuTrOn-abc.local.",
|
||||
name="mock_name",
|
||||
port=None,
|
||||
properties={},
|
||||
|
@ -335,11 +335,3 @@ async def test_validate_trigger_invalid_triggers(hass, device_reg):
|
||||
]
|
||||
},
|
||||
)
|
||||
|
||||
assert (
|
||||
len(entity_ids := hass.states.async_entity_ids("persistent_notification")) == 1
|
||||
)
|
||||
assert (
|
||||
"The following integrations and platforms could not be set up"
|
||||
in hass.states.get(entity_ids[0]).attributes["message"]
|
||||
)
|
||||
|
Loading…
x
Reference in New Issue
Block a user