Add support for MQTT device triggers (#31679)
* Add support for MQTT device triggers * Fix test, tweaks * Improve test coverage * Address review comments, improve tests * Tidy up exception handling * Fix abbreviations * Rewrite to handle update of attached triggers * Update abbreviation test * Refactor according to review comments * Refactor according to review comments * Improve trigger removal * Further refactoring
This commit is contained in:
1 parent
f6540e3002
commit
60ae85564e
10 files changed
+1170
-34
No files matched your search
@@ -11,8 +11,10 @@ import homeassistant.helpers.config_validation as cv
|
||||
# mypy: allow-untyped-defs
|
||||
|
||||
CONF_ENCODING = "encoding"
|
||||
CONF_QOS = "qos"
|
||||
CONF_TOPIC = "topic"
|
||||
DEFAULT_ENCODING = "utf-8"
|
||||
DEFAULT_QOS = 0
|
||||
|
||||
TRIGGER_SCHEMA = vol.Schema(
|
||||
{
|
||||
@@ -20,6 +22,9 @@ TRIGGER_SCHEMA = vol.Schema(
|
||||
vol.Required(CONF_TOPIC): mqtt.valid_subscribe_topic,
|
||||
vol.Optional(CONF_PAYLOAD): cv.string,
|
||||
vol.Optional(CONF_ENCODING, default=DEFAULT_ENCODING): cv.string,
|
||||
vol.Optional(CONF_QOS, default=DEFAULT_QOS): vol.All(
|
||||
vol.Coerce(int), vol.In([0, 1, 2])
|
||||
),
|
||||
}
|
||||
)
|
||||
|
||||
@@ -29,6 +34,7 @@ async def async_attach_trigger(hass, config, action, automation_info):
|
||||
topic = config[CONF_TOPIC]
|
||||
payload = config.get(CONF_PAYLOAD)
|
||||
encoding = config[CONF_ENCODING] or None
|
||||
qos = config[CONF_QOS]
|
||||
|
||||
@callback
|
||||
def mqtt_automation_listener(mqttmsg):
|
||||
@@ -49,6 +55,6 @@ async def async_attach_trigger(hass, config, action, automation_info):
|
||||
hass.async_run_job(action, {"trigger": data})
|
||||
|
||||
remove = await mqtt.async_subscribe(
|
||||
hass, topic, mqtt_automation_listener, encoding=encoding
|
||||
hass, topic, mqtt_automation_listener, encoding=encoding, qos=qos
|
||||
)
|
||||
return remove
|
||||
@@ -1194,6 +1194,34 @@ class MqttDiscoveryUpdate(Entity):
|
||||
)
|
||||
|
||||
|
||||
def device_info_from_config(config):
|
||||
"""Return a device description for device registry."""
|
||||
if not config:
|
||||
return None
|
||||
|
||||
info = {
|
||||
"identifiers": {(DOMAIN, id_) for id_ in config[CONF_IDENTIFIERS]},
|
||||
"connections": {tuple(x) for x in config[CONF_CONNECTIONS]},
|
||||
}
|
||||
|
||||
if CONF_MANUFACTURER in config:
|
||||
info["manufacturer"] = config[CONF_MANUFACTURER]
|
||||
|
||||
if CONF_MODEL in config:
|
||||
info["model"] = config[CONF_MODEL]
|
||||
|
||||
if CONF_NAME in config:
|
||||
info["name"] = config[CONF_NAME]
|
||||
|
||||
if CONF_SW_VERSION in config:
|
||||
info["sw_version"] = config[CONF_SW_VERSION]
|
||||
|
||||
if CONF_VIA_DEVICE in config:
|
||||
info["via_device"] = (DOMAIN, config[CONF_VIA_DEVICE])
|
||||
|
||||
return info
|
||||
|
||||
|
||||
class MqttEntityDeviceInfo(Entity):
|
||||
"""Mixin used for mqtt platforms that support the device registry."""
|
||||
|
||||
@@ -1216,32 +1244,7 @@ class MqttEntityDeviceInfo(Entity):
|
||||
@property
|
||||
def device_info(self):
|
||||
"""Return a device description for device registry."""
|
||||
if not self._device_config:
|
||||
return None
|
||||
|
||||
info = {
|
||||
"identifiers": {
|
||||
(DOMAIN, id_) for id_ in self._device_config[CONF_IDENTIFIERS]
|
||||
},
|
||||
"connections": {tuple(x) for x in self._device_config[CONF_CONNECTIONS]},
|
||||
}
|
||||
|
||||
if CONF_MANUFACTURER in self._device_config:
|
||||
info["manufacturer"] = self._device_config[CONF_MANUFACTURER]
|
||||
|
||||
if CONF_MODEL in self._device_config:
|
||||
info["model"] = self._device_config[CONF_MODEL]
|
||||
|
||||
if CONF_NAME in self._device_config:
|
||||
info["name"] = self._device_config[CONF_NAME]
|
||||
|
||||
if CONF_SW_VERSION in self._device_config:
|
||||
info["sw_version"] = self._device_config[CONF_SW_VERSION]
|
||||
|
||||
if CONF_VIA_DEVICE in self._device_config:
|
||||
info["via_device"] = (DOMAIN, self._device_config[CONF_VIA_DEVICE])
|
||||
|
||||
return info
|
||||
return device_info_from_config(self._device_config)
|
||||
|
||||
|
||||
@websocket_api.async_response
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
ABBREVIATIONS = {
|
||||
"act_t": "action_topic",
|
||||
"act_tpl": "action_template",
|
||||
"atype": "automation_type",
|
||||
"aux_cmd_t": "aux_command_topic",
|
||||
"aux_stat_tpl": "aux_state_template",
|
||||
"aux_stat_t": "aux_state_topic",
|
||||
@@ -80,6 +81,7 @@ ABBREVIATIONS = {
|
||||
"osc_cmd_t": "oscillation_command_topic",
|
||||
"osc_stat_t": "oscillation_state_topic",
|
||||
"osc_val_tpl": "oscillation_value_template",
|
||||
"pl": "payload",
|
||||
"pl_arm_away": "payload_arm_away",
|
||||
"pl_arm_home": "payload_arm_home",
|
||||
"pl_arm_nite": "payload_arm_night",
|
||||
@@ -142,6 +144,7 @@ ABBREVIATIONS = {
|
||||
"stat_t": "state_topic",
|
||||
"stat_tpl": "state_template",
|
||||
"stat_val_tpl": "state_value_template",
|
||||
"stype": "subtype",
|
||||
"sup_feat": "supported_features",
|
||||
"swing_mode_cmd_t": "swing_mode_command_topic",
|
||||
"swing_mode_stat_tpl": "swing_mode_state_template",
|
||||
|
||||
@@ -178,15 +178,14 @@ async def async_setup_entry(hass, config_entry, async_add_entities):
|
||||
|
||||
async def async_discover(discovery_payload):
|
||||
"""Discover and add an MQTT cover."""
|
||||
discovery_hash = discovery_payload.pop(ATTR_DISCOVERY_HASH)
|
||||
try:
|
||||
discovery_hash = discovery_payload.pop(ATTR_DISCOVERY_HASH)
|
||||
config = PLATFORM_SCHEMA(discovery_payload)
|
||||
await _async_setup_entity(
|
||||
config, async_add_entities, config_entry, discovery_hash
|
||||
)
|
||||
except Exception:
|
||||
if discovery_hash:
|
||||
clear_discovery_hash(hass, discovery_hash)
|
||||
clear_discovery_hash(hass, discovery_hash)
|
||||
raise
|
||||
|
||||
async_dispatcher_connect(
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
"""Provides device automations for MQTT."""
|
||||
import logging
|
||||
|
||||
import voluptuous as vol
|
||||
|
||||
from homeassistant.components import mqtt
|
||||
from homeassistant.helpers.dispatcher import async_dispatcher_connect
|
||||
|
||||
from . import ATTR_DISCOVERY_HASH, device_trigger
|
||||
from .discovery import MQTT_DISCOVERY_NEW, clear_discovery_hash
|
||||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
AUTOMATION_TYPE_TRIGGER = "trigger"
|
||||
AUTOMATION_TYPES = [AUTOMATION_TYPE_TRIGGER]
|
||||
AUTOMATION_TYPES_SCHEMA = vol.In(AUTOMATION_TYPES)
|
||||
CONF_AUTOMATION_TYPE = "automation_type"
|
||||
|
||||
PLATFORM_SCHEMA = mqtt.MQTT_BASE_PLATFORM_SCHEMA.extend(
|
||||
{vol.Required(CONF_AUTOMATION_TYPE): AUTOMATION_TYPES_SCHEMA},
|
||||
extra=vol.ALLOW_EXTRA,
|
||||
)
|
||||
|
||||
|
||||
async def async_setup_entry(hass, config_entry):
|
||||
"""Set up MQTT device automation dynamically through MQTT discovery."""
|
||||
|
||||
async def async_discover(discovery_payload):
|
||||
"""Discover and add an MQTT device automation."""
|
||||
discovery_hash = discovery_payload.pop(ATTR_DISCOVERY_HASH)
|
||||
try:
|
||||
config = PLATFORM_SCHEMA(discovery_payload)
|
||||
if config[CONF_AUTOMATION_TYPE] == AUTOMATION_TYPE_TRIGGER:
|
||||
await device_trigger.async_setup_trigger(
|
||||
hass, config, config_entry, discovery_hash
|
||||
)
|
||||
except Exception:
|
||||
if discovery_hash:
|
||||
clear_discovery_hash(hass, discovery_hash)
|
||||
raise
|
||||
|
||||
async_dispatcher_connect(
|
||||
hass, MQTT_DISCOVERY_NEW.format("device_automation", "mqtt"), async_discover
|
||||
)
|
||||
@@ -0,0 +1,273 @@
|
||||
"""Provides device automations for MQTT."""
|
||||
import logging
|
||||
from typing import List
|
||||
|
||||
import attr
|
||||
import voluptuous as vol
|
||||
|
||||
from homeassistant.components import mqtt
|
||||
from homeassistant.components.automation import AutomationActionType
|
||||
import homeassistant.components.automation.mqtt as automation_mqtt
|
||||
from homeassistant.components.device_automation import TRIGGER_BASE_SCHEMA
|
||||
from homeassistant.const import CONF_DEVICE_ID, CONF_DOMAIN, CONF_PLATFORM, CONF_TYPE
|
||||
from homeassistant.core import CALLBACK_TYPE, HomeAssistant, callback
|
||||
from homeassistant.exceptions import HomeAssistantError
|
||||
from homeassistant.helpers import config_validation as cv
|
||||
from homeassistant.helpers.dispatcher import async_dispatcher_connect
|
||||
from homeassistant.helpers.typing import ConfigType, HomeAssistantType
|
||||
|
||||
from . import (
|
||||
ATTR_DISCOVERY_HASH,
|
||||
CONF_CONNECTIONS,
|
||||
CONF_DEVICE,
|
||||
CONF_IDENTIFIERS,
|
||||
CONF_PAYLOAD,
|
||||
CONF_QOS,
|
||||
DOMAIN,
|
||||
)
|
||||
from .discovery import MQTT_DISCOVERY_UPDATED, clear_discovery_hash
|
||||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
CONF_AUTOMATION_TYPE = "automation_type"
|
||||
CONF_DISCOVERY_ID = "discovery_id"
|
||||
CONF_SUBTYPE = "subtype"
|
||||
CONF_TOPIC = "topic"
|
||||
DEFAULT_ENCODING = "utf-8"
|
||||
DEVICE = "device"
|
||||
|
||||
MQTT_TRIGGER_BASE = {
|
||||
# Trigger when MQTT message is received
|
||||
CONF_PLATFORM: DEVICE,
|
||||
CONF_DOMAIN: DOMAIN,
|
||||
}
|
||||
|
||||
TRIGGER_SCHEMA = TRIGGER_BASE_SCHEMA.extend(
|
||||
{
|
||||
vol.Required(CONF_PLATFORM): DEVICE,
|
||||
vol.Required(CONF_DOMAIN): DOMAIN,
|
||||
vol.Required(CONF_DEVICE_ID): str,
|
||||
vol.Required(CONF_DISCOVERY_ID): str,
|
||||
vol.Required(CONF_TYPE): cv.string,
|
||||
vol.Required(CONF_SUBTYPE): cv.string,
|
||||
}
|
||||
)
|
||||
|
||||
TRIGGER_DISCOVERY_SCHEMA = mqtt.MQTT_BASE_PLATFORM_SCHEMA.extend(
|
||||
{
|
||||
vol.Required(CONF_AUTOMATION_TYPE): str,
|
||||
vol.Required(CONF_DEVICE): mqtt.MQTT_ENTITY_DEVICE_INFO_SCHEMA,
|
||||
vol.Required(CONF_TOPIC): mqtt.valid_subscribe_topic,
|
||||
vol.Optional(CONF_PAYLOAD, default=None): vol.Any(None, cv.string),
|
||||
vol.Required(CONF_TYPE): cv.string,
|
||||
vol.Required(CONF_SUBTYPE): cv.string,
|
||||
},
|
||||
mqtt.validate_device_has_at_least_one_identifier,
|
||||
)
|
||||
|
||||
DEVICE_TRIGGERS = "mqtt_device_triggers"
|
||||
|
||||
|
||||
@attr.s(slots=True)
|
||||
class TriggerInstance:
|
||||
"""Attached trigger settings."""
|
||||
|
||||
action = attr.ib(type=AutomationActionType)
|
||||
automation_info = attr.ib(type=dict)
|
||||
trigger = attr.ib(type="Trigger")
|
||||
remove = attr.ib(type=CALLBACK_TYPE, default=None)
|
||||
|
||||
async def async_attach_trigger(self):
|
||||
"""Attach MQTT trigger."""
|
||||
mqtt_config = {
|
||||
automation_mqtt.CONF_TOPIC: self.trigger.topic,
|
||||
automation_mqtt.CONF_ENCODING: DEFAULT_ENCODING,
|
||||
automation_mqtt.CONF_QOS: self.trigger.qos,
|
||||
}
|
||||
if self.trigger.payload:
|
||||
mqtt_config[CONF_PAYLOAD] = self.trigger.payload
|
||||
|
||||
if self.remove:
|
||||
self.remove()
|
||||
self.remove = await automation_mqtt.async_attach_trigger(
|
||||
self.trigger.hass, mqtt_config, self.action, self.automation_info,
|
||||
)
|
||||
|
||||
|
||||
@attr.s(slots=True)
|
||||
class Trigger:
|
||||
"""Device trigger settings."""
|
||||
|
||||
device_id = attr.ib(type=str)
|
||||
hass = attr.ib(type=HomeAssistantType)
|
||||
payload = attr.ib(type=str)
|
||||
qos = attr.ib(type=int)
|
||||
subtype = attr.ib(type=str)
|
||||
topic = attr.ib(type=str)
|
||||
type = attr.ib(type=str)
|
||||
trigger_instances = attr.ib(type=[TriggerInstance], default=attr.Factory(list))
|
||||
|
||||
async def add_trigger(self, action, automation_info):
|
||||
"""Add MQTT trigger."""
|
||||
instance = TriggerInstance(action, automation_info, self)
|
||||
self.trigger_instances.append(instance)
|
||||
|
||||
if self.topic is not None:
|
||||
# If we know about the trigger, subscribe to MQTT topic
|
||||
await instance.async_attach_trigger()
|
||||
|
||||
@callback
|
||||
def async_remove() -> None:
|
||||
"""Remove trigger."""
|
||||
if instance not in self.trigger_instances:
|
||||
raise HomeAssistantError("Can't remove trigger twice")
|
||||
|
||||
if instance.remove:
|
||||
instance.remove()
|
||||
self.trigger_instances.remove(instance)
|
||||
|
||||
return async_remove
|
||||
|
||||
async def update_trigger(self, config):
|
||||
"""Update MQTT device trigger."""
|
||||
self.type = config[CONF_TYPE]
|
||||
self.subtype = config[CONF_SUBTYPE]
|
||||
self.topic = config[CONF_TOPIC]
|
||||
self.payload = config[CONF_PAYLOAD]
|
||||
self.qos = config[CONF_QOS]
|
||||
|
||||
# Unsubscribe+subscribe if this trigger is in use
|
||||
for trig in self.trigger_instances:
|
||||
await trig.async_attach_trigger()
|
||||
|
||||
def detach_trigger(self):
|
||||
"""Remove MQTT device trigger."""
|
||||
# Mark trigger as unknown
|
||||
|
||||
self.topic = None
|
||||
# Unsubscribe if this trigger is in use
|
||||
for trig in self.trigger_instances:
|
||||
if trig.remove:
|
||||
trig.remove()
|
||||
trig.remove = None
|
||||
|
||||
|
||||
async def _update_device(hass, config_entry, config):
|
||||
"""Update device registry."""
|
||||
device_registry = await hass.helpers.device_registry.async_get_registry()
|
||||
config_entry_id = config_entry.entry_id
|
||||
device_info = mqtt.device_info_from_config(config[CONF_DEVICE])
|
||||
|
||||
if config_entry_id is not None and device_info is not None:
|
||||
device_info["config_entry_id"] = config_entry_id
|
||||
device_registry.async_get_or_create(**device_info)
|
||||
|
||||
|
||||
async def async_setup_trigger(hass, config, config_entry, discovery_hash):
|
||||
"""Set up the MQTT device trigger."""
|
||||
config = TRIGGER_DISCOVERY_SCHEMA(config)
|
||||
discovery_id = discovery_hash[1]
|
||||
remove_signal = None
|
||||
|
||||
async def discovery_update(payload):
|
||||
"""Handle discovery update."""
|
||||
_LOGGER.info(
|
||||
"Got update for trigger with hash: %s '%s'", discovery_hash, payload
|
||||
)
|
||||
if not payload:
|
||||
# Empty payload: Remove trigger
|
||||
_LOGGER.info("Removing trigger: %s", discovery_hash)
|
||||
if discovery_id in hass.data[DEVICE_TRIGGERS]:
|
||||
device_trigger = hass.data[DEVICE_TRIGGERS][discovery_id]
|
||||
device_trigger.detach_trigger()
|
||||
clear_discovery_hash(hass, discovery_hash)
|
||||
remove_signal()
|
||||
else:
|
||||
# Non-empty payload: Update trigger
|
||||
_LOGGER.info("Updating trigger: %s", discovery_hash)
|
||||
payload.pop(ATTR_DISCOVERY_HASH)
|
||||
config = TRIGGER_DISCOVERY_SCHEMA(payload)
|
||||
await _update_device(hass, config_entry, config)
|
||||
device_trigger = hass.data[DEVICE_TRIGGERS][discovery_id]
|
||||
await device_trigger.update_trigger(config)
|
||||
|
||||
remove_signal = async_dispatcher_connect(
|
||||
hass, MQTT_DISCOVERY_UPDATED.format(discovery_hash), discovery_update
|
||||
)
|
||||
|
||||
await _update_device(hass, config_entry, config)
|
||||
|
||||
device_registry = await hass.helpers.device_registry.async_get_registry()
|
||||
device = device_registry.async_get_device(
|
||||
{(DOMAIN, id_) for id_ in config[CONF_DEVICE][CONF_IDENTIFIERS]},
|
||||
{tuple(x) for x in config[CONF_DEVICE][CONF_CONNECTIONS]},
|
||||
)
|
||||
|
||||
if device is None:
|
||||
return
|
||||
|
||||
if DEVICE_TRIGGERS not in hass.data:
|
||||
hass.data[DEVICE_TRIGGERS] = {}
|
||||
if discovery_id not in hass.data[DEVICE_TRIGGERS]:
|
||||
hass.data[DEVICE_TRIGGERS][discovery_id] = Trigger(
|
||||
hass=hass,
|
||||
device_id=device.id,
|
||||
type=config[CONF_TYPE],
|
||||
subtype=config[CONF_SUBTYPE],
|
||||
topic=config[CONF_TOPIC],
|
||||
payload=config[CONF_PAYLOAD],
|
||||
qos=config[CONF_QOS],
|
||||
)
|
||||
else:
|
||||
await hass.data[DEVICE_TRIGGERS][discovery_id].update_trigger(config)
|
||||
|
||||
|
||||
async def async_get_triggers(hass: HomeAssistant, device_id: str) -> List[dict]:
|
||||
"""List device triggers for MQTT devices."""
|
||||
triggers = []
|
||||
|
||||
if DEVICE_TRIGGERS not in hass.data:
|
||||
return triggers
|
||||
|
||||
for discovery_id, trig in hass.data[DEVICE_TRIGGERS].items():
|
||||
if trig.device_id != device_id or trig.topic is None:
|
||||
continue
|
||||
|
||||
trigger = {
|
||||
**MQTT_TRIGGER_BASE,
|
||||
"device_id": device_id,
|
||||
"type": trig.type,
|
||||
"subtype": trig.subtype,
|
||||
"discovery_id": discovery_id,
|
||||
}
|
||||
triggers.append(trigger)
|
||||
|
||||
return triggers
|
||||
|
||||
|
||||
async def async_attach_trigger(
|
||||
hass: HomeAssistant,
|
||||
config: ConfigType,
|
||||
action: AutomationActionType,
|
||||
automation_info: dict,
|
||||
) -> CALLBACK_TYPE:
|
||||
"""Attach a trigger."""
|
||||
if DEVICE_TRIGGERS not in hass.data:
|
||||
hass.data[DEVICE_TRIGGERS] = {}
|
||||
config = TRIGGER_SCHEMA(config)
|
||||
device_id = config[CONF_DEVICE_ID]
|
||||
discovery_id = config[CONF_DISCOVERY_ID]
|
||||
|
||||
if discovery_id not in hass.data[DEVICE_TRIGGERS]:
|
||||
hass.data[DEVICE_TRIGGERS][discovery_id] = Trigger(
|
||||
hass=hass,
|
||||
device_id=device_id,
|
||||
type=config[CONF_TYPE],
|
||||
subtype=config[CONF_SUBTYPE],
|
||||
topic=None,
|
||||
payload=None,
|
||||
qos=None,
|
||||
)
|
||||
return await hass.data[DEVICE_TRIGGERS][discovery_id].add_trigger(
|
||||
action, automation_info
|
||||
)
|
||||
@@ -26,6 +26,7 @@ SUPPORTED_COMPONENTS = [
|
||||
"camera",
|
||||
"climate",
|
||||
"cover",
|
||||
"device_automation",
|
||||
"fan",
|
||||
"light",
|
||||
"lock",
|
||||
@@ -40,6 +41,7 @@ CONFIG_ENTRY_COMPONENTS = [
|
||||
"camera",
|
||||
"climate",
|
||||
"cover",
|
||||
"device_automation",
|
||||
"fan",
|
||||
"light",
|
||||
"lock",
|
||||
@@ -197,9 +199,15 @@ async def async_start(
|
||||
config_entries_key = "{}.{}".format(component, "mqtt")
|
||||
async with hass.data[DATA_CONFIG_ENTRY_LOCK]:
|
||||
if config_entries_key not in hass.data[CONFIG_ENTRY_IS_SETUP]:
|
||||
await hass.config_entries.async_forward_entry_setup(
|
||||
config_entry, component
|
||||
)
|
||||
if component == "device_automation":
|
||||
# Local import to avoid circular dependencies
|
||||
from . import device_automation
|
||||
|
||||
await device_automation.async_setup_entry(hass, config_entry)
|
||||
else:
|
||||
await hass.config_entries.async_forward_entry_setup(
|
||||
config_entry, component
|
||||
)
|
||||
hass.data[CONFIG_ENTRY_IS_SETUP].add(config_entries_key)
|
||||
|
||||
async_dispatcher_send(
|
||||
|
||||
@@ -27,5 +27,27 @@
|
||||
"error": {
|
||||
"cannot_connect": "Unable to connect to the broker."
|
||||
}
|
||||
},
|
||||
"device_automation": {
|
||||
"trigger_type": {
|
||||
"button_short_press": "\"{subtype}\" pressed",
|
||||
"button_short_release": "\"{subtype}\" released",
|
||||
"button_long_press": "\"{subtype}\" continuously pressed",
|
||||
"button_long_release": "\"{subtype}\" released after long press",
|
||||
"button_double_press": "\"{subtype}\" double clicked",
|
||||
"button_triple_press": "\"{subtype}\" triple clicked",
|
||||
"button_quadruple_press": "\"{subtype}\" quadruple clicked",
|
||||
"button_quintuple_press": "\"{subtype}\" quintuple clicked"
|
||||
},
|
||||
"trigger_subtype": {
|
||||
"turn_on": "Turn on",
|
||||
"turn_off": "Turn off",
|
||||
"button_1": "First button",
|
||||
"button_2": "Second button",
|
||||
"button_3": "Third button",
|
||||
"button_4": "Fourth button",
|
||||
"button_5": "Fifth button",
|
||||
"button_6": "Sixth button"
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user