1
0
mirror of https://github.com/esphome/esphome.git synced 2025-10-25 05:03:52 +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

@@ -20,9 +20,9 @@ NextionBinarySensor = nextion_ns.class_(
)
CONFIG_SCHEMA = cv.All(
binary_sensor.BINARY_SENSOR_SCHEMA.extend(
binary_sensor.binary_sensor_schema(NextionBinarySensor)
.extend(
{
cv.GenerateID(): cv.declare_id(NextionBinarySensor),
cv.Optional(CONF_PAGE_ID): cv.uint8_t,
cv.Optional(CONF_COMPONENT_ID): cv.uint8_t,
}

View File

@@ -17,7 +17,7 @@ NextionTextSensor = nextion_ns.class_(
)
CONFIG_SCHEMA = (
text_sensor.text_sensor_schema(klass=NextionTextSensor)
text_sensor.text_sensor_schema(NextionTextSensor)
.extend(CONFIG_TEXT_COMPONENT_SCHEMA)
.extend(cv.polling_component_schema("never"))
)