Skip to content

Commit

Permalink
Catch unknown equipment values (#49073)
Browse files Browse the repository at this point in the history
* Catch unknown equipment values

* Catch unknown equipment values

* Remove warning spam.
  • Loading branch information
dieselrabbit authored Apr 11, 2021
1 parent 1d28f48 commit 41ff6fc
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion homeassistant/components/screenlogic/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,9 +195,15 @@ def device_info(self):
"""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,
}

0 comments on commit 41ff6fc

Please sign in to comment.