mirror of
https://github.com/home-assistant/core.git
synced 2025-12-24 21:06:19 +00:00
Add a guard to handle unhashable platforms in config (#113607)
Someone might set the platform to [fitbit] instead of fitbit I have not seen anyone do this, but its good to guard against it
This commit is contained in:
@@ -2348,6 +2348,7 @@ def test_extract_platform_integrations() -> None:
|
||||
[
|
||||
(b"zone", {"platform": "not str"}),
|
||||
("zone", {"platform": "hello"}),
|
||||
("switch", {"platform": ["un", "hash", "able"]}),
|
||||
("zonex", []),
|
||||
("zoney", ""),
|
||||
("notzone", {"platform": "nothello"}),
|
||||
@@ -2363,6 +2364,7 @@ def test_extract_platform_integrations() -> None:
|
||||
assert config_util.extract_platform_integrations(config, {"zone"}) == {
|
||||
"zone": {"hello", "hello 2"}
|
||||
}
|
||||
assert config_util.extract_platform_integrations(config, {"switch"}) == {}
|
||||
assert config_util.extract_platform_integrations(config, {"zonex"}) == {}
|
||||
assert config_util.extract_platform_integrations(config, {"zoney"}) == {}
|
||||
assert config_util.extract_platform_integrations(
|
||||
|
||||
Reference in New Issue
Block a user