Version 1.25
Fixed bug with ESP-NOW sensors not being added to HA via MQTT discovery.
This commit is contained in:
parent
1c306e031b
commit
8e9082f05e
@ -34,7 +34,7 @@ void setupWebServer(void);
|
|||||||
|
|
||||||
void connectToMqtt(void);
|
void connectToMqtt(void);
|
||||||
|
|
||||||
const String firmware{"1.24"};
|
const String firmware{"1.25"};
|
||||||
|
|
||||||
String espnowNetName{"DEFAULT"};
|
String espnowNetName{"DEFAULT"};
|
||||||
|
|
||||||
@ -258,6 +258,8 @@ void onEspnowMessage(const char *data, const uint8_t *sender)
|
|||||||
jsonConfig["force_update"] = "true";
|
jsonConfig["force_update"] = "true";
|
||||||
jsonConfig["qos"] = 2;
|
jsonConfig["qos"] = 2;
|
||||||
jsonConfig["retain"] = "true";
|
jsonConfig["retain"] = "true";
|
||||||
|
if (type == HACT_SENSOR)
|
||||||
|
jsonConfig["device_class"] = getValueName(json["class"].as<ha_sensor_device_class_t>());
|
||||||
if (type == HACT_BINARY_SENSOR)
|
if (type == HACT_BINARY_SENSOR)
|
||||||
{
|
{
|
||||||
jsonConfig["device_class"] = getValueName(json["class"].as<ha_binary_sensor_device_class_t>());
|
jsonConfig["device_class"] = getValueName(json["class"].as<ha_binary_sensor_device_class_t>());
|
||||||
|
Loading…
x
Reference in New Issue
Block a user