Skip to content

Commit abb715c

Browse files
committed
2 parents b4dab8b + a1f82bd commit abb715c

File tree

3 files changed

+26
-5
lines changed

3 files changed

+26
-5
lines changed

hardware/Kodi.cpp

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -812,18 +812,27 @@ bool CKodi::WriteToHardware(const char *pdata, const unsigned char length)
812812
if (packettype != pTypeLighting2)
813813
return false;
814814

815-
if (pSen->LIGHTING2.cmnd != light2_sOff)
816-
{
817-
return true;
818-
}
819815
long DevID = (pSen->LIGHTING2.id3 << 8) | pSen->LIGHTING2.id4;
820816

821817
std::vector<boost::shared_ptr<CKodiNode> >::iterator itt;
822818
for (itt = m_pNodes.begin(); itt != m_pNodes.end(); ++itt)
823819
{
824820
if ((*itt)->m_DevID == DevID)
825821
{
826-
return (*itt)->SendShutdown();
822+
switch (pSen->LIGHTING2.cmnd)
823+
{
824+
case light2_sOff:
825+
case light2_sGroupOff:
826+
return (*itt)->SendShutdown();
827+
case light2_sStop:
828+
(*itt)->SendCommand("stop");
829+
return true;
830+
case light2_sPause:
831+
(*itt)->SendCommand("playpause");
832+
return true;
833+
default:
834+
return true;
835+
}
827836
}
828837
}
829838

main/RFXNames.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1989,6 +1989,16 @@ bool GetLightCommand(
19891989
cmd=light2_sSetGroupLevel;
19901990
return true;
19911991
}
1992+
else if (switchcmd == "Stop")
1993+
{
1994+
cmd = light2_sStop;
1995+
return true;
1996+
}
1997+
else if (switchcmd == "Paused")
1998+
{
1999+
cmd = light2_sPause;
2000+
return true;
2001+
}
19922002
else
19932003
return false;
19942004
break;

main/RFXtrx.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -417,6 +417,8 @@ SDK version 4.9
417417
#define light2_sGroupOff 0x3
418418
#define light2_sGroupOn 0x4
419419
#define light2_sSetGroupLevel 0x5
420+
#define light2_sStop 0x6
421+
#define light2_sPause 0x7
420422

421423
#define pTypeLighting3 0x12
422424
#define sTypeKoppla 0x0

0 commit comments

Comments
 (0)