mirror of
https://github.com/Hypfer/Valetudo.git
synced 2025-10-26 11:27:27 +00:00
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:
parent
614d7b7ef2
commit
391101541a
@ -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, "_")}`
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@ -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",
|
||||
|
||||
Loading…
Reference in New Issue
Block a user