mirror of
https://github.com/esphome/esphome.git
synced 2024-11-10 01:07:45 +01:00
[remote_receiver] Add better error message for tolerance breaking change (#6784)
This commit is contained in:
parent
efde677ca9
commit
cd0f557940
2 changed files with 8 additions and 1 deletions
|
@ -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 a new issue