Skip to content

Commit

Permalink
fix(discovery): improve MQTT discovery for scene CC (#3539)
Browse files Browse the repository at this point in the history
Co-authored-by: Daniel Lando <daniel.sorridi@gmail.com>
  • Loading branch information
ccutrer and robertsLando authored Jan 22, 2024
1 parent 3048fed commit 383ad83
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion api/lib/Gateway.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1314,7 +1314,9 @@ export default class Gateway {
} else return
break
case CommandClasses['Central Scene']:
case CommandClasses['Scene Activation']:
if (!valueId.readable || valueId.writeable) {
return
}
cfg = utils.copy(hassCfg.central_scene)

// Combile unique Object id, by using all possible scenarios
Expand All @@ -1323,6 +1325,9 @@ export default class Gateway {
valueId.property,
valueId.propertyKey,
)
if (valueId.type === 'number') {
cfg.discovery_payload.state_class = 'measurement'
}
break
case CommandClasses['Binary Sensor']: {
// https://github.com/zwave-js/node-zwave-js/blob/master/packages/zwave-js/src/lib/commandclass/BinarySensorCC.ts#L41
Expand Down

0 comments on commit 383ad83

Please sign in to comment.