mirror of
https://github.com/home-assistant/core.git
synced 2025-04-25 01:38:02 +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:
|
||||
"""Find and return switches controlled by shell commands."""
|
||||
|
||||
if not discovery_info:
|
||||
return
|
||||
switches = []
|
||||
discovery_info = cast(DiscoveryInfoType, discovery_info)
|
||||
entities: dict[str, dict[str, Any]] = {
|
||||
|
Loading…
x
Reference in New Issue
Block a user