19 lines
605 B
Python
19 lines
605 B
Python
import esphome.codegen as cg
|
|
import esphome.config_validation as cv
|
|
from esphome.components import sensor
|
|
from esphome.const import UNIT_EMPTY, ICON_EMPTY
|
|
|
|
empty_sensor_ns = cg.esphome_ns.namespace("empty_sensor")
|
|
EmptySensor = empty_sensor_ns.class_("EmptySensor", cg.PollingComponent)
|
|
|
|
CONFIG_SCHEMA = sensor.sensor_schema(
|
|
EmptySensor,
|
|
unit_of_measurement=UNIT_EMPTY,
|
|
icon=ICON_EMPTY,
|
|
accuracy_decimals=1,
|
|
).extend(cv.polling_component_schema("60s"))
|
|
|
|
|
|
async def to_code(config):
|
|
var = await sensor.new_sensor(config)
|
|
await cg.register_component(var, config)
|