mirror of
https://github.com/esphome/esphome.git
synced 2025-11-20 16:55:49 +00: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