Skip to content

Commit

Permalink
RFLink: fix stop command
Browse files Browse the repository at this point in the history
  • Loading branch information
stuntteam committed Jan 11, 2017
1 parent 2cd9791 commit 2e6733e
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions hardware/RFLinkBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -275,18 +275,22 @@ bool CRFLinkBase::WriteToHardware(const char *pdata, const unsigned char length)
std::string ID = szDeviceID;
GetSwitchType(ID.c_str(), pSwitch->unitcode, pSwitch->type, pSwitch->subtype, m_SwitchType);
//_log.Log(LOG_ERROR, "RFLink: switch type: %d", m_SwitchType);
//_log.Log(LOG_ERROR, "RFLink: switch cmd: %d", pSwitch->cmnd);

if (pSwitch->type == pTypeGeneralSwitch) {
std::string switchcmnd = GetGeneralRFLinkFromInt(rfswitchcommands, pSwitch->cmnd);

if ((m_SwitchType == STYPE_VenetianBlindsEU) || (m_SwitchType == STYPE_Blinds)) {
switchcmnd = GetGeneralRFLinkFromInt(rfblindcommands, pSwitch->cmnd);
} else
if ((m_SwitchType == STYPE_VenetianBlindsUS) || (m_SwitchType == STYPE_BlindsInverted)) {
if (pSwitch->cmnd != gswitch_sStop) {
if ((m_SwitchType == STYPE_VenetianBlindsEU) || (m_SwitchType == STYPE_Blinds)) {
switchcmnd = GetGeneralRFLinkFromInt(rfblindcommands, pSwitch->cmnd);
if (pSwitch->cmnd == blinds_sOpen) switchcmnd = GetGeneralRFLinkFromInt(rfblindcommands, blinds_sClose);
else if (pSwitch->cmnd == blinds_sClose) switchcmnd = GetGeneralRFLinkFromInt(rfblindcommands, blinds_sOpen);
}
else {
if ((m_SwitchType == STYPE_VenetianBlindsUS) || (m_SwitchType == STYPE_BlindsInverted)) {
switchcmnd = GetGeneralRFLinkFromInt(rfblindcommands, pSwitch->cmnd);
if (pSwitch->cmnd == blinds_sOpen) switchcmnd = GetGeneralRFLinkFromInt(rfblindcommands, blinds_sClose);
else if (pSwitch->cmnd == blinds_sClose) switchcmnd = GetGeneralRFLinkFromInt(rfblindcommands, blinds_sOpen);
}
}
}
//_log.Log(LOG_ERROR, "RFLink: switch command: %d", pSwitch->cmnd);

// check setlevel command
Expand Down

0 comments on commit 2e6733e

Please sign in to comment.