fix(mqtt): Fix Home Assistant object_id generation

This commit is contained in:
Sören Beye 2024-11-16 15:58:13 +01:00
parent ee76222a41
commit d77480c192

View File

@ -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, "_")}`
});
}