diff --git a/library.json b/library.json index d4a8930..e9134ae 100644 --- a/library.json +++ b/library.json @@ -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", diff --git a/src/ha.h b/src/ha.h index 76e1f94..c57e442 100644 --- a/src/ha.h +++ b/src/ha.h @@ -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; }