Limit range on filter time period for remote_receiver (#4604)

* Limit range on filter time period for remote_receiver

* pylint
This commit is contained in:
RoboMagus 2023-03-23 19:41:14 +01:00 committed by GitHub
parent be69b49880
commit e4ba3ff1db
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -12,7 +12,7 @@ from esphome.const import (
CONF_TOLERANCE,
CONF_MEMORY_BLOCKS,
)
from esphome.core import CORE
from esphome.core import CORE, TimePeriod
AUTO_LOAD = ["remote_base"]
remote_receiver_ns = cg.esphome_ns.namespace("remote_receiver")
@ -33,9 +33,10 @@ CONFIG_SCHEMA = remote_base.validate_triggers(
cv.SplitDefault(
CONF_BUFFER_SIZE, esp32="10000b", esp8266="1000b"
): cv.validate_bytes,
cv.Optional(
CONF_FILTER, default="50us"
): cv.positive_time_period_microseconds,
cv.Optional(CONF_FILTER, default="50us"): cv.All(
cv.positive_time_period_microseconds,
cv.Range(max=TimePeriod(microseconds=255)),
),
cv.Optional(
CONF_IDLE, default="10ms"
): cv.positive_time_period_microseconds,