Merge pull request #6874 from jonyii/development

Fix SeaPressure unit for HASS autodiscovery
This commit is contained in:
Theo Arends 2019-11-09 10:16:45 +01:00 committed by GitHub
commit 697c600387
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 3 deletions

View File

@ -96,7 +96,7 @@ const char HASS_DISCOVER_SENSOR_HUM[] PROGMEM =
const char HASS_DISCOVER_SENSOR_PRESS[] PROGMEM = const char HASS_DISCOVER_SENSOR_PRESS[] PROGMEM =
",\"unit_of_meas\":\"%s\"," // PressureUnit() setting ",\"unit_of_meas\":\"%s\"," // PressureUnit() setting
"\"val_tpl\":\"{{value_json['%s'].Pressure}}\"," // "BME280":{"Temperature":19.7,"Humidity":27.8,"Pressure":990.1} -> {{ value_json['BME280'].Pressure }} "\"val_tpl\":\"{{value_json['%s'].%s}}\"," // "BME280":{"Temperature":19.7,"Humidity":27.8,"Pressure":990.1} -> {{ value_json['BME280'].Pressure }}
"\"dev_cla\":\"pressure\""; // pressure "\"dev_cla\":\"pressure\""; // pressure
//ENERGY //ENERGY
@ -448,8 +448,9 @@ void HAssAnnounceSensor(const char* sensorname, const char* subsensortype)
TryResponseAppend_P(HASS_DISCOVER_SENSOR_TEMP, TempUnit(), sensorname); TryResponseAppend_P(HASS_DISCOVER_SENSOR_TEMP, TempUnit(), sensorname);
} else if (!strcmp_P(subsensortype, PSTR(D_JSON_HUMIDITY))) { } else if (!strcmp_P(subsensortype, PSTR(D_JSON_HUMIDITY))) {
TryResponseAppend_P(HASS_DISCOVER_SENSOR_HUM, sensorname); TryResponseAppend_P(HASS_DISCOVER_SENSOR_HUM, sensorname);
} else if (!strcmp_P(subsensortype, PSTR(D_JSON_PRESSURE))) { } else if (!strcmp_P(subsensortype, PSTR(D_JSON_PRESSURE))
TryResponseAppend_P(HASS_DISCOVER_SENSOR_PRESS, PressureUnit().c_str(), sensorname); || !strcmp_P(subsensortype, PSTR(D_JSON_PRESSUREATSEALEVEL))){
TryResponseAppend_P(HASS_DISCOVER_SENSOR_PRESS, PressureUnit().c_str(), sensorname, subsensortype);
} else if (!strcmp_P(subsensortype, PSTR(D_JSON_TOTAL)) } else if (!strcmp_P(subsensortype, PSTR(D_JSON_TOTAL))
|| !strcmp_P(subsensortype, PSTR(D_JSON_TODAY)) || !strcmp_P(subsensortype, PSTR(D_JSON_TODAY))
|| !strcmp_P(subsensortype, PSTR(D_JSON_YESTERDAY))){ || !strcmp_P(subsensortype, PSTR(D_JSON_YESTERDAY))){