From 587200f354efe6ca6c9b09d6251b4eb215723b50 Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Sat, 26 Oct 2024 14:21:52 +0200 Subject: [PATCH] fix event --- test/homeassistant.test.js | 41 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/test/homeassistant.test.js b/test/homeassistant.test.js index 98ad49db30..dcbcf18a61 100644 --- a/test/homeassistant.test.js +++ b/test/homeassistant.test.js @@ -404,6 +404,47 @@ describe('HomeAssistant extension', () => { {retain: true, qos: 1}, expect.any(Function), ); + + payload = { + availability: [{topic: 'zigbee2mqtt/bridge/state'}], + device: { + identifiers: ['zigbee2mqtt_0x0017880104e45520'], + manufacturer: 'Aqara', + model: 'Wireless mini switch (WXKG11LM)', + name: 'button', + sw_version: null, + via_device: 'zigbee2mqtt_bridge_0x00124b00120144ae', + }, + event_types: ['single', 'double', 'triple', 'quadruple', 'hold', 'release'], + icon: 'mdi:gesture-double-tap', + json_attributes_topic: 'zigbee2mqtt/button', + name: 'Action', + object_id: 'button_action', + origin: origin, + state_topic: 'zigbee2mqtt/button', + unique_id: '0x0017880104e45520_action_zigbee2mqtt', + // Needs to be updated whenever one of the ACTION_*_PATTERN constants changes. + value_template: '{%- set buttons = value_json.action|regex_findall_index(^(?P