Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(discovery): improve MQTT discovery for scene CC #3539

Merged
merged 2 commits into from
Jan 22, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading