mirror of
https://github.com/home-assistant/core.git
synced 2025-04-25 17:57:55 +00:00
Handle command_line missing discovery_info (#116873)
* command_line: Do not lead to erroring out code indexing None or empty discovery_info * Apply suggestions from code review Co-authored-by: Franck Nijhof <frenck@frenck.nl> --------- Co-authored-by: Erik Montnemery <erik@montnemery.com> Co-authored-by: Franck Nijhof <frenck@frenck.nl>
This commit is contained in:
parent
70704f67d3
commit
e682d8c6e2
@ -37,6 +37,8 @@ async def async_setup_platform(
|
|||||||
) -> None:
|
) -> None:
|
||||||
"""Find and return switches controlled by shell commands."""
|
"""Find and return switches controlled by shell commands."""
|
||||||
|
|
||||||
|
if not discovery_info:
|
||||||
|
return
|
||||||
switches = []
|
switches = []
|
||||||
discovery_info = cast(DiscoveryInfoType, discovery_info)
|
discovery_info = cast(DiscoveryInfoType, discovery_info)
|
||||||
entities: dict[str, dict[str, Any]] = {
|
entities: dict[str, dict[str, Any]] = {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user