Skip to content

Commit

Permalink
examples: Improve HA script to round battery level display (#3100)
Browse files Browse the repository at this point in the history
  • Loading branch information
danoh authored Nov 25, 2024
1 parent 54a886b commit cd9c40c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion examples/rtl_433_mqtt_hass.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@
"device_class": "battery",
"name": "Battery",
"unit_of_measurement": "%",
"value_template": "{{ float(value) * 99 + 1 }}",
"value_template": "{{ ((float(value) * 99)|round(0)) + 1 }}",
"state_class": "measurement",
"entity_category": "diagnostic"
}
Expand Down

0 comments on commit cd9c40c

Please sign in to comment.