Skip to content

Commit

Permalink
round temperatures
Browse files Browse the repository at this point in the history
  • Loading branch information
hannut committed Dec 8, 2024
1 parent 756541a commit 4c3d471
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions custom_components/moonraker/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -352,9 +352,10 @@ async def async_setup_optional_sensors(coordinator, entry, async_add_entities):
status_key=obj,
name=split_obj[1].removesuffix("_temp").replace("_", " ").title()
+ " Temp",
value_fn=lambda sensor: sensor.coordinator.data["status"][
sensor.status_key
]["temperature"],
value_fn=lambda sensor: round(
sensor.coordinator.data["status"][sensor.status_key]["temperature"],
2,
),
subscriptions=[(obj, "temperature")],
icon="mdi:thermometer",
unit=UnitOfTemperature.CELSIUS,
Expand Down

0 comments on commit 4c3d471

Please sign in to comment.