Skip to content

Commit c623020

Browse files
committed
Merge pull request #39 from domoticz/master
Update from original
2 parents 2830369 + 356aa76 commit c623020

File tree

1 file changed

+7
-11
lines changed

1 file changed

+7
-11
lines changed

main/mainworker.cpp

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10634,7 +10634,7 @@ bool MainWorker::DoesDeviceActiveAScene(const unsigned long long DevRowIdx, cons
1063410634
sstr >> aID;
1063510635
if (aID == DevRowIdx)
1063610636
{
10637-
if ((SceneType == 1) || (sCode.empty()))
10637+
if ((SceneType == SGTYPE_GROUP) || (sCode.empty()))
1063810638
return true;
1063910639
int iCode = atoi(sCode.c_str());
1064010640
if (iCode == Cmnd)
@@ -10701,7 +10701,7 @@ bool MainWorker::SwitchScene(const unsigned long long idx, const std::string &sw
1070110701
std::string camidx=sd[0];
1070210702
int delay=atoi(sd[1].c_str());
1070310703
std::string subject;
10704-
if (scenetype==SGTYPE_SCENE)
10704+
if (scenetype == SGTYPE_SCENE)
1070510705
subject=Name + " Activated";
1070610706
else
1070710707
subject=Name + " Status: " + switchcmd;
@@ -10759,15 +10759,11 @@ bool MainWorker::SwitchScene(const unsigned long long idx, const std::string &sw
1075910759
bool bHaveGroupCmd=false;
1076010760
int maxDimLevel=0;
1076110761

10762-
if (scenetype == SGTYPE_SCENE)
10763-
{
10764-
//Scene
10765-
GetLightStatus(dType, dSubType, switchtype, cmd, sValue, lstatus, llevel, bHaveDimmer, maxDimLevel, bHaveGroupCmd);
10766-
}
10767-
else
10762+
GetLightStatus(dType, dSubType, switchtype, cmd, sValue, lstatus, llevel, bHaveDimmer, maxDimLevel, bHaveGroupCmd);
10763+
10764+
if (scenetype == SGTYPE_GROUP)
1076810765
{
10769-
//Group
10770-
lstatus = ((lstatus == "On") || (lstatus == "Group On") || (lstatus == "Chime") || (lstatus == "All On")) ? "On" : "Off";
10766+
lstatus = ((switchcmd == "On") || (switchcmd == "Group On") || (switchcmd == "Chime") || (switchcmd == "All On")) ? "On" : "Off";
1077110767
}
1077210768
_log.Log(LOG_NORM, "Activating Scene/Group Device: %s (%s)", DeviceName.c_str(), lstatus.c_str());
1077310769

@@ -10856,7 +10852,7 @@ void MainWorker::CheckSceneCode(const unsigned long long DevRowIdx, const unsign
1085610852
s_str >> ID;
1085710853
int scenetype = atoi(sd[2].c_str());
1085810854

10859-
if ((scenetype == 0) && (!sCode.empty()))
10855+
if ((scenetype == SGTYPE_SCENE) && (!sCode.empty()))
1086010856
{
1086110857
//Also check code
1086210858
int iCode = atoi(sCode.c_str());

0 commit comments

Comments
 (0)