Commit 106bcdf8 authored by Langston Ball's avatar Langston Ball

ref #2794 Fix some stupid errors, limit signals, remove qjson depenency

parent 5ce4342a
......@@ -1395,6 +1395,7 @@ void HueController::handleCheckLightInformation(QNetworkReply *reply)
QVariantMap p = QJsonDocument::fromJson(rep).object().toVariantMap();
if(p.isEmpty()){
qDebug() << " Empty Reply !" ;
return;
}
foreach(AbstractWirelessBulb*b, hueBulbs){
......@@ -1500,7 +1501,7 @@ void HueController::handleLightEvent(int whichEvent)
if(whichEvent==EVENT_Device_OnOff_CONST ){
if(b->linuxmceId()==0)return;
// qDebug() << Q_FUNC_INFO;
qDebug() << Q_FUNC_INFO;
DCE::Message *m = new DCE::Message (
b->linuxmceId(),
......
......@@ -15,7 +15,7 @@ INCLUDEPATH += /usr/include/qjson/ \
../../ \
../../DCE/
LIBS += -lqjson
DESTDIR=../../bin
include (../../QtCommonIncludes/PlutoUtils.pri)
......
......@@ -90,6 +90,7 @@ void AbstractWirelessBulb::setCurrentLevel(double CurrentLevel)
m_CurrentLevel = CurrentLevel;
emit currentLevelChanged();
qDebug() << Q_FUNC_INFO;
emit dceMessage(EVENT_State_Changed_CONST);
}
bool AbstractWirelessBulb::powerOn() const
......@@ -99,21 +100,15 @@ bool AbstractWirelessBulb::powerOn() const
void AbstractWirelessBulb::setPowerOn(bool powerOn)
{
bool stateChanged=false;
if(m_powerOn != powerOn) stateChanged=true;
if(m_powerOn == powerOn) return;
m_powerOn = powerOn;
emit powerOnChanged();
if(linuxmceId()==0)
return;
if(stateChanged){
qDebug() << Q_FUNC_INFO;
emit dceMessage(EVENT_Device_OnOff_CONST);
}
}
int AbstractWirelessBulb::bulbType() const
{
......@@ -198,11 +193,11 @@ void AbstractWirelessBulb::proccessStateInformation(QVariantMap d)
break;
case DEVICETEMPLATE_Hue_Light_Strips_CONST :
setCurrentColor(stateInfo);
setCurrentLevel(stateInfo["bri"].toUInt()/2.55);
break;
case DEVICETEMPLATE_Hue_Lux_Bulb_CONST :
setCurrentColor(stateInfo);
setCurrentLevel(stateInfo["bri"].toUInt()/2.55);
break;
case DEVICETEMPLATE_Connected_A19_60w_Equivalent_CONST :
setBrightness(stateInfo["bri"].toDouble());
......@@ -340,6 +335,7 @@ void AbstractWirelessBulb::setBrightness(const quint8 &brightness)
emit dceMessage(EVENT_Brightness_Changed_CONST);
emit dceMessage(EVENT_State_Changed_CONST);
qDebug() << Q_FUNC_INFO;
}
QString AbstractWirelessBulb::uniqueId() const
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment