Skip to content

Commit

Permalink
bugfix for onoff mode - remove brightness control
Browse files Browse the repository at this point in the history
  • Loading branch information
Matt committed Apr 7, 2023
1 parent aab37e1 commit baa9bde
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/entities/homeAssistantHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export const startup = ({
publish_topic = false;
}
sendonce++;
} else {
} else if (lightmode === 'dimmer') {
payload = {
"~": `${mqttConfig.topic_prefix}/a${areaKey}c${channelKey}`,
name,
Expand All @@ -62,6 +62,17 @@ export const startup = ({
availability_topic: `${mqttConfig.availability_topic}`,
brightness: true
};
} else {
payload = {
"~": `${mqttConfig.topic_prefix}/a${areaKey}c${channelKey}`,
name,
unique_id: name.toLowerCase().replace(/ /g, "_"),
cmd_t: "~/set",
stat_t: "~/state",
schema: "json",
availability_topic: `${mqttConfig.availability_topic}`,
brightness: false
};
}

} else if (type === 'motion') {
Expand Down

0 comments on commit baa9bde

Please sign in to comment.