From b2b995897b40f5a72f8e00443885a8ea710b3420 Mon Sep 17 00:00:00 2001 From: Marc-Olivier Arsenault Date: Sat, 13 Jan 2024 01:27:55 +0000 Subject: [PATCH] default bed and extruder temp --- custom_components/moonraker/sensor.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/custom_components/moonraker/sensor.py b/custom_components/moonraker/sensor.py index e6204ec..b945afc 100755 --- a/custom_components/moonraker/sensor.py +++ b/custom_components/moonraker/sensor.py @@ -81,7 +81,7 @@ class MoonrakerSensorDescription(SensorEntityDescription): key="extruder_temp", name="Extruder Temperature", value_fn=lambda sensor: float( - sensor.coordinator.data["status"]["extruder"]["temperature"] + sensor.coordinator.data["status"]["extruder"]["temperature"] or 0.0 ), subscriptions=[("extruder", "temperature")], icon="mdi:printer-3d-nozzle-heat", @@ -91,7 +91,7 @@ class MoonrakerSensorDescription(SensorEntityDescription): key="extruder_target", name="Extruder Target", value_fn=lambda sensor: float( - sensor.coordinator.data["status"]["extruder"]["target"] + sensor.coordinator.data["status"]["extruder"]["target"] or 0.0 ), subscriptions=[("extruder", "target")], icon="mdi:printer-3d-nozzle-heat", @@ -101,7 +101,7 @@ class MoonrakerSensorDescription(SensorEntityDescription): key="bed_target", name="Bed Target", value_fn=lambda sensor: float( - sensor.coordinator.data["status"]["heater_bed"]["target"] + sensor.coordinator.data["status"]["heater_bed"]["target"] or 0.0 ), subscriptions=[("heater_bed", "target")], icon="mdi:radiator", @@ -111,7 +111,7 @@ class MoonrakerSensorDescription(SensorEntityDescription): key="bed_temp", name="Bed Temperature", value_fn=lambda sensor: float( - sensor.coordinator.data["status"]["heater_bed"]["temperature"] + sensor.coordinator.data["status"]["heater_bed"]["temperature"] or 0.0 ), subscriptions=[("heater_bed", "temperature")], icon="mdi:radiator",