secondary components: always put the device name in MQTT configuration, even it is just

referenced - new requirement from HA
This commit is contained in:
Nicu Hodos 2024-10-07 15:15:22 +02:00
parent 6a4350a682
commit 69c4222553
2 changed files with 2 additions and 2 deletions

View File

@ -1,7 +1,7 @@
{
"$schema": "https://raw.githubusercontent.com/platformio/platformio-core/develop/platformio/assets/schema/library.json",
"name": "ha-mqtt",
"version": "1.1.0",
"version": "1.2.0",
"description": "Home Assistant classes for integration with MQTT auto discovery",
"repository": {
"type": "git",

View File

@ -212,7 +212,7 @@ namespace Ha {
}
Builder& addSecondary(Component* c) {
if (cmp->mainDevice) c->mainDevice = &DeviceConfig::create(cmp->mainDevice->id);
if (cmp->mainDevice) c->mainDevice = &DeviceConfig::create(cmp->mainDevice->id).withName(cmp->mainDevice->name);
return *this;
}