diff --git a/custom_components/moonraker/sensor.py b/custom_components/moonraker/sensor.py index c4f8189..cda7286 100755 --- a/custom_components/moonraker/sensor.py +++ b/custom_components/moonraker/sensor.py @@ -388,7 +388,7 @@ async def async_setup_optional_sensors(coordinator, entry, async_add_entities): METHODS.PRINTER_OBJECTS_QUERY, query_obj, quiet=True ) - if "pressure" in result["status"][obj].keys(): + if "pressure" in result["status"][obj]: desc = MoonrakerSensorDescription( key=f"{split_obj[0]}_{split_obj[1]}_pressure", status_key=obj, @@ -403,7 +403,7 @@ async def async_setup_optional_sensors(coordinator, entry, async_add_entities): ) sensors.append(desc) - if "humidity" in result["status"][obj].keys(): + if "humidity" in result["status"][obj]: desc = MoonrakerSensorDescription( key=f"{split_obj[0]}_{split_obj[1]}_humidity", status_key=obj, @@ -418,7 +418,7 @@ async def async_setup_optional_sensors(coordinator, entry, async_add_entities): ) sensors.append(desc) - if "gas" in result["status"][obj].keys(): + if "gas" in result["status"][obj]: desc = MoonrakerSensorDescription( key=f"{split_obj[0]}_{split_obj[1]}_gas", status_key=obj,