import assert from "node:assert"; import bind from "bind-decorator"; import stringify from "json-stable-stringify-without-jsonify"; import type * as zhc from "zigbee-herdsman-converters"; import logger from "../util/logger"; import * as settings from "../util/settings"; import utils, {assertBinaryExpose, assertEnumExpose, assertNumericExpose, isBinaryExpose, isEnumExpose, isNumericExpose} from "../util/utils"; import Extension from "./extension"; interface MockProperty { property: string; value: KeyValue | string | null; } interface DiscoveryEntry { mockProperties: MockProperty[]; type: string; object_id: string; discovery_payload: KeyValue; } interface Discovered { mockProperties: Set; messages: {[s: string]: {payload: string; published: boolean}}; triggers: Set; discovered: boolean; } interface ActionData { action: string; button?: string; scene?: string; region?: string; } const ACTION_PATTERNS: string[] = [ "^(?