import assert from "node:assert"; import bind from "bind-decorator"; import type * as zhc from "zigbee-herdsman-converters"; import type {Zh} from "zigbee-herdsman-converters/lib/types"; import logger from "../util/logger"; import * as settings from "../util/settings"; import {stringify} from "../util/stringify"; 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; endpoint?: Zh.Endpoint; } 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[] = [ "^(?