mirror of
https://github.com/Koenkk/zigbee2mqtt.git
synced 2026-08-27 21:20:03 +00:00
Fix homeassistant docgen, set command_topic_prefix in command_topic. #117
This commit is contained in:
+7
-1
@@ -94,9 +94,15 @@ const homeassistantConfig = (device) => {
|
||||
};
|
||||
|
||||
if (payload.command_topic) {
|
||||
payload.command_topic = `zigbee2mqtt/<FRIENDLY_NAME>/set`;
|
||||
if (payload.command_topic_prefix) {
|
||||
payload.command_topic = `zigbee2mqtt/<FRIENDLY_NAME>/${payload.command_topic_prefix}/set`;
|
||||
} else {
|
||||
payload.command_topic = `zigbee2mqtt/<FRIENDLY_NAME>/set`;
|
||||
}
|
||||
}
|
||||
|
||||
delete payload.command_topic_prefix;
|
||||
|
||||
let yml = YAML.stringify([payload]);
|
||||
yml = yml.replace(/(-) \n /g, '- ');
|
||||
yml = yml.replace('---', `${device.type}:`)
|
||||
|
||||
Reference in New Issue
Block a user