Move remaining SENSOR_SCHEMA to use sensor_schema() (#4471)

This commit is contained in:
Jesse Hills
2023-02-20 16:22:37 +13:00
committed by GitHub
parent 247916fe89
commit 50fbbf2d3b
9 changed files with 79 additions and 61 deletions
+10 -7
View File
@@ -9,13 +9,16 @@ CODEOWNERS = ["@jesserockz"]
TuyaSensor = tuya_ns.class_("TuyaSensor", sensor.Sensor, cg.Component)
CONFIG_SCHEMA = sensor.SENSOR_SCHEMA.extend(
{
cv.GenerateID(): cv.declare_id(TuyaSensor),
cv.GenerateID(CONF_TUYA_ID): cv.use_id(Tuya),
cv.Required(CONF_SENSOR_DATAPOINT): cv.uint8_t,
}
).extend(cv.COMPONENT_SCHEMA)
CONFIG_SCHEMA = (
sensor.sensor_schema(TuyaSensor)
.extend(
{
cv.GenerateID(CONF_TUYA_ID): cv.use_id(Tuya),
cv.Required(CONF_SENSOR_DATAPOINT): cv.uint8_t,
}
)
.extend(cv.COMPONENT_SCHEMA)
)
async def to_code(config):