Skip to content

Commit

Permalink
πŸ› Suggest precision for energy sensors
Browse files Browse the repository at this point in the history
This will fix #86 and #87

Option defined in [this
post](https://developers.home-assistant.io/blog/2023/01/25/sensor_rounding/)
has been reverted and replaced by a presentation option (instead of
rounding the state).

This will implement correctly #52

Change-Id: I122a0e855098e37d38f14cb02f07c3b24a201afc
  • Loading branch information
kamaradclimber committed Mar 3, 2023
1 parent 858fc42 commit f67b7b1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions custom_components/aquarea/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ def message_received(message):
state_class=SensorStateClass.MEASUREMENT,
unit_of_measurement="kWh",
native_unit_of_measurement="Wh",
native_precision=0,
suggested_display_precision=0,
device=DeviceType.HEISHAMON,
)
watt_hour_sensor = HeishaMonSensor(
Expand All @@ -278,7 +278,7 @@ def message_received(message):
device_class=SensorDeviceClass.ENERGY,
unit_of_measurement="kWh",
native_unit_of_measurement="Wh",
native_precision=0,
suggested_display_precision=0,
state_class=SensorStateClass.TOTAL_INCREASING,
device=DeviceType.HEISHAMON,
)
Expand Down

0 comments on commit f67b7b1

Please sign in to comment.