mirror of
https://github.com/esphome/esphome.git
synced 2024-11-27 09:18:00 +01:00
[fix] report about required component
This commit is contained in:
parent
1829e68730
commit
31d3d16a68
2 changed files with 12 additions and 1 deletions
|
@ -0,0 +1,2 @@
|
|||
DEPENDENCIES = ["network"]
|
||||
CONF_STATUS_ID = "status_id"
|
|
@ -5,6 +5,7 @@ from esphome.const import (
|
|||
DEVICE_CLASS_CONNECTIVITY,
|
||||
ENTITY_CATEGORY_DIAGNOSTIC,
|
||||
)
|
||||
from . import CONF_STATUS_ID
|
||||
|
||||
status_ns = cg.esphome_ns.namespace("status")
|
||||
StatusBinarySensor = status_ns.class_(
|
||||
|
@ -15,7 +16,15 @@ CONFIG_SCHEMA = binary_sensor.binary_sensor_schema(
|
|||
StatusBinarySensor,
|
||||
device_class=DEVICE_CLASS_CONNECTIVITY,
|
||||
entity_category=ENTITY_CATEGORY_DIAGNOSTIC,
|
||||
).extend(cv.COMPONENT_SCHEMA)
|
||||
).extend(cv.COMPONENT_SCHEMA).extend(
|
||||
cv.Schema(
|
||||
{
|
||||
cv.GenerateID(CONF_STATUS_ID): cv.All(
|
||||
cv.requires_component("network")
|
||||
),
|
||||
}
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
async def to_code(config):
|
||||
|
|
Loading…
Reference in a new issue