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.model;
15 import java.util.ArrayList;
16 import java.util.List;
18 import org.openhab.binding.millheat.internal.dto.RoomDTO;
21 * The {@link Room} represents a room in a home as designed by the end user in the Millheat app.
23 * @author Arne Seime - Initial contribution
26 private final Home home;
27 private final long id;
28 private final String name;
29 private final int currentTemp;
30 private final int comfortTemp;
31 private final int sleepTemp;
32 private final int awayTemp;
33 private final boolean heatingActive;
34 private final ModeType mode;
35 private final String roomProgramName;
36 private final List<Heater> heaters = new ArrayList<>();
38 public Room(final RoomDTO dto, final Home home) {
42 currentTemp = (int) dto.currentTemp;
43 comfortTemp = dto.comfortTemp;
44 sleepTemp = dto.sleepTemp;
45 awayTemp = dto.awayTemp;
46 heatingActive = dto.heatStatus;
47 mode = ModeType.valueOf(dto.currentMode);
48 roomProgramName = dto.roomProgram;
51 public void addHeater(final Heater h) {
55 public List<Heater> getHeaters() {
59 public Integer getTargetTemperature() {
62 return home.getHolidayTemp();
77 public String toString() {
78 return "Room [home=" + home.getId() + ", id=" + id + ", name=" + name + ", currentTemp=" + currentTemp
79 + ", comfortTemp=" + comfortTemp + ", sleepTemp=" + sleepTemp + ", awayTemp=" + awayTemp
80 + ", heatingActive=" + heatingActive + ", mode=" + mode + ", roomProgramName=" + roomProgramName
81 + ", heaters=" + heaters + "]";
84 public Home getHome() {
92 public String getName() {
96 public int getCurrentTemp() {
100 public int getComfortTemp() {
104 public int getSleepTemp() {
108 public int getAwayTemp() {
112 public boolean isHeatingActive() {
113 return heatingActive;
116 public ModeType getMode() {
120 public String getRoomProgramName() {
121 return roomProgramName;