Skip to content

Commit 3d00609

Browse files
committed
RTL433, implemented Moisture sensor (should implement #3089)
1 parent e32df70 commit 3d00609

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

hardware/Rtl433.cpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,9 @@ bool CRtl433::ParseLine(const std::vector<std::string> &headers, const char *lin
169169
bool haveWind_Dir = false;
170170
int wind_dir = 0;
171171

172+
bool haveMoisture = false;
173+
int moisture = 0;
174+
172175
if (!data["id"].empty())
173176
{
174177
id = atoi(data["id"].c_str());
@@ -308,6 +311,11 @@ bool CRtl433::ParseLine(const std::vector<std::string> &headers, const char *lin
308311
wind_gust = (float)atof(data["gust"].c_str());
309312
haveWind_Gust = true;
310313
}
314+
else if (FindField(data, "moisture"))
315+
{
316+
moisture = atoi(data["moisture"].c_str());
317+
haveMoisture = true;
318+
}
311319

312320
std::string model = data["model"];
313321

@@ -381,6 +389,12 @@ bool CRtl433::ParseLine(const std::vector<std::string> &headers, const char *lin
381389
SendDistanceSensor(sensoridx, unit, batterylevel, depth, model);
382390
return true;
383391
}
392+
if (haveMoisture)
393+
{
394+
SendMoistureSensor(sensoridx, batterylevel, moisture, model);
395+
return true;
396+
}
397+
384398
return false; //not handled (Yet!)
385399
}
386400

0 commit comments

Comments
 (0)