-
Notifications
You must be signed in to change notification settings - Fork 0
/
zoneinfo.cpp
228 lines (186 loc) · 4.71 KB
/
zoneinfo.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
* Copyright 2013 - 2022, nymea GmbH
* Contact: contact@nymea.io
*
* This file is part of nymea.
* This project including source code and documentation is protected by
* copyright law, and remains the property of nymea GmbH. All rights, including
* reproduction, publication, editing and translation, are reserved. The use of
* this project is subject to the terms of a license agreement to be concluded
* with nymea GmbH in accordance with the terms of use of nymea GmbH, available
* under https://nymea.io/license
*
* GNU General Public License Usage
* Alternatively, this project may be redistributed and/or modified under the
* terms of the GNU General Public License as published by the Free Software
* Foundation, GNU version 3. This project is distributed in the hope that it
* will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
* Public License for more details.
*
* You should have received a copy of the GNU General Public License along with
* this project. If not, see <https://www.gnu.org/licenses/>.
*
* For any further details and any questions please contact us under
* contact@nymea.io or see our FAQ/Licensing Information on
* https://nymea.io/license/faq
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
#include "zoneinfo.h"
ZoneInfo::ZoneInfo()
{
}
ZoneInfo::ZoneInfo(const QUuid &id):
m_id(id)
{
}
QUuid ZoneInfo::id() const
{
return m_id;
}
QString ZoneInfo::name() const
{
return m_name;
}
void ZoneInfo::setName(const QString &name)
{
m_name = name;
}
double ZoneInfo::currentSetpoint() const
{
return m_currentSetpoint;
}
void ZoneInfo::setCurrentSetpoint(double currentSetpoint)
{
m_currentSetpoint = currentSetpoint;
}
double ZoneInfo::standbySetpoint() const
{
return m_standbySetpoint;
}
void ZoneInfo::setStandbySetpoint(double standbySetpoint)
{
m_standbySetpoint = standbySetpoint;
}
double ZoneInfo::setpointOverride() const
{
return m_setpointOverride;
}
void ZoneInfo::setSetpointOverride(double setpointOverride, SetpointOverrideMode mode, const QDateTime &setpointOverrideEnd)
{
m_setpointOverride = setpointOverride;
m_setpointOverrideMode = mode;
m_setpointOverrideEnd = setpointOverrideEnd;
}
ZoneInfo::SetpointOverrideMode ZoneInfo::setpointOverrideMode() const
{
return m_setpointOverrideMode;
}
QDateTime ZoneInfo::setpointOverrideEnd() const
{
return m_setpointOverrideEnd;
}
QList<ThingId> ZoneInfo::thermostats() const
{
return m_thermostats;
}
void ZoneInfo::setThermostats(const QList<ThingId> &thermostats)
{
m_thermostats = thermostats;
}
QList<ThingId> ZoneInfo::windowSensors() const
{
return m_windowSensors;
}
void ZoneInfo::setWindowSensors(const QList<ThingId> &windowSensors)
{
m_windowSensors = windowSensors;
}
QList<ThingId> ZoneInfo::indoorSensors() const
{
return m_indoorSensors;
}
void ZoneInfo::setIndoorSensors(const QList<ThingId> &indoorSensors)
{
m_indoorSensors = indoorSensors;
}
QList<ThingId> ZoneInfo::outdoorSensors() const
{
return m_outdoorSensors;
}
void ZoneInfo::setOutdoorSensors(const QList<ThingId> &outdoorSensors)
{
m_outdoorSensors = outdoorSensors;
}
QList<ThingId> ZoneInfo::notifications() const
{
return m_notifications;
}
void ZoneInfo::setNotifications(const QList<ThingId> ¬ifications)
{
m_notifications = notifications;
}
ZoneInfo::ZoneStatus ZoneInfo::zoneStatus() const
{
return m_zoneStatus;
}
void ZoneInfo::setZoneStatus(ZoneStatus zoneStatus)
{
m_zoneStatus = zoneStatus;
}
void ZoneInfo::setZoneStatusFlag(ZoneStatusFlag flag, bool set)
{
m_zoneStatus.setFlag(flag, set);
}
double ZoneInfo::temperature() const
{
return m_temperature;
}
void ZoneInfo::setTemperature(double temperature)
{
m_temperature = temperature;
}
double ZoneInfo::humidity() const
{
return m_humidity;
}
void ZoneInfo::setHumidity(double humidity)
{
m_humidity = humidity;
}
uint ZoneInfo::voc() const
{
return m_voc;
}
void ZoneInfo::setVoc(uint voc)
{
m_voc = voc;
}
double ZoneInfo::pm25() const
{
return m_pm25;
}
void ZoneInfo::setPm25(double pm25)
{
m_pm25 = pm25;
}
TemperatureWeekSchedule ZoneInfo::weekSchedule() const
{
return m_weekSchedule;
}
void ZoneInfo::setWeekSchedule(const TemperatureWeekSchedule &weekSchedule)
{
m_weekSchedule = weekSchedule;
while (m_weekSchedule.count() < 7) {
m_weekSchedule.append(TemperatureDaySchedule());
}
}
QVariant ZoneInfos::get(int index) const
{
return QVariant::fromValue(at(index));
}
void ZoneInfos::put(const QVariant &variant)
{
append(variant.value<ZoneInfo>());
}