diff --git a/library.json b/library.json index 73d2f45..04fd2d0 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.3.0", + "version": "1.3.1", "description": "Home Assistant classes for integration with MQTT auto discovery", "repository": { "type": "git", diff --git a/src/ha.h b/src/ha.h index 8465741..7103b45 100644 --- a/src/ha.h +++ b/src/ha.h @@ -363,7 +363,7 @@ namespace Ha { Sensor(const char* name, const char* id) : Component(name, id, "sensor"), StateConfig(this) { withStateTopic(); - mapSensors.insert({ id, this }); + mapSensors.insert({ string(id), this }); } protected: