Skip to content

Commit

Permalink
fix(mqtt): Fix Home Assistant object_id generation
Browse files Browse the repository at this point in the history
  • Loading branch information
Hypfer committed Nov 16, 2024
1 parent ee76222 commit d77480c
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,14 @@ class InLineHassComponent extends HassComponent {
}
}

/**
* @public
* @return {{[key: string]: any}}
*/
getAutoconf() {
return Object.assign(this.autoconf, {
name: this.friendlyName,
object_id: `${this.hass.objectId}_${this.friendlyName.toLowerCase()}`
object_id: `${this.hass.objectId}_${this.friendlyName.toLowerCase().replace(/ /g, "_")}`
});
}

Expand Down

0 comments on commit d77480c

Please sign in to comment.