mirror of
https://github.com/esphome/esphome.git
synced 2024-11-25 00:18:11 +01:00
[remote_receiver] Add better error message for tolerance breaking change (#6784)
This commit is contained in:
parent
bad400e1cd
commit
9de67feccd
2 changed files with 8 additions and 1 deletions
|
@ -63,7 +63,13 @@ def validate_tolerance(value):
|
||||||
if "%" in str(value):
|
if "%" in str(value):
|
||||||
type_ = TYPE_PERCENTAGE
|
type_ = TYPE_PERCENTAGE
|
||||||
else:
|
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(
|
return TOLERANCE_SCHEMA(
|
||||||
{
|
{
|
||||||
|
|
|
@ -3,6 +3,7 @@ remote_receiver:
|
||||||
pin: ${pin}
|
pin: ${pin}
|
||||||
rmt_channel: ${rmt_channel}
|
rmt_channel: ${rmt_channel}
|
||||||
dump: all
|
dump: all
|
||||||
|
tolerance: 25%
|
||||||
on_abbwelcome:
|
on_abbwelcome:
|
||||||
then:
|
then:
|
||||||
- logger.log:
|
- logger.log:
|
||||||
|
|
Loading…
Reference in a new issue