mirror of
https://github.com/Threnklyn/esphome-dev.git
synced 2026-06-05 04:18:29 +02:00
Add validate to components (#1631)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
482a3aebc9
commit
c79d700d03
@@ -29,7 +29,7 @@ AQI_CALCULATION_TYPE = {
|
||||
}
|
||||
|
||||
|
||||
def validate(config):
|
||||
def _validate(config):
|
||||
if CONF_AQI in config and CONF_PM_2_5 not in config:
|
||||
raise cv.Invalid("AQI sensor requires PM 2.5")
|
||||
if CONF_AQI in config and CONF_PM_10_0 not in config:
|
||||
@@ -72,7 +72,7 @@ CONFIG_SCHEMA = cv.All(
|
||||
)
|
||||
.extend(cv.polling_component_schema("60s"))
|
||||
.extend(i2c.i2c_device_schema(0x40)),
|
||||
validate,
|
||||
_validate,
|
||||
)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user