mirror of
https://github.com/arendst/Tasmota.git
synced 2025-04-24 23:07:17 +00:00
parent
9c3fb8fc82
commit
7bf6e5a773
@ -80,7 +80,7 @@ bool Rg15Poll(void) {
|
||||
if (++Rg15.time == RG15_EVENT_TIMEOUT) {
|
||||
Rg15.acc = 0;
|
||||
Rg15.rate = 0;
|
||||
MqttPublishSensor();
|
||||
// MqttPublishSensor();
|
||||
}
|
||||
|
||||
return false;
|
||||
@ -96,7 +96,7 @@ bool Rg15Poll(void) {
|
||||
Rg15Process(rg15_buffer);
|
||||
}
|
||||
|
||||
MqttPublishSensor();
|
||||
// MqttPublishSensor();
|
||||
|
||||
return true;
|
||||
}
|
||||
@ -142,14 +142,15 @@ float Rg15Parse(char* buffer, const char* item) {
|
||||
char* start = strstr(buffer, item);
|
||||
if (start != nullptr) {
|
||||
char* end = strstr(start, " mm");
|
||||
char tmp = end[0];
|
||||
end[0] = '\0';
|
||||
float result = CharToFloat (start + strlen(item));
|
||||
end[0] = tmp;
|
||||
return result;
|
||||
} else {
|
||||
return 0.0f;
|
||||
if (end != nullptr) {
|
||||
char tmp = end[0];
|
||||
end[0] = '\0';
|
||||
float result = CharToFloat (start + strlen(item));
|
||||
end[0] = tmp;
|
||||
return result;
|
||||
}
|
||||
}
|
||||
return 0.0f;
|
||||
}
|
||||
|
||||
bool Rg15Command(void) {
|
||||
@ -167,6 +168,7 @@ bool Rg15Command(void) {
|
||||
|
||||
char rg15_buffer[255];
|
||||
if (Rg15ReadLine(rg15_buffer)) {
|
||||
AddLog(LOG_LEVEL_DEBUG_MORE, PSTR("HRG: Received %*_H"), strlen(rg15_buffer), rg15_buffer);
|
||||
Response_P(PSTR("{\"" D_JSON_SERIALRECEIVED "\":\"%s\"}"), rg15_buffer);
|
||||
Rg15Process(rg15_buffer);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user