Skip to content

Commit

Permalink
Merge pull request #2290 from agav99/PTVO_add_hold_action
Browse files Browse the repository at this point in the history
Ptvo add hold action
  • Loading branch information
asgothian authored Nov 16, 2024
2 parents 346cc93 + 96458a5 commit d1f4cac
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions lib/devices.js
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,9 @@ const generator = {
setattr: 'state',
});
}
if (endpoint.supportsOutputCluster('genMultistateInput')) {
if (endpoint.supportsOutputCluster('genMultistateInput')||
endpoint.clusters.hasOwnProperty('genMultistateInput')
) {
devstates.push({
id: `channel_${epID}.click`,
prop: 'action',
Expand Down Expand Up @@ -343,6 +345,18 @@ const generator = {
isEvent: true,
getter: payload => payload.action === `tripple_${epName}` ? true : undefined,
});
devstates.push({
id: `channel_${epID}.hold`,
prop: 'action',
name: `long click event`,
icon: undefined,
role: 'button',
write: false,
read: true,
type: 'boolean',
isEvent: true,
getter: payload => payload.action === `hold_${epName}` ? true : undefined,
});
}
if (endpoint.supportsOutputCluster('genLevelCtrl')) {
devstates.push({
Expand Down Expand Up @@ -487,7 +501,7 @@ const generator = {
});
return icasa_states;
},
ptvo_switch: (entity) => {
/*ptvo_switch: (entity) => {
const devstates = [];
for (const endpoint of entity.device.endpoints) {
const epID = endpoint.ID;
Expand Down Expand Up @@ -566,7 +580,7 @@ const generator = {
}
}
return devstates;
},
},*/
};

function states_with_epname(entity, states) {
Expand Down

0 comments on commit d1f4cac

Please sign in to comment.