fix(mqtt): Use new default_entity_id instead of deprecated object_id in autodiscovery

This was introduced in HA 2025.10 with the old way being removed in HA 2026.04
This commit is contained in:
Sören Beye 2025-10-03 08:48:56 +02:00
parent 614d7b7ef2
commit 391101541a
2 changed files with 3 additions and 2 deletions

View File

@ -20,6 +20,7 @@ class InLineHassComponent extends HassComponent {
this.name = options.name;
this.friendlyName = options.friendlyName;
this.componentType = options.componentType;
this.autoconf = options.autoconf;
this.topics = options.topics ?? null;
@ -37,7 +38,7 @@ class InLineHassComponent extends HassComponent {
getAutoconf() {
return Object.assign(this.autoconf, {
name: this.friendlyName,
object_id: `${this.hass.objectId}_${this.friendlyName.toLowerCase().replace(/ /g, "_")}`
default_entity_id: `${this.componentType}.${this.hass.objectId}_${this.friendlyName.toLowerCase().replace(/ /g, "_")}`
});
}

View File

@ -23,7 +23,7 @@ class VacuumHassComponent extends HassComponent {
getAutoconf() {
const result = {
name: "Robot",
object_id: this.hass.objectId,
default_entity_id: `${ComponentType.VACUUM}.${this.hass.objectId}`,
supported_features: [
"status",
"start",