From 0227340a1f22ec3b206eace1f31348a67b195341 Mon Sep 17 00:00:00 2001 From: Nicu Hodos Date: Tue, 15 Oct 2024 17:07:26 +0200 Subject: [PATCH] fix possible hash related bug with storing char instead of string into map --- library.json | 2 +- src/ha.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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: