Skip to content

Commit 2204a62

Browse files
committed
RFLink: bug fix on unknown command, changed wind speed value
1 parent 95def9c commit 2204a62

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

hardware/RFLinkBase.cpp

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,9 @@ const _tRFLinkStringIntHelper rfswitchcommands[] =
8282
{ "ALLOFF", gswitch_sGroupOff },
8383
{ "DIM", gswitch_sDim },
8484
{ "BRIGHT", gswitch_sBright },
85+
{ "UP", blinds_sOpen },
86+
{ "DOWN", blinds_sClose },
87+
{ "STOP", blinds_sStop },
8588
{ "", -1 }
8689
};
8790

@@ -256,13 +259,13 @@ bool CRFLinkBase::SendSwitchInt(const int ID, const int switchunit, const int Ba
256259

257260
int svalue=level;
258261
if (cmnd==-1) {
259-
if (switchcmd.compare(0, 9, "SETLEVEL=") ){
262+
if (switchcmd.compare(0, 9, "SETLEVEL=") == 0 ){
260263
cmnd=gswitch_sSetLevel;
261264
std::string str2 = switchcmd.substr(10);
262265
svalue=atoi(str2.c_str());
263-
//_log.Log(LOG_STATUS, "RFLink: %d level: %d", cmnd, svalue);
266+
_log.Log(LOG_STATUS, "RFLink: %d level: %d", cmnd, svalue);
264267
}
265-
}
268+
}
266269

267270
if (cmnd==-1)
268271
{
@@ -482,13 +485,13 @@ bool CRFLinkBase::ParseLine(const std::string &sLine)
482485
{
483486
bHaveWindSpeed = true;
484487
iTemp = RFLinkGetHexStringValue(results[ii]);
485-
windspeed = float(iTemp) * 0.0277778f; //convert to m/s
488+
windspeed = (float(iTemp) * 0.0277778f)/10; //convert to m/s
486489
}
487490
else if (results[ii].find("WINGS") != std::string::npos)
488491
{
489492
bHaveWindGust = true;
490493
iTemp = RFLinkGetHexStringValue(results[ii]);
491-
windgust = float(iTemp) * 0.0277778f; //convert to m/s
494+
windgust = (float(iTemp) * 0.0277778f)/10; //convert to m/s
492495
}
493496
else if (results[ii].find("WINTMP") != std::string::npos)
494497
{

0 commit comments

Comments
 (0)