mirror of https://github.com/arendst/Tasmota.git
Merge branch 'development' of github.com:arendst/Tasmota into pr_tm1638
This commit is contained in:
commit
b05790083d
|
@ -272,7 +272,7 @@ void RfSnsTheoV2Show(bool json)
|
|||
sensor, GetDT(rfsns_theo_v2_t1[i].time).c_str(), voltage);
|
||||
}
|
||||
} else {
|
||||
float temp = ConvertTemp((float)rfsns_theo_v2_t1[i].temp / 100)
|
||||
float temp = ConvertTemp((float)rfsns_theo_v2_t1[i].temp / 100);
|
||||
|
||||
if (json) {
|
||||
ResponseAppend_P(PSTR(",\"%s\":{\"" D_JSON_TEMPERATURE "\":%*_f,\"" D_JSON_ILLUMINANCE "\":%d,\"" D_JSON_VOLTAGE "\":%s}"),
|
||||
|
|
|
@ -465,6 +465,7 @@ double meter_vars[SML_MAX_VARS];
|
|||
double dvalues[MAX_DVARS];
|
||||
uint32_t dtimes[MAX_DVARS];
|
||||
uint8_t meters_used;
|
||||
uint8_t dvalid[SML_MAX_VARS];
|
||||
|
||||
struct METER_DESC const *meter_desc_p;
|
||||
const uint8_t *meter_p;
|
||||
|
@ -494,6 +495,7 @@ char meter_id[MAX_METERS][METER_ID_SIZE];
|
|||
uint8_t sml_send_blocks;
|
||||
uint8_t sml_100ms_cnt;
|
||||
uint8_t sml_desc_cnt;
|
||||
uint8_t sml_json_enable = 1;
|
||||
|
||||
#ifdef USE_SML_MEDIAN_FILTER
|
||||
// median filter, should be odd size
|
||||
|
@ -1621,6 +1623,7 @@ void SML_Decode(uint8_t index) {
|
|||
#else
|
||||
meter_vars[vindex]=dval;
|
||||
#endif
|
||||
dvalid[vindex] = 1;
|
||||
//AddLog_P(LOG_LEVEL_INFO, PSTR(">> %s"),mp);
|
||||
// get scaling factor
|
||||
double fac=CharToDouble((char*)mp);
|
||||
|
@ -1779,6 +1782,8 @@ void SML_Show(boolean json) {
|
|||
dtostrfd(meter_vars[index],dp,tpowstr);
|
||||
}
|
||||
|
||||
if (!dvalid[index]) nojson = 1;
|
||||
|
||||
if (json) {
|
||||
// json export
|
||||
if (index==0) {
|
||||
|
@ -1953,6 +1958,7 @@ void SML_Init(void) {
|
|||
|
||||
for (uint32_t cnt=0;cnt<SML_MAX_VARS;cnt++) {
|
||||
meter_vars[cnt]=0;
|
||||
dvalid[cnt]=0;
|
||||
}
|
||||
|
||||
for (uint32_t cnt=0;cnt<MAX_METERS;cnt++) {
|
||||
|
@ -2650,7 +2656,9 @@ bool Xsns53(byte function) {
|
|||
break;
|
||||
#endif // USE_SCRIPT
|
||||
case FUNC_JSON_APPEND:
|
||||
SML_Show(1);
|
||||
if (sml_json_enable) {
|
||||
SML_Show(1);
|
||||
}
|
||||
break;
|
||||
#ifdef USE_WEBSERVER
|
||||
case FUNC_WEB_SENSOR:
|
||||
|
|
Loading…
Reference in New Issue