|
|
- diff --git a/hardware/evohome.cpp b/hardware/evohome.cpp
- index fcbee6d..f77291e 100644
- --- a/hardware/evohome.cpp
- +++ b/hardware/evohome.cpp
- @@ -423,11 +423,11 @@ void CEvohome::RunScript(const char *pdata, const unsigned char length)
- boost::replace_all(OnAction, "{state}", s_strid.str());
- boost::replace_all(OnAction, "{until}", CEvohomeDateTime::GetISODate(tsen->EVOHOME2));
- //Execute possible script
- - std::string scriptname;
- - if (OnAction.find("script:///") != std::string::npos)
- - scriptname = OnAction.substr(9);
- - else
- - scriptname = OnAction.substr(8);
- + std::string scriptname = OnAction.substr(9);
- +#if !defined WIN32
- + if (scriptname.find("/") != 0)
- + scriptname = szUserDataFolder + "scripts/" + scriptname;
- +#endif
- std::string scriptparams="";
- //Add parameters
- int pindex=scriptname.find(' ');
- @@ -439,7 +439,7 @@ void CEvohome::RunScript(const char *pdata, const unsigned char length)
-
- if (file_exist(scriptname.c_str()))
- {
- - m_sql.AddTaskItem(_tTaskItem::ExecuteScript(1,scriptname,scriptparams));
- + m_sql.AddTaskItem(_tTaskItem::ExecuteScript(0.2f,scriptname,scriptparams));
- }
- else
- _log.Log(LOG_ERROR,"evohome: Error script not found '%s'",scriptname.c_str());
- @@ -1321,7 +1321,7 @@ bool CEvohome::DecodeZoneName(CEvohomeMsg &msg)
- }
- if(memcmp(&msg.payload[2],m_szNameErr,18)==0)
- {
- - Log(true,LOG_STATUS,"evohome: %s: Warning zone name not set: %d", tag, msg.payload[0]);
- + Log(true,LOG_STATUS,"evohome: %s: Warning zone name not set: %d", tag, msg.payload[0]+1);
- m_bStartup[0]=false;
- return true;
- }
- @@ -1606,9 +1606,11 @@ bool CEvohome::DecodeBatteryInfo(CEvohomeMsg &msg)
- RFX_SETID3(msg.GetID(0),tsen.EVOHOME2.id1,tsen.EVOHOME2.id2,tsen.EVOHOME2.id3)
- tsen.EVOHOME2.updatetype = updBattery;
-
- - double dbCharge=0;
- - if(nBattery!=0xFF)
- - dbCharge=(double)nBattery/2.0; //Presumed to be the charge level where sent
- + if (nBattery == 0xFF)
- + nBattery = 100; // recode full battery (0xFF) to 100 for consistency across device types
- + else
- + nBattery = nBattery / 2; // recode battery level values to 0-100 from original 0-200 values
- +
- if(nLowBat==0)
- nBattery=0;
- tsen.EVOHOME2.battery_level=nBattery;
- @@ -1657,9 +1659,11 @@ bool CEvohome::DecodeBatteryInfo(CEvohomeMsg &msg)
- tsen.EVOHOME2.type=pTypeEvohomeWater;
- tsen.EVOHOME2.subtype=sTypeEvohomeWater;
- tsen.EVOHOME2.zone=nDevNo;
- - sDecodeRXMessage(this, (const unsigned char *)&tsen.EVOHOME2, NULL, nBattery);
- + RFX_SETID3(GetControllerID(), tsen.EVOHOME2.id1, tsen.EVOHOME2.id2, tsen.EVOHOME2.id3);
- + sDecodeRXMessage(this, (const unsigned char *)&tsen.EVOHOME2, "DHW Temp", nBattery); // Update DHW Zone sensor
- }
- - Log(true,LOG_STATUS,"evohome: %s: %s=%d charge=%d (%.1f %%) level=%d (%s)",tag,szType.c_str(),nDevNo,nBattery,dbCharge,nLowBat,(nLowBat==0)?"Low":"OK");
- +
- + Log(true,LOG_STATUS,"evohome: %s: %s=%d charge=%d(%%) level=%d (%s)",tag,szType.c_str(),nDevNo,nBattery,nLowBat,(nLowBat==0)?"Low":"OK");
-
- return true;
- }
|