From 41ff6fc27846e4ead0cc0a3648b80317020a8c31 Mon Sep 17 00:00:00 2001 From: Kevin Worrel <37058192+dieselrabbit@users.noreply.github.com> Date: Sun, 11 Apr 2021 15:12:59 -0700 Subject: [PATCH] Catch unknown equipment values (#49073) * Catch unknown equipment values * Catch unknown equipment values * Remove warning spam. --- homeassistant/components/screenlogic/__init__.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/homeassistant/components/screenlogic/__init__.py b/homeassistant/components/screenlogic/__init__.py index 11f71cfd337..c5c082cd509 100644 --- a/homeassistant/components/screenlogic/__init__.py +++ b/homeassistant/components/screenlogic/__init__.py @@ -195,9 +195,15 @@ class ScreenlogicEntity(CoordinatorEntity): """Return device information for the controller.""" controller_type = self.config_data["controller_type"] hardware_type = self.config_data["hardware_type"] + try: + equipment_model = EQUIPMENT.CONTROLLER_HARDWARE[controller_type][ + hardware_type + ] + except KeyError: + equipment_model = f"Unknown Model C:{controller_type} H:{hardware_type}" return { "connections": {(dr.CONNECTION_NETWORK_MAC, self.mac)}, "name": self.gateway_name, "manufacturer": "Pentair", - "model": EQUIPMENT.CONTROLLER_HARDWARE[controller_type][hardware_type], + "model": equipment_model, }