1
0
mirror of https://github.com/esphome/esphome.git synced 2025-10-24 04:33:49 +01:00

Binary Sensor codegen tidyup (#3217)

This commit is contained in:
Jesse Hills
2022-02-18 10:39:59 +13:00
committed by GitHub
parent 3b8bb09ae3
commit 7a242bb4ed
38 changed files with 196 additions and 222 deletions

View File

@@ -2,8 +2,6 @@ import esphome.codegen as cg
import esphome.config_validation as cv
from esphome.components import binary_sensor
from esphome.const import (
CONF_DEVICE_CLASS,
CONF_ENTITY_CATEGORY,
DEVICE_CLASS_CONNECTIVITY,
ENTITY_CATEGORY_DIAGNOSTIC,
)
@@ -15,15 +13,9 @@ CONF_REGISTERED = "registered"
CONFIG_SCHEMA = {
cv.GenerateID(CONF_SIM800L_ID): cv.use_id(Sim800LComponent),
cv.Optional(CONF_REGISTERED): binary_sensor.BINARY_SENSOR_SCHEMA.extend(
{
cv.Optional(
CONF_DEVICE_CLASS, default=DEVICE_CLASS_CONNECTIVITY
): binary_sensor.device_class,
cv.Optional(
CONF_ENTITY_CATEGORY, default=ENTITY_CATEGORY_DIAGNOSTIC
): cv.entity_category,
}
cv.Optional(CONF_REGISTERED): binary_sensor.binary_sensor_schema(
device_class=DEVICE_CLASS_CONNECTIVITY,
entity_category=ENTITY_CATEGORY_DIAGNOSTIC,
),
}