mirror of
https://github.com/Threnklyn/esphome-dev.git
synced 2026-05-19 04:33:27 +02:00
Update the delta filter to take a percentage value as well as an absolute value (#4391)
This commit is contained in:
@@ -1097,7 +1097,7 @@ def possibly_negative_percentage(value):
|
||||
if isinstance(value, str):
|
||||
try:
|
||||
if value.endswith("%"):
|
||||
has_percent_sign = False
|
||||
has_percent_sign = True
|
||||
value = float(value[:-1].rstrip()) / 100.0
|
||||
else:
|
||||
value = float(value)
|
||||
|
||||
Reference in New Issue
Block a user