Permalink
Browse files

RFLink: fix stop command

  • Loading branch information...
1 parent 2cd9791 commit 2e6733e46253d5594bc5c8e7238e091ad7b94957 @stuntteam stuntteam committed Jan 11, 2017
Showing with 11 additions and 7 deletions.
  1. +11 −7 hardware/RFLinkBase.cpp
@@ -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

0 comments on commit 2e6733e

Please sign in to comment.