diff --git a/src/main.cpp b/src/main.cpp index 420a42f..667fb29 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -34,7 +34,7 @@ void setupWebServer(void); void connectToMqtt(void); -const String firmware{"1.24"}; +const String firmware{"1.25"}; String espnowNetName{"DEFAULT"}; @@ -258,6 +258,8 @@ void onEspnowMessage(const char *data, const uint8_t *sender) jsonConfig["force_update"] = "true"; jsonConfig["qos"] = 2; jsonConfig["retain"] = "true"; + if (type == HACT_SENSOR) + jsonConfig["device_class"] = getValueName(json["class"].as()); if (type == HACT_BINARY_SENSOR) { jsonConfig["device_class"] = getValueName(json["class"].as());