Skip to content

Commit

Permalink
fix: Fix no actions for some TuYa TS0026 Koenkk/zigbee2mqtt#22328
Browse files Browse the repository at this point in the history
  • Loading branch information
Koenkk committed May 2, 2024
1 parent b5a8916 commit 71e39f7
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/devices/tuya.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import {KeyValue, Definition, Zh, Tz, Fz, Expose, KeyValueAny, KeyValueString} f
import {onOff, quirkCheckinInterval, battery, deviceEndpoints, light, iasZoneAlarm, temperature, humidity, identify,
actionEnumLookup, commandsOnOff, commandsLevelCtrl} from '../lib/modernExtend';
import {logger} from '../lib/logger';
import {addActionGroup, hasAlreadyProcessedMessage, postfixWithEndpointName} from '../lib/utils';

const NS = 'zhc:tuya';
const {tuyaLight} = tuya.modernExtend;
Expand Down Expand Up @@ -618,6 +619,16 @@ const fzLocal = {
return result;
},
} satisfies Fz.Converter,
scene_recall: {
cluster: 'genScenes',
type: 'commandRecall',
convert: (model, msg, publish, options, meta) => {
if (hasAlreadyProcessedMessage(msg, model)) return;
const payload = {action: postfixWithEndpointName(`scene_${msg.data.sceneid}`, msg, model, meta)};
addActionGroup(payload, msg, model);
return payload;
},
} satisfies Fz.Converter,
scenes_recall_scene_65029: {
cluster: '65029',
type: ['raw', 'attributeReport'],
Expand Down Expand Up @@ -4940,7 +4951,7 @@ const definitions: Definition[] = [
model: 'TS0026',
vendor: 'TuYa',
description: '6 button scene wall switch',
fromZigbee: [fzLocal.scenes_recall_scene_65029],
fromZigbee: [fzLocal.scenes_recall_scene_65029, fzLocal.scene_recall],
exposes: [e.action(['scene_1', 'scene_2', 'scene_3', 'scene_4', 'scene_5', 'scene_6'])],
toZigbee: [],
},
Expand Down

0 comments on commit 71e39f7

Please sign in to comment.