Merge PR #221: EQ-3: Fix connection to MAX! cube
commit
00ecacfae9
|
|
@ -154,10 +154,6 @@ void DevicePluginEQ3::setupDevice(DeviceSetupInfo *info)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(device->deviceClassId() == wallThermostateDeviceClassId){
|
|
||||||
device->setName("Max! Wall Thermostat (" + device->paramValue(wallThermostateDeviceSerialParamTypeId).toString() + ")");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (device->deviceClassId() == eqivaBluetoothDeviceClassId) {
|
if (device->deviceClassId() == eqivaBluetoothDeviceClassId) {
|
||||||
EqivaBluetooth *eqivaDevice = new EqivaBluetooth(hardwareManager()->bluetoothLowEnergyManager(), QBluetoothAddress(device->paramValue(eqivaBluetoothDeviceMacAddressParamTypeId).toString()), device->name(), this);
|
EqivaBluetooth *eqivaDevice = new EqivaBluetooth(hardwareManager()->bluetoothLowEnergyManager(), QBluetoothAddress(device->paramValue(eqivaBluetoothDeviceMacAddressParamTypeId).toString()), device->name(), this);
|
||||||
m_eqivaDevices.insert(device, eqivaDevice);
|
m_eqivaDevices.insert(device, eqivaDevice);
|
||||||
|
|
@ -264,27 +260,28 @@ EqivaBluetooth::Mode DevicePluginEQ3::stringToMode(const QString &string)
|
||||||
|
|
||||||
void DevicePluginEQ3::executeAction(DeviceActionInfo *info)
|
void DevicePluginEQ3::executeAction(DeviceActionInfo *info)
|
||||||
{
|
{
|
||||||
Device *device = info->device();
|
|
||||||
Action action = info->action();
|
Action action = info->action();
|
||||||
|
|
||||||
if(device->deviceClassId() == wallThermostateDeviceClassId){
|
if(info->device()->deviceClassId() == wallThermostatDeviceClassId){
|
||||||
|
Device *device = myDevices().findById(info->device()->parentId());
|
||||||
MaxCube *cube = m_cubes.key(device);
|
MaxCube *cube = m_cubes.key(device);
|
||||||
QByteArray rfAddress = device->paramValue(wallThermostateDeviceRfParamTypeId).toByteArray();
|
QByteArray rfAddress = device->paramValue(wallThermostatDeviceRfParamTypeId).toByteArray();
|
||||||
int roomId = device->paramValue(wallThermostateDeviceRoomParamTypeId).toInt();
|
int roomId = device->paramValue(wallThermostatDeviceRoomParamTypeId).toInt();
|
||||||
|
|
||||||
// FIXME: The MaxCube class needs a reworkto queue commands instead of overwriting each other's actionId
|
// FIXME: The MaxCube class needs a reworkto queue commands instead of overwriting each other's actionId
|
||||||
|
|
||||||
if (action.actionTypeId() == wallThermostateTargetTemperatureActionTypeId){
|
if (action.actionTypeId() == wallThermostatTargetTemperatureActionTypeId){
|
||||||
cube->setDeviceSetpointTemp(rfAddress, roomId, action.param(wallThermostateTargetTemperatureActionTargetTemperatureParamTypeId).value().toDouble(), action.id());
|
cube->setDeviceSetpointTemp(rfAddress, roomId, action.param(wallThermostatTargetTemperatureActionTargetTemperatureParamTypeId).value().toDouble(), action.id());
|
||||||
} else if (action.actionTypeId() == wallThermostateSetAutoModeActionTypeId){
|
} else if (action.actionTypeId() == wallThermostatPowerActionTypeId) {
|
||||||
|
cube->setDeviceSetpointTemp(rfAddress, roomId, action.param(wallThermostatPowerActionPowerParamTypeId).value().toBool() ? device->stateValue(wallThermostatComfortTemperatureStateTypeId).toDouble() : 4.5, action.id());
|
||||||
|
} else if (action.actionTypeId() == wallThermostatSetAutoModeActionTypeId){
|
||||||
cube->setDeviceAutoMode(rfAddress, roomId, action.id());
|
cube->setDeviceAutoMode(rfAddress, roomId, action.id());
|
||||||
} else if (action.actionTypeId() == wallThermostateSetManualModeActionTypeId){
|
} else if (action.actionTypeId() == wallThermostatSetManualModeActionTypeId){
|
||||||
cube->setDeviceManuelMode(rfAddress, roomId, action.id());
|
cube->setDeviceManuelMode(rfAddress, roomId, action.id());
|
||||||
} else if (action.actionTypeId() == wallThermostateSetEcoModeActionTypeId){
|
} else if (action.actionTypeId() == wallThermostatSetEcoModeActionTypeId){
|
||||||
cube->setDeviceEcoMode(rfAddress, roomId, action.id());
|
cube->setDeviceEcoMode(rfAddress, roomId, action.id());
|
||||||
} else if (action.actionTypeId() == wallThermostateDisplayCurrentTempActionTypeId){
|
} else if (action.actionTypeId() == wallThermostatDisplayCurrentTempActionTypeId){
|
||||||
cube->displayCurrentTemperature(rfAddress, roomId, action.param(wallThermostateDisplayCurrentTempActionDisplayParamTypeId).value().toBool(), action.id());
|
cube->displayCurrentTemperature(rfAddress, roomId, action.param(wallThermostatDisplayCurrentTempActionDisplayParamTypeId).value().toBool(), action.id());
|
||||||
}
|
}
|
||||||
|
|
||||||
// Connect this info object to the next coming commandActionFinished
|
// Connect this info object to the next coming commandActionFinished
|
||||||
|
|
@ -294,18 +291,21 @@ void DevicePluginEQ3::executeAction(DeviceActionInfo *info)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (device->deviceClassId() == radiatorThermostateDeviceClassId){
|
if (info->device()->deviceClassId() == radiatorThermostatDeviceClassId){
|
||||||
|
Device *device = myDevices().findById(info->device()->parentId());
|
||||||
MaxCube *cube = m_cubes.key(device);
|
MaxCube *cube = m_cubes.key(device);
|
||||||
QByteArray rfAddress = device->paramValue(radiatorThermostateDeviceRfParamTypeId).toByteArray();
|
QByteArray rfAddress = device->paramValue(radiatorThermostatDeviceRfParamTypeId).toByteArray();
|
||||||
int roomId = device->paramValue(radiatorThermostateDeviceRoomParamTypeId).toInt();
|
int roomId = device->paramValue(radiatorThermostatDeviceRoomParamTypeId).toInt();
|
||||||
|
|
||||||
if (action.actionTypeId() == radiatorThermostateDesiredTemperatureActionTypeId){
|
if (action.actionTypeId() == radiatorThermostatTargetTemperatureActionTypeId){
|
||||||
cube->setDeviceSetpointTemp(rfAddress, roomId, action.param(radiatorThermostateDesiredTemperatureActionDesiredTemperatureParamTypeId).value().toDouble(), action.id());
|
cube->setDeviceSetpointTemp(rfAddress, roomId, action.param(radiatorThermostatTargetTemperatureActionTargetTemperatureParamTypeId).value().toDouble(), action.id());
|
||||||
} else if (action.actionTypeId() == radiatorThermostateSetAutoModeActionTypeId){
|
} else if (action.actionTypeId() == radiatorThermostatPowerActionTypeId) {
|
||||||
|
cube->setDeviceSetpointTemp(rfAddress, roomId, action.param(radiatorThermostatPowerActionPowerParamTypeId).value().toBool() ? device->stateValue(radiatorThermostatComfortTempStateTypeId).toDouble() : 4.5, action.id());
|
||||||
|
} else if (action.actionTypeId() == radiatorThermostatSetAutoModeActionTypeId){
|
||||||
cube->setDeviceAutoMode(rfAddress, roomId, action.id());
|
cube->setDeviceAutoMode(rfAddress, roomId, action.id());
|
||||||
} else if (action.actionTypeId() == radiatorThermostateSetManualModeActionTypeId){
|
} else if (action.actionTypeId() == radiatorThermostatSetManualModeActionTypeId){
|
||||||
cube->setDeviceManuelMode(rfAddress, roomId, action.id());
|
cube->setDeviceManuelMode(rfAddress, roomId, action.id());
|
||||||
} else if (action.actionTypeId() == radiatorThermostateSetEcoModeActionTypeId){
|
} else if (action.actionTypeId() == radiatorThermostatSetEcoModeActionTypeId){
|
||||||
cube->setDeviceEcoMode(rfAddress, roomId, action.id());
|
cube->setDeviceEcoMode(rfAddress, roomId, action.id());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -317,7 +317,8 @@ void DevicePluginEQ3::executeAction(DeviceActionInfo *info)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (device->deviceClassId() == eqivaBluetoothDeviceClassId) {
|
if (info->device()->deviceClassId() == eqivaBluetoothDeviceClassId) {
|
||||||
|
Device *device = info->device();
|
||||||
int commandId;
|
int commandId;
|
||||||
EqivaBluetooth *eqivaDevice = m_eqivaDevices.value(device);
|
EqivaBluetooth *eqivaDevice = m_eqivaDevices.value(device);
|
||||||
|
|
||||||
|
|
@ -386,22 +387,21 @@ void DevicePluginEQ3::wallThermostatFound()
|
||||||
QList<DeviceDescriptor> descriptorList;
|
QList<DeviceDescriptor> descriptorList;
|
||||||
|
|
||||||
foreach (WallThermostat *wallThermostat, cube->wallThermostatList()) {
|
foreach (WallThermostat *wallThermostat, cube->wallThermostatList()) {
|
||||||
bool allreadyAdded = false;
|
bool alreadyAdded = false;
|
||||||
foreach (Device *device, myDevices().filterByDeviceClassId(wallThermostateDeviceClassId)){
|
foreach (Device *device, myDevices().filterByDeviceClassId(wallThermostatDeviceClassId)){
|
||||||
if(wallThermostat->serialNumber() == device->paramValue(wallThermostateDeviceSerialParamTypeId).toString()){
|
if(wallThermostat->serialNumber() == device->paramValue(wallThermostatDeviceSerialParamTypeId).toString()){
|
||||||
allreadyAdded = true;
|
alreadyAdded = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(!allreadyAdded){
|
if(!alreadyAdded){
|
||||||
DeviceDescriptor descriptor(wallThermostateDeviceClassId, wallThermostat->serialNumber());
|
DeviceDescriptor descriptor(wallThermostatDeviceClassId, wallThermostat->serialNumber());
|
||||||
|
descriptor.setParentDeviceId(m_cubes.value(cube)->id());
|
||||||
ParamList params;
|
ParamList params;
|
||||||
params.append(Param(wallThermostateDeviceNameParamTypeId, wallThermostat->deviceName()));
|
params.append(Param(wallThermostatDeviceSerialParamTypeId, wallThermostat->serialNumber()));
|
||||||
params.append(Param(wallThermostateDeviceParentParamTypeId, cube->serialNumber()));
|
params.append(Param(wallThermostatDeviceRfParamTypeId, wallThermostat->rfAddress()));
|
||||||
params.append(Param(wallThermostateDeviceSerialParamTypeId, wallThermostat->serialNumber()));
|
params.append(Param(wallThermostatDeviceRoomParamTypeId, wallThermostat->roomId()));
|
||||||
params.append(Param(wallThermostateDeviceRfParamTypeId, wallThermostat->rfAddress()));
|
params.append(Param(wallThermostatDeviceRoomNameParamTypeId, wallThermostat->roomName()));
|
||||||
params.append(Param(wallThermostateDeviceRoomParamTypeId, wallThermostat->roomId()));
|
|
||||||
params.append(Param(wallThermostateDeviceRoomNameParamTypeId, wallThermostat->roomName()));
|
|
||||||
descriptor.setParams(params);
|
descriptor.setParams(params);
|
||||||
descriptorList.append(descriptor);
|
descriptorList.append(descriptor);
|
||||||
}
|
}
|
||||||
|
|
@ -419,29 +419,28 @@ void DevicePluginEQ3::radiatorThermostatFound()
|
||||||
QList<DeviceDescriptor> descriptorList;
|
QList<DeviceDescriptor> descriptorList;
|
||||||
|
|
||||||
foreach (RadiatorThermostat *radiatorThermostat, cube->radiatorThermostatList()) {
|
foreach (RadiatorThermostat *radiatorThermostat, cube->radiatorThermostatList()) {
|
||||||
bool allreadyAdded = false;
|
bool alreadyAdded = false;
|
||||||
foreach (Device *device, myDevices().filterByDeviceClassId(radiatorThermostateDeviceClassId)){
|
foreach (Device *device, myDevices().filterByDeviceClassId(radiatorThermostatDeviceClassId)){
|
||||||
if(radiatorThermostat->serialNumber() == device->paramValue(radiatorThermostateDeviceSerialParamTypeId).toString()){
|
if(radiatorThermostat->serialNumber() == device->paramValue(radiatorThermostatDeviceSerialParamTypeId).toString()){
|
||||||
allreadyAdded = true;
|
alreadyAdded = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(!allreadyAdded){
|
if(!alreadyAdded){
|
||||||
DeviceDescriptor descriptor(radiatorThermostateDeviceClassId, radiatorThermostat->serialNumber());
|
DeviceDescriptor descriptor(radiatorThermostatDeviceClassId, "Max! Radiator Thermostat (" + radiatorThermostat->serialNumber() + ")");
|
||||||
|
descriptor.setParentDeviceId(m_cubes.value(cube)->id());
|
||||||
ParamList params;
|
ParamList params;
|
||||||
params.append(Param(radiatorThermostateDeviceNameParamTypeId, radiatorThermostat->deviceName()));
|
params.append(Param(radiatorThermostatDeviceSerialParamTypeId, radiatorThermostat->serialNumber()));
|
||||||
params.append(Param(radiatorThermostateDeviceParentParamTypeId, cube->serialNumber()));
|
params.append(Param(radiatorThermostatDeviceRfParamTypeId, radiatorThermostat->rfAddress()));
|
||||||
params.append(Param(radiatorThermostateDeviceSerialParamTypeId, radiatorThermostat->serialNumber()));
|
params.append(Param(radiatorThermostatDeviceRoomParamTypeId, radiatorThermostat->roomId()));
|
||||||
params.append(Param(radiatorThermostateDeviceRfParamTypeId, radiatorThermostat->rfAddress()));
|
params.append(Param(radiatorThermostatDeviceRoomNameParamTypeId, radiatorThermostat->roomName()));
|
||||||
params.append(Param(radiatorThermostateDeviceRoomParamTypeId, radiatorThermostat->roomId()));
|
|
||||||
params.append(Param(radiatorThermostateDeviceRoomNameParamTypeId, radiatorThermostat->roomName()));
|
|
||||||
descriptor.setParams(params);
|
descriptor.setParams(params);
|
||||||
descriptorList.append(descriptor);
|
descriptorList.append(descriptor);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!descriptorList.isEmpty()){
|
if(!descriptorList.isEmpty()){
|
||||||
metaObject()->invokeMethod(this, "autoDevicesAppeared", Qt::QueuedConnection, Q_ARG(DeviceClassId, radiatorThermostateDeviceClassId), Q_ARG(QList<DeviceDescriptor>, descriptorList));
|
emit autoDevicesAppeared(descriptorList);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -461,23 +460,24 @@ void DevicePluginEQ3::wallThermostatDataUpdated()
|
||||||
MaxCube *cube = static_cast<MaxCube*>(sender());
|
MaxCube *cube = static_cast<MaxCube*>(sender());
|
||||||
|
|
||||||
foreach (WallThermostat *wallThermostat, cube->wallThermostatList()) {
|
foreach (WallThermostat *wallThermostat, cube->wallThermostatList()) {
|
||||||
foreach (Device *device, myDevices().filterByDeviceClassId(wallThermostateDeviceClassId)){
|
foreach (Device *device, myDevices().filterByDeviceClassId(wallThermostatDeviceClassId)){
|
||||||
if(device->paramValue(wallThermostateDeviceSerialParamTypeId).toString() == wallThermostat->serialNumber()){
|
if(device->paramValue(wallThermostatDeviceSerialParamTypeId).toString() == wallThermostat->serialNumber()){
|
||||||
device->setStateValue(wallThermostateComfortTemperatureStateTypeId, wallThermostat->comfortTemp());
|
device->setStateValue(wallThermostatConnectedStateTypeId, wallThermostat->initialized() && wallThermostat->linkStatusOK());
|
||||||
device->setStateValue(wallThermostateEcoTempStateTypeId, wallThermostat->ecoTemp());
|
device->setStateValue(wallThermostatComfortTemperatureStateTypeId, wallThermostat->comfortTemp());
|
||||||
device->setStateValue(wallThermostateMaxSetpointTempStateTypeId, wallThermostat->maxSetPointTemp());
|
device->setStateValue(wallThermostatEcoTempStateTypeId, wallThermostat->ecoTemp());
|
||||||
device->setStateValue(wallThermostateMinSetpointTempStateTypeId, wallThermostat->minSetPointTemp());
|
device->setStateValue(wallThermostatMaxSetpointTempStateTypeId, wallThermostat->maxSetPointTemp());
|
||||||
device->setStateValue(wallThermostateErrorOccurredStateTypeId, wallThermostat->errorOccurred());
|
device->setStateValue(wallThermostatMinSetpointTempStateTypeId, wallThermostat->minSetPointTemp());
|
||||||
device->setStateValue(wallThermostateInitializedStateTypeId, wallThermostat->initialized());
|
device->setStateValue(wallThermostatErrorOccurredStateTypeId, wallThermostat->errorOccurred());
|
||||||
device->setStateValue(wallThermostateBatteryCriticalStateTypeId, wallThermostat->batteryLow());
|
device->setStateValue(wallThermostatInitializedStateTypeId, wallThermostat->initialized());
|
||||||
device->setStateValue(wallThermostateLinkStatusOKStateTypeId, wallThermostat->linkStatusOK());
|
device->setStateValue(wallThermostatBatteryCriticalStateTypeId, wallThermostat->batteryLow());
|
||||||
device->setStateValue(wallThermostatePanelLockedStateTypeId, wallThermostat->panelLocked());
|
device->setStateValue(wallThermostatPanelLockedStateTypeId, wallThermostat->panelLocked());
|
||||||
device->setStateValue(wallThermostateGatewayKnownStateTypeId, wallThermostat->gatewayKnown());
|
device->setStateValue(wallThermostatGatewayKnownStateTypeId, wallThermostat->gatewayKnown());
|
||||||
device->setStateValue(wallThermostateDtsActiveStateTypeId, wallThermostat->dtsActive());
|
device->setStateValue(wallThermostatDtsActiveStateTypeId, wallThermostat->dtsActive());
|
||||||
device->setStateValue(wallThermostateDeviceModeStateTypeId, wallThermostat->deviceMode());
|
device->setStateValue(wallThermostatDeviceModeStateTypeId, wallThermostat->deviceMode());
|
||||||
device->setStateValue(wallThermostateDeviceModeStringStateTypeId, wallThermostat->deviceModeString());
|
device->setStateValue(wallThermostatDeviceModeStringStateTypeId, wallThermostat->deviceModeString());
|
||||||
device->setStateValue(wallThermostateTargetTemperatureStateTypeId, wallThermostat->setpointTemperature());
|
device->setStateValue(wallThermostatTargetTemperatureStateTypeId, wallThermostat->setpointTemperature());
|
||||||
device->setStateValue(wallThermostateTemperatureStateTypeId, wallThermostat->currentTemperature());
|
device->setStateValue(wallThermostatPowerStateTypeId, wallThermostat->setpointTemperature() > 4.5);
|
||||||
|
device->setStateValue(wallThermostatTemperatureStateTypeId, wallThermostat->currentTemperature());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -488,30 +488,32 @@ void DevicePluginEQ3::radiatorThermostatDataUpdated()
|
||||||
MaxCube *cube = static_cast<MaxCube*>(sender());
|
MaxCube *cube = static_cast<MaxCube*>(sender());
|
||||||
|
|
||||||
foreach (RadiatorThermostat *radiatorThermostat, cube->radiatorThermostatList()) {
|
foreach (RadiatorThermostat *radiatorThermostat, cube->radiatorThermostatList()) {
|
||||||
foreach (Device *device, myDevices().filterByDeviceClassId(radiatorThermostateDeviceClassId)){
|
foreach (Device *device, myDevices().filterByDeviceClassId(radiatorThermostatDeviceClassId)){
|
||||||
if(device->paramValue(radiatorThermostateDeviceSerialParamTypeId).toString() == radiatorThermostat->serialNumber()){
|
if(device->paramValue(radiatorThermostatDeviceSerialParamTypeId).toString() == radiatorThermostat->serialNumber()){
|
||||||
device->setStateValue(radiatorThermostateComfortTempStateTypeId, radiatorThermostat->comfortTemp());
|
device->setStateValue(radiatorThermostatConnectedStateTypeId, radiatorThermostat->initialized() && radiatorThermostat->linkStatusOK());
|
||||||
device->setStateValue(radiatorThermostateEcoTempStateTypeId, radiatorThermostat->ecoTemp());
|
device->setStateValue(radiatorThermostatComfortTempStateTypeId, radiatorThermostat->comfortTemp());
|
||||||
device->setStateValue(radiatorThermostateMaxSetpointTempStateTypeId, radiatorThermostat->maxSetPointTemp());
|
device->setStateValue(radiatorThermostatEcoTempStateTypeId, radiatorThermostat->ecoTemp());
|
||||||
device->setStateValue(radiatorThermostateMinSetpointTempStateTypeId, radiatorThermostat->minSetPointTemp());
|
device->setStateValue(radiatorThermostatMaxSetpointTempStateTypeId, radiatorThermostat->maxSetPointTemp());
|
||||||
device->setStateValue(radiatorThermostateErrorOccurredStateTypeId, radiatorThermostat->errorOccurred());
|
device->setStateValue(radiatorThermostatMinSetpointTempStateTypeId, radiatorThermostat->minSetPointTemp());
|
||||||
device->setStateValue(radiatorThermostateInitializedStateTypeId, radiatorThermostat->initialized());
|
device->setStateValue(radiatorThermostatErrorOccurredStateTypeId, radiatorThermostat->errorOccurred());
|
||||||
device->setStateValue(radiatorThermostateBatteryLowStateTypeId, radiatorThermostat->batteryLow());
|
device->setStateValue(radiatorThermostatInitializedStateTypeId, radiatorThermostat->initialized());
|
||||||
device->setStateValue(radiatorThermostatePanelLockedStateTypeId, radiatorThermostat->panelLocked());
|
device->setStateValue(radiatorThermostatBatteryCriticalStateTypeId, radiatorThermostat->batteryLow());
|
||||||
device->setStateValue(radiatorThermostateGatewayKnownStateTypeId, radiatorThermostat->gatewayKnown());
|
device->setStateValue(radiatorThermostatPanelLockedStateTypeId, radiatorThermostat->panelLocked());
|
||||||
device->setStateValue(radiatorThermostateDtsActiveStateTypeId, radiatorThermostat->dtsActive());
|
device->setStateValue(radiatorThermostatGatewayKnownStateTypeId, radiatorThermostat->gatewayKnown());
|
||||||
device->setStateValue(radiatorThermostateDeviceModeStateTypeId, radiatorThermostat->deviceMode());
|
device->setStateValue(radiatorThermostatDtsActiveStateTypeId, radiatorThermostat->dtsActive());
|
||||||
device->setStateValue(radiatorThermostateDeviceModeStringStateTypeId, radiatorThermostat->deviceModeString());
|
device->setStateValue(radiatorThermostatDeviceModeStateTypeId, radiatorThermostat->deviceMode());
|
||||||
device->setStateValue(radiatorThermostateDesiredTemperatureStateTypeId, radiatorThermostat->setpointTemperature());
|
device->setStateValue(radiatorThermostatDeviceModeStringStateTypeId, radiatorThermostat->deviceModeString());
|
||||||
device->setStateValue(radiatorThermostateOffsetTempStateTypeId, radiatorThermostat->offsetTemp());
|
device->setStateValue(radiatorThermostatTargetTemperatureStateTypeId, radiatorThermostat->setpointTemperature());
|
||||||
device->setStateValue(radiatorThermostateWindowOpenDurationStateTypeId, radiatorThermostat->windowOpenDuration());
|
device->setStateValue(radiatorThermostatPowerStateTypeId, radiatorThermostat->setpointTemperature() > 4.5);
|
||||||
device->setStateValue(radiatorThermostateBoostValveValueStateTypeId, radiatorThermostat->boostValveValue());
|
device->setStateValue(radiatorThermostatOffsetTempStateTypeId, radiatorThermostat->offsetTemp());
|
||||||
device->setStateValue(radiatorThermostateBoostDurationStateTypeId, radiatorThermostat->boostDuration());
|
device->setStateValue(radiatorThermostatWindowOpenDurationStateTypeId, radiatorThermostat->windowOpenDuration());
|
||||||
device->setStateValue(radiatorThermostateDiscalcWeekDayStateTypeId, radiatorThermostat->discalcingWeekDay());
|
device->setStateValue(radiatorThermostatBoostValveValueStateTypeId, radiatorThermostat->boostValveValue());
|
||||||
device->setStateValue(radiatorThermostateDiscalcTimeStateTypeId, radiatorThermostat->discalcingTime().toString("HH:mm"));
|
device->setStateValue(radiatorThermostatBoostDurationStateTypeId, radiatorThermostat->boostDuration());
|
||||||
device->setStateValue(radiatorThermostateValveMaximumSettingsStateTypeId, radiatorThermostat->valveMaximumSettings());
|
device->setStateValue(radiatorThermostatDiscalcWeekDayStateTypeId, radiatorThermostat->discalcingWeekDay());
|
||||||
device->setStateValue(radiatorThermostateValveOffsetStateTypeId, radiatorThermostat->valveOffset());
|
device->setStateValue(radiatorThermostatDiscalcTimeStateTypeId, radiatorThermostat->discalcingTime().toString("HH:mm"));
|
||||||
device->setStateValue(radiatorThermostateValvePositionStateTypeId, radiatorThermostat->valvePosition());
|
device->setStateValue(radiatorThermostatValveMaximumSettingsStateTypeId, radiatorThermostat->valveMaximumSettings());
|
||||||
|
device->setStateValue(radiatorThermostatValveOffsetStateTypeId, radiatorThermostat->valveOffset());
|
||||||
|
device->setStateValue(radiatorThermostatValvePositionStateTypeId, radiatorThermostat->valvePosition());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -63,9 +63,9 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "ffbfec5d-06e8-4082-b62b-92cc5c3e8c4e",
|
"id": "ffbfec5d-06e8-4082-b62b-92cc5c3e8c4e",
|
||||||
"name": "wallThermostate",
|
"name": "wallThermostat",
|
||||||
"displayName": "Max! Wall Thermostat",
|
"displayName": "Max! Wall Thermostat",
|
||||||
"interfaces": ["thermostat", "temperaturesensor", "battery"],
|
"interfaces": ["heating", "thermostat", "temperaturesensor", "battery", "connectable"],
|
||||||
"createMethods": ["auto"],
|
"createMethods": ["auto"],
|
||||||
"paramTypes": [
|
"paramTypes": [
|
||||||
{
|
{
|
||||||
|
|
@ -75,18 +75,6 @@
|
||||||
"type": "QString",
|
"type": "QString",
|
||||||
"inputType": "TextLine"
|
"inputType": "TextLine"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"id": "8d32b228-8618-483f-bcc3-2d62868d6912",
|
|
||||||
"name": "name",
|
|
||||||
"displayName": "name",
|
|
||||||
"type": "QString"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": "801be701-ea53-4cb2-a933-823f330e7837",
|
|
||||||
"name": "parent",
|
|
||||||
"displayName": "parent cube",
|
|
||||||
"type": "QString"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"id": "6ba358c1-0c31-4ea4-93fd-544f030582a7",
|
"id": "6ba358c1-0c31-4ea4-93fd-544f030582a7",
|
||||||
"name": "rf",
|
"name": "rf",
|
||||||
|
|
@ -200,7 +188,7 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "aff38be8-7ea6-4fd8-b0fa-e987ab05c719",
|
"id": "aff38be8-7ea6-4fd8-b0fa-e987ab05c719",
|
||||||
"name": "linkStatusOK",
|
"name": "connected",
|
||||||
"displayName": "link status ok",
|
"displayName": "link status ok",
|
||||||
"displayNameEvent": "link status changed",
|
"displayNameEvent": "link status changed",
|
||||||
"type": "bool",
|
"type": "bool",
|
||||||
|
|
@ -255,6 +243,18 @@
|
||||||
"type": "double",
|
"type": "double",
|
||||||
"unit": "DegreeCelsius",
|
"unit": "DegreeCelsius",
|
||||||
"defaultValue": 0,
|
"defaultValue": 0,
|
||||||
|
"minValue": 4.5,
|
||||||
|
"maxValue": 30.5,
|
||||||
|
"writable": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "73c5bf9d-030b-4804-b3c9-bf796ab26886",
|
||||||
|
"name": "power",
|
||||||
|
"displayName": "On/off",
|
||||||
|
"displayNameEvent": "Turned on or off",
|
||||||
|
"displayNameAction": "Turn on or off",
|
||||||
|
"type": "bool",
|
||||||
|
"defaultValue": false,
|
||||||
"writable": true
|
"writable": true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
@ -270,8 +270,9 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "f80d9481-4827-45ee-a013-b97b22412d92",
|
"id": "f80d9481-4827-45ee-a013-b97b22412d92",
|
||||||
"name": "radiatorThermostate",
|
"name": "radiatorThermostat",
|
||||||
"displayName": "Max! Radiator Thermostat",
|
"displayName": "Max! Radiator Thermostat",
|
||||||
|
"interfaces": ["heating", "thermostat", "battery", "connectable"],
|
||||||
"createMethods": ["auto"],
|
"createMethods": ["auto"],
|
||||||
"paramTypes": [
|
"paramTypes": [
|
||||||
{
|
{
|
||||||
|
|
@ -281,18 +282,6 @@
|
||||||
"type": "QString",
|
"type": "QString",
|
||||||
"inputType": "TextLine"
|
"inputType": "TextLine"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"id": "e098f95d-cbf8-4d41-bb03-0691a932f8c2",
|
|
||||||
"name": "name",
|
|
||||||
"displayName": "name",
|
|
||||||
"type": "QString"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": "809730b8-06fe-42f0-9775-7d8ae1a1620b",
|
|
||||||
"name": "parent",
|
|
||||||
"displayName": "parent cube",
|
|
||||||
"type": "QString"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"id": "d74e8fb8-71cc-4bb5-ac0a-04a100458bdb",
|
"id": "d74e8fb8-71cc-4bb5-ac0a-04a100458bdb",
|
||||||
"name": "rf",
|
"name": "rf",
|
||||||
|
|
@ -384,7 +373,7 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "2b1beca3-5053-41f5-a826-2a7c1d59da20",
|
"id": "2b1beca3-5053-41f5-a826-2a7c1d59da20",
|
||||||
"name": "batteryLow",
|
"name": "batteryCritical",
|
||||||
"displayName": "battery low",
|
"displayName": "battery low",
|
||||||
"displayNameEvent": "battery low changed",
|
"displayNameEvent": "battery low changed",
|
||||||
"type": "bool",
|
"type": "bool",
|
||||||
|
|
@ -392,7 +381,7 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "bbc03a0b-f4dc-48dc-8924-79028f0357a2",
|
"id": "bbc03a0b-f4dc-48dc-8924-79028f0357a2",
|
||||||
"name": "linkStatusOk",
|
"name": "connected",
|
||||||
"displayName": "link status ok",
|
"displayName": "link status ok",
|
||||||
"displayNameEvent": "link status changed",
|
"displayNameEvent": "link status changed",
|
||||||
"type": "bool",
|
"type": "bool",
|
||||||
|
|
@ -440,13 +429,25 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "19d3ce6e-a1bc-4727-8827-62545c82fe13",
|
"id": "19d3ce6e-a1bc-4727-8827-62545c82fe13",
|
||||||
"name": "desiredTemperature",
|
"name": "targetTemperature",
|
||||||
"displayName": "desired temperature",
|
"displayName": "desired temperature",
|
||||||
"displayNameEvent": "desired temperature changed",
|
"displayNameEvent": "desired temperature changed",
|
||||||
"displayNameAction": "Set desired temperature",
|
"displayNameAction": "Set desired temperature",
|
||||||
"unit": "DegreeCelsius",
|
"unit": "DegreeCelsius",
|
||||||
"type": "double",
|
"type": "double",
|
||||||
"defaultValue": 0,
|
"defaultValue": 0,
|
||||||
|
"minValue": 4.5,
|
||||||
|
"maxValue": 30.5,
|
||||||
|
"writable": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "d7927bd5-9ee8-4567-90d2-f951cd1eb628",
|
||||||
|
"name": "power",
|
||||||
|
"displayName": "On/off",
|
||||||
|
"displayNameEvent": "Turned on or off",
|
||||||
|
"displayNameAction": "Turn on or off",
|
||||||
|
"type": "bool",
|
||||||
|
"defaultValue": false,
|
||||||
"writable": true
|
"writable": true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -61,6 +61,7 @@ void MaxCubeDiscovery::readData()
|
||||||
if(!data.isEmpty() && data.contains("eQ3MaxAp")){
|
if(!data.isEmpty() && data.contains("eQ3MaxAp")){
|
||||||
|
|
||||||
CubeInfo cube;
|
CubeInfo cube;
|
||||||
|
cube.hostAddress = sender;
|
||||||
cube.serialNumber = data.mid(8,10);
|
cube.serialNumber = data.mid(8,10);
|
||||||
cube.rfAddress = data.mid(21,3).toHex();
|
cube.rfAddress = data.mid(21,3).toHex();
|
||||||
cube.firmware = data.mid(24,2).toHex().toInt();
|
cube.firmware = data.mid(24,2).toHex().toInt();
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue