Skip to content

Commit

Permalink
default bed and extruder temp
Browse files Browse the repository at this point in the history
  • Loading branch information
marcolivierarsenault committed Jan 13, 2024
1 parent 65d5ced commit ac725a8
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions custom_components/moonraker/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
Expand All @@ -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",
Expand All @@ -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",
Expand Down

0 comments on commit ac725a8

Please sign in to comment.