fixed issue in blind state
This commit is contained in:
parent
ae9e857f4a
commit
7148472732
@ -589,6 +589,7 @@ void DevicePluginUniPi::onWebSocketTextMessageReceived(QString message)
|
|||||||
device->setStateValue(blindStatusStateTypeId, "stopped");
|
device->setStateValue(blindStatusStateTypeId, "stopped");
|
||||||
} else {
|
} else {
|
||||||
qWarning(dcUniPi()) << "Blind" << device << "Output open:" << value << "Status: " << device->stateValue(blindStatusStateTypeId).toString();
|
qWarning(dcUniPi()) << "Blind" << device << "Output open:" << value << "Status: " << device->stateValue(blindStatusStateTypeId).toString();
|
||||||
|
device->setStateValue(blindStatusStateTypeId, "stopped");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (circuit == device->paramValue(blindOutputCloseParamTypeId).toString()) {
|
if (circuit == device->paramValue(blindOutputCloseParamTypeId).toString()) {
|
||||||
@ -598,8 +599,8 @@ void DevicePluginUniPi::onWebSocketTextMessageReceived(QString message)
|
|||||||
device->setStateValue(blindStatusStateTypeId, "stopped");
|
device->setStateValue(blindStatusStateTypeId, "stopped");
|
||||||
} else {
|
} else {
|
||||||
qWarning(dcUniPi()) << "Blind" << device << "Output close:" << value << "Status: " << device->stateValue(blindStatusStateTypeId).toString();
|
qWarning(dcUniPi()) << "Blind" << device << "Output close:" << value << "Status: " << device->stateValue(blindStatusStateTypeId).toString();
|
||||||
|
device->setStateValue(blindStatusStateTypeId, "stopped");
|
||||||
}
|
}
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} else if (device->deviceClassId() == lightDeviceClassId) {
|
} else if (device->deviceClassId() == lightDeviceClassId) {
|
||||||
@ -618,21 +619,23 @@ void DevicePluginUniPi::onWebSocketTextMessageReceived(QString message)
|
|||||||
device->setStateValue(digitalOutputPowerStateTypeId, QVariant(obj["value"].toInt()).toBool());
|
device->setStateValue(digitalOutputPowerStateTypeId, QVariant(obj["value"].toInt()).toBool());
|
||||||
} else if (device->deviceClassId() == blindDeviceClassId) {
|
} else if (device->deviceClassId() == blindDeviceClassId) {
|
||||||
if (circuit == device->paramValue(blindOutputOpenParamTypeId).toString()) {
|
if (circuit == device->paramValue(blindOutputOpenParamTypeId).toString()) {
|
||||||
if (value && device->stateValue(blindStatusStateTypeId).toString().contains("stop")) {
|
if (value && device->stateValue(blindStatusStateTypeId).toString().contains("stopped")) {
|
||||||
device->setStateValue(blindStatusStateTypeId, "open");
|
device->setStateValue(blindStatusStateTypeId, "opening");
|
||||||
} else if (!value && device->stateValue(blindStatusStateTypeId).toString().contains("open")) {
|
} else if (!value && device->stateValue(blindStatusStateTypeId).toString().contains("opening")) {
|
||||||
device->setStateValue(blindStatusStateTypeId, "stop");
|
device->setStateValue(blindStatusStateTypeId, "stopped");
|
||||||
} else {
|
} else {
|
||||||
qWarning(dcUniPi()) << "blind" << device << "Output open:" << value << "Status: " << device->stateValue(blindStatusStateTypeId).toString();
|
qWarning(dcUniPi()) << "blind" << device << "Output open:" << value << "Status: " << device->stateValue(blindStatusStateTypeId).toString();
|
||||||
|
device->setStateValue(blindStatusStateTypeId, "stopped");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (circuit == device->paramValue(blindOutputCloseParamTypeId).toString()) {
|
if (circuit == device->paramValue(blindOutputCloseParamTypeId).toString()) {
|
||||||
if (value && device->stateValue(blindStatusStateTypeId).toString().contains("stop")) {
|
if (value && device->stateValue(blindStatusStateTypeId).toString().contains("stopped")) {
|
||||||
device->setStateValue(blindStatusStateTypeId, "close");
|
device->setStateValue(blindStatusStateTypeId, "closing");
|
||||||
} else if (!value && device->stateValue(blindStatusStateTypeId).toString().contains("close")) {
|
} else if (!value && device->stateValue(blindStatusStateTypeId).toString().contains("closing")) {
|
||||||
device->setStateValue(blindStatusStateTypeId, "stop");
|
device->setStateValue(blindStatusStateTypeId, "stopped");
|
||||||
} else {
|
} else {
|
||||||
qWarning(dcUniPi()) << "blind" << device << "Output close:" << value << "Status: " << device->stateValue(blindStatusStateTypeId).toString();
|
qWarning(dcUniPi()) << "blind" << device << "Output close:" << value << "Status: " << device->stateValue(blindStatusStateTypeId).toString();
|
||||||
|
device->setStateValue(blindStatusStateTypeId, "stopped");
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -665,6 +668,16 @@ void DevicePluginUniPi::onWebSocketTextMessageReceived(QString message)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if (obj["dev"] == "led") { //TODO can't discover leds without toggling it from another client
|
||||||
|
qCDebug(dcUniPi()) << "Led:" << obj["dev"] << "Circuit:" << obj["circuit"].toString() << "Value:" << obj["value"].toInt();
|
||||||
|
|
||||||
|
if (!m_leds.contains(obj["circuit"].toString())){
|
||||||
|
//New led detected
|
||||||
|
m_leds.append(obj["circuit"].toString());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (obj["dev"] == "ao") {
|
if (obj["dev"] == "ao") {
|
||||||
qCDebug(dcUniPi()) << "Analog Output:" << obj["dev"] << "Circuit:" << obj["circuit"].toString() << "Value:" << obj["value"].toDouble();
|
qCDebug(dcUniPi()) << "Analog Output:" << obj["dev"] << "Circuit:" << obj["circuit"].toString() << "Value:" << obj["value"].toDouble();
|
||||||
|
|
||||||
@ -702,15 +715,6 @@ void DevicePluginUniPi::onWebSocketTextMessageReceived(QString message)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (obj["dev"] == "led") { //TODO can't discover leds without toggling it from another client
|
|
||||||
qCDebug(dcUniPi()) << "Led:" << obj["dev"] << "Circuit:" << obj["circuit"].toString() << "Value:" << obj["value"].toInt();
|
|
||||||
|
|
||||||
if (!m_leds.contains(obj["circuit"].toString())){
|
|
||||||
//New led detected
|
|
||||||
m_leds.append(obj["circuit"].toString());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user