From d8c2732bcb7d9f4277efb6959f2eb39cc4ee9a06 Mon Sep 17 00:00:00 2001 From: Jannik Beyerstedt Date: Tue, 14 Jul 2020 22:56:02 +0200 Subject: [PATCH] Do no crash Luftdaten on additional data returned by the API (#37763) --- homeassistant/components/luftdaten/sensor.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/homeassistant/components/luftdaten/sensor.py b/homeassistant/components/luftdaten/sensor.py index cfde5bba872..2d9a8fa85a4 100644 --- a/homeassistant/components/luftdaten/sensor.py +++ b/homeassistant/components/luftdaten/sensor.py @@ -30,7 +30,12 @@ async def async_setup_entry(hass, entry, async_add_entities): sensors = [] for sensor_type in luftdaten.sensor_conditions: - name, icon, unit = SENSORS[sensor_type] + try: + name, icon, unit = SENSORS[sensor_type] + except KeyError: + _LOGGER.debug("Unknown sensor value type: %s", sensor_type) + continue + sensors.append( LuftdatenSensor( luftdaten, sensor_type, name, icon, unit, entry.data[CONF_SHOW_ON_MAP]