mirror of
https://github.com/Laxilef/OTGateway.git
synced 2026-03-21 01:38:38 +05:00
fix: HaHelper::publishDynamicSensor() for DHT sensors fixed
This commit is contained in:
@@ -176,9 +176,10 @@ public:
|
||||
objId.c_str()
|
||||
);
|
||||
|
||||
// set device class, name, value template for bluetooth sensors
|
||||
// set device class, name, value template for Bluetooth/DHT sensors
|
||||
// or name & value template for another sensors
|
||||
if (sSensor.type == Sensors::Type::BLUETOOTH) {
|
||||
if (sSensor.type == Sensors::Type::BLUETOOTH ||
|
||||
sSensor.type == Sensors::Type::DHT11 || sSensor.type == Sensors::Type::DHT22) {
|
||||
// available state topic
|
||||
doc[FPSTR(HA_AVAILABILITY)][1][FPSTR(HA_TOPIC)] = doc[FPSTR(HA_STATE_TOPIC)];
|
||||
doc[FPSTR(HA_AVAILABILITY)][1][FPSTR(HA_VALUE_TEMPLATE)] = JsonString(AVAILABILITY_SENSOR_CONN, true);
|
||||
|
||||
Reference in New Issue
Block a user