From e4cda9ae0bcbe68449ff7cb600fe2daf80315206 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ville=20Skytt=C3=A4?= <ville.skytta@iki.fi>
Date: Sat, 28 Dec 2019 13:55:45 +0200
Subject: [PATCH] Fix Huawei LTE error message on service call without URL and
 routers (#30250)

---
 homeassistant/components/huawei_lte/__init__.py | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/homeassistant/components/huawei_lte/__init__.py b/homeassistant/components/huawei_lte/__init__.py
index deb92de218c..97a57405ae0 100644
--- a/homeassistant/components/huawei_lte/__init__.py
+++ b/homeassistant/components/huawei_lte/__init__.py
@@ -439,6 +439,9 @@ async def async_setup(hass: HomeAssistantType, config) -> bool:
         routers = hass.data[DOMAIN].routers
         if url:
             router = routers.get(url)
+        elif not routers:
+            _LOGGER.error("%s: no routers configured", service.service)
+            return
         elif len(routers) == 1:
             router = next(iter(routers.values()))
         else:
-- 
GitLab