mirror of
https://github.com/esphome/esphome.git
synced 2024-11-22 11:47:30 +01:00
Allow setting custom command_topic for Select and Number components (#2714)
This commit is contained in:
parent
aae63a7ff3
commit
f643a46bbf
@ -41,7 +41,7 @@ NumberInRangeCondition = number_ns.class_(
|
||||
|
||||
icon = cv.icon
|
||||
|
||||
NUMBER_SCHEMA = cv.ENTITY_BASE_SCHEMA.extend(cv.MQTT_COMPONENT_SCHEMA).extend(
|
||||
NUMBER_SCHEMA = cv.ENTITY_BASE_SCHEMA.extend(cv.MQTT_COMMAND_COMPONENT_SCHEMA).extend(
|
||||
{
|
||||
cv.OnlyWith(CONF_MQTT_ID, "mqtt"): cv.declare_id(mqtt.MQTTNumberComponent),
|
||||
cv.GenerateID(): cv.declare_id(Number),
|
||||
|
@ -30,7 +30,7 @@ SelectSetAction = select_ns.class_("SelectSetAction", automation.Action)
|
||||
|
||||
icon = cv.icon
|
||||
|
||||
SELECT_SCHEMA = cv.ENTITY_BASE_SCHEMA.extend(cv.MQTT_COMPONENT_SCHEMA).extend(
|
||||
SELECT_SCHEMA = cv.ENTITY_BASE_SCHEMA.extend(cv.MQTT_COMMAND_COMPONENT_SCHEMA).extend(
|
||||
{
|
||||
cv.OnlyWith(CONF_MQTT_ID, "mqtt"): cv.declare_id(mqtt.MQTTSelectComponent),
|
||||
cv.GenerateID(): cv.declare_id(Select),
|
||||
|
@ -2514,3 +2514,23 @@ teleinfo:
|
||||
uart_id: uart0
|
||||
update_interval: 60s
|
||||
historical_mode: true
|
||||
|
||||
number:
|
||||
- platform: template
|
||||
id: test_number
|
||||
state_topic: livingroom/custom_state_topic
|
||||
command_topic: livingroom/custom_command_topic
|
||||
min_value: 0
|
||||
step: 1
|
||||
max_value: 10
|
||||
optimistic: true
|
||||
|
||||
select:
|
||||
- platform: template
|
||||
id: test_select
|
||||
state_topic: livingroom/custom_state_topic
|
||||
command_topic: livingroom/custom_command_topic
|
||||
options:
|
||||
- one
|
||||
- two
|
||||
optimistic: true
|
||||
|
Loading…
Reference in New Issue
Block a user