Use ENTITY_CATEGORY_CONFIG for sprinkler config switches. (#4141)

Update esphome/components/sprinkler/__init__.py

Co-Authored-By: Keith Burzinski <kbx81x@gmail.com>

Co-authored-by: Keith Burzinski <kbx81x@gmail.com>
This commit is contained in:
Matthew Schinckel 2022-12-06 13:30:48 +10:30 committed by GitHub
parent dbbbba3cf8
commit 48da5ef1c4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -8,6 +8,7 @@ from esphome.const import (
CONF_NAME, CONF_NAME,
CONF_REPEAT, CONF_REPEAT,
CONF_RUN_DURATION, CONF_RUN_DURATION,
ENTITY_CATEGORY_CONFIG,
) )
AUTO_LOAD = ["switch"] AUTO_LOAD = ["switch"]
@ -223,7 +224,9 @@ SPRINKLER_ACTION_QUEUE_VALVE_SCHEMA = cv.Schema(
SPRINKLER_VALVE_SCHEMA = cv.Schema( SPRINKLER_VALVE_SCHEMA = cv.Schema(
{ {
cv.Optional(CONF_ENABLE_SWITCH): cv.maybe_simple_value( cv.Optional(CONF_ENABLE_SWITCH): cv.maybe_simple_value(
switch.switch_schema(SprinklerControllerSwitch), switch.switch_schema(
SprinklerControllerSwitch, entity_category=ENTITY_CATEGORY_CONFIG
),
key=CONF_NAME, key=CONF_NAME,
), ),
cv.Optional(CONF_PUMP_OFF_SWITCH_ID): cv.use_id(switch.Switch), cv.Optional(CONF_PUMP_OFF_SWITCH_ID): cv.use_id(switch.Switch),
@ -244,7 +247,9 @@ SPRINKLER_CONTROLLER_SCHEMA = cv.Schema(
{ {
cv.GenerateID(): cv.declare_id(Sprinkler), cv.GenerateID(): cv.declare_id(Sprinkler),
cv.Optional(CONF_AUTO_ADVANCE_SWITCH): cv.maybe_simple_value( cv.Optional(CONF_AUTO_ADVANCE_SWITCH): cv.maybe_simple_value(
switch.switch_schema(SprinklerControllerSwitch), switch.switch_schema(
SprinklerControllerSwitch, entity_category=ENTITY_CATEGORY_CONFIG
),
key=CONF_NAME, key=CONF_NAME,
), ),
cv.Optional(CONF_MAIN_SWITCH): cv.maybe_simple_value( cv.Optional(CONF_MAIN_SWITCH): cv.maybe_simple_value(
@ -252,11 +257,15 @@ SPRINKLER_CONTROLLER_SCHEMA = cv.Schema(
key=CONF_NAME, key=CONF_NAME,
), ),
cv.Optional(CONF_QUEUE_ENABLE_SWITCH): cv.maybe_simple_value( cv.Optional(CONF_QUEUE_ENABLE_SWITCH): cv.maybe_simple_value(
switch.switch_schema(SprinklerControllerSwitch), switch.switch_schema(
SprinklerControllerSwitch, entity_category=ENTITY_CATEGORY_CONFIG
),
key=CONF_NAME, key=CONF_NAME,
), ),
cv.Optional(CONF_REVERSE_SWITCH): cv.maybe_simple_value( cv.Optional(CONF_REVERSE_SWITCH): cv.maybe_simple_value(
switch.switch_schema(SprinklerControllerSwitch), switch.switch_schema(
SprinklerControllerSwitch, entity_category=ENTITY_CATEGORY_CONFIG
),
key=CONF_NAME, key=CONF_NAME,
), ),
cv.Optional(CONF_MANUAL_SELECTION_DELAY): cv.positive_time_period_seconds, cv.Optional(CONF_MANUAL_SELECTION_DELAY): cv.positive_time_period_seconds,