From 3a36a976ee8a95047e3098dc09540a7106a19fb5 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Fri, 7 May 2021 13:07:06 -0500 Subject: [PATCH] Small cleanups to rainmachine get_client_controller (#50250) --- homeassistant/components/rainmachine/config_flow.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/homeassistant/components/rainmachine/config_flow.py b/homeassistant/components/rainmachine/config_flow.py index 8ef21fb185e..9febb2b3a92 100644 --- a/homeassistant/components/rainmachine/config_flow.py +++ b/homeassistant/components/rainmachine/config_flow.py @@ -22,9 +22,8 @@ DATA_SCHEMA = vol.Schema( def get_client_controller(client): - """Enumerate controllers to find the first mac.""" - for controller in client.controllers.values(): - return controller + """Return the first local controller.""" + return next(iter(client.controllers.values())) async def async_get_controller(hass, ip_address, password, port, ssl):