mirror of
https://github.com/esphome/esphome.git
synced 2024-11-13 10:25:03 +01:00
[remote_receiver] Add better error message for tolerance breaking change (#6784)
This commit is contained in:
parent
bad400e1cd
commit
9de67feccd
@ -63,7 +63,13 @@ def validate_tolerance(value):
|
||||
if "%" in str(value):
|
||||
type_ = TYPE_PERCENTAGE
|
||||
else:
|
||||
type_ = TYPE_TIME
|
||||
try:
|
||||
cv.positive_time_period_microseconds(value)
|
||||
type_ = TYPE_TIME
|
||||
except cv.Invalid as exc:
|
||||
raise cv.Invalid(
|
||||
"Tolerance must be a percentage or time. Configurations made before 2024.5.0 treated the value as a percentage."
|
||||
) from exc
|
||||
|
||||
return TOLERANCE_SCHEMA(
|
||||
{
|
||||
|
@ -3,6 +3,7 @@ remote_receiver:
|
||||
pin: ${pin}
|
||||
rmt_channel: ${rmt_channel}
|
||||
dump: all
|
||||
tolerance: 25%
|
||||
on_abbwelcome:
|
||||
then:
|
||||
- logger.log:
|
||||
|
Loading…
Reference in New Issue
Block a user