2 * Copyright (c) 2010-2023 Contributors to the openHAB project
4 * See the NOTICE file(s) distributed with this work for additional
7 * This program and the accompanying materials are made available under the
8 * terms of the Eclipse Public License 2.0 which is available at
9 * http://www.eclipse.org/legal/epl-2.0
11 * SPDX-License-Identifier: EPL-2.0
13 package org.openhab.binding.millheat.internal.dto;
15 import org.openhab.binding.millheat.internal.model.Heater;
18 * This DTO class wraps the set device temp request
20 * @see SetRoomTempRequest
21 * @author Arne Seime - Initial contribution
23 public class SetDeviceTempRequest implements AbstractRequest {
24 public final int subDomain;
25 public final long deviceId;
26 public final boolean testStatus = true;
27 public final int operation;
28 public final boolean status;
29 public final boolean windStatus;
30 public final int holdTemp;
31 public final int tempType = 0; // FIXED?
32 public final int powerLevel = 0; // FIXED?
35 public String getRequestUrl() {
36 return "deviceControl";
39 public SetDeviceTempRequest(final Heater heater, final int targetTemperature, final boolean masterSwitch,
40 final boolean fanActive) {
41 this.subDomain = heater.getSubDomain();
42 this.deviceId = heater.getId();
43 this.holdTemp = targetTemperature;
44 this.status = masterSwitch;
45 this.windStatus = fanActive;
46 if (fanActive != heater.fanActive()) {
49 } else if (heater.getTargetTemp() != targetTemperature) {