22 explicit Channel(
int number = -1);
24 static void setStartingChannelNumber(
int channelNumber);
25 static int getStartingChannelNumber();
28 static Channel *GetByChannelNumber(
int channelNumber);
32 static void resetToDefaults();
37 bool setChannelNumber(
int newChannelNumber);
39 void setNewValue(
double dbl);
40 void setNewValue(
double temp,
double humi);
41 void setNewValue(int32_t value);
42 void setNewValue(
bool value);
44 void setNewValue(uint8_t red,
47 uint8_t colorBrightness,
48 uint8_t whiteBrightness,
49 uint8_t whiteTemperature);
50 void setNewValue(uint64_t value);
53 bool setNewValue(
const char *newValue);
55 void setStateOffline();
56 void setStateOnline();
57 void setStateOnlineAndNotAvailable();
58 void setStateFirmwareUpdateOngoing();
59 void setStateOfflineRemoteWakeupNotSupported();
60 bool isStateOnline()
const;
61 bool isStateOnlineAndNotAvailable()
const;
62 bool isStateOfflineRemoteWakeupNotSupported()
const;
63 bool isStateFirmwareUpdateOngoing()
const;
67 void setContainerFillValue(int8_t fillLevel);
68 void setContainerAlarm(
bool active);
69 void setContainerWarning(
bool active);
70 void setContainerInvalidSensorState(
bool invalid);
71 void setContainerSoundAlarmOn(
bool soundAlarmOn);
74 int8_t getContainerFillValue()
const;
75 bool isContainerAlarmActive()
const;
76 bool isContainerWarningActive()
const;
77 bool isContainerInvalidSensorStateActive()
const;
78 bool isContainerSoundAlarmOn()
const;
147 double getValueDouble();
148 double getValueDoubleFirst();
149 double getValueDoubleSecond();
150 int32_t getValueInt32();
151 uint64_t getValueInt64();
152 virtual bool getValueBool();
153 uint8_t getValueRed()
const;
154 uint8_t getValueGreen()
const;
155 uint8_t getValueBlue()
const;
156 uint8_t getValueColorBrightness()
const;
157 uint8_t getValueBrightness()
const;
158 uint8_t getValueWhiteTemperature()
const;
159 double getLastTemperature();
160 uint8_t getValueClosingPercentage()
const;
161 uint8_t getValueTilt()
const;
162 bool getValueIsCalibrating()
const;
164 void setHvacIsOn(
bool isOn);
165 void setHvacIsOnPercent(uint8_t percent);
166 void setHvacMode(uint8_t mode);
167 void setHvacSetpointTemperatureHeat(int16_t setpointTemperatureHeat);
168 void setHvacSetpointTemperatureCool(int16_t setpointTemperatureCool);
169 void clearHvacSetpointTemperatureHeat();
170 void clearHvacSetpointTemperatureCool();
171 void setHvacFlags(uint16_t alarmsAndFlags);
172 void setHvacFlagSetpointTemperatureHeatSet(
bool value);
173 void setHvacFlagSetpointTemperatureCoolSet(
bool value);
174 void setHvacFlagHeating(
bool value);
175 void setHvacFlagCooling(
bool value);
176 void setHvacFlagWeeklySchedule(
bool value);
177 void setHvacFlagFanEnabled(
bool value);
178 void setHvacFlagThermometerError(
bool value);
179 void setHvacFlagClockError(
bool value);
180 void setHvacFlagCountdownTimer(
bool value);
181 void setHvacFlagForcedOffBySensor(
bool value);
182 void setHvacFlagCoolSubfunction(
enum HvacCoolSubfunctionFlag flag);
183 void setHvacFlagWeeklyScheduleTemporalOverride(
bool value);
184 void setHvacFlagBatteryCoverOpen(
bool value);
185 void setHvacFlagCalibrationError(
bool value);
186 void setHvacFlagAntifreezeOverheatActive(
bool value);
187 void clearHvacState();
189 uint8_t getHvacIsOnRaw()
const;
190 bool getHvacIsOnBool()
const;
191 uint8_t getHvacIsOnPercent()
const;
193 uint8_t getHvacMode()
const;
196 const char *getHvacModeCstr(
int mode = -1)
const;
197 int16_t getHvacSetpointTemperatureHeat()
const;
198 int16_t getHvacSetpointTemperatureCool()
const;
199 uint16_t getHvacFlags()
const;
200 bool isHvacFlagSetpointTemperatureHeatSet()
const;
201 bool isHvacFlagSetpointTemperatureCoolSet()
const;
202 bool isHvacFlagHeating()
const;
203 bool isHvacFlagCooling()
const;
204 bool isHvacFlagWeeklySchedule()
const;
205 bool isHvacFlagFanEnabled()
const;
206 bool isHvacFlagThermometerError()
const;
207 bool isHvacFlagClockError()
const;
208 bool isHvacFlagCountdownTimer()
const;
209 bool isHvacFlagForcedOffBySensor()
const;
210 enum HvacCoolSubfunctionFlag getHvacFlagCoolSubfunction()
const;
211 bool isHvacFlagWeeklyScheduleTemporalOverride()
const;
212 bool isHvacFlagBatteryCoverOpen()
const;
213 bool isHvacFlagCalibrationError()
const;
214 bool isHvacFlagAntifreezeOverheatActive()
const;
216 static bool isHvacFlagSetpointTemperatureHeatSet(
const THVACValue *hvacValue);
217 static bool isHvacFlagSetpointTemperatureCoolSet(
const THVACValue *hvacValue);
218 static bool isHvacFlagHeating(
const THVACValue *hvacValue);
219 static bool isHvacFlagCooling(
const THVACValue *hvacValue);
220 static bool isHvacFlagWeeklySchedule(
const THVACValue *hvacValue);
221 static bool isHvacFlagFanEnabled(
const THVACValue *hvacValue);
222 static bool isHvacFlagThermometerError(
const THVACValue *hvacValue);
223 static bool isHvacFlagClockError(
const THVACValue *hvacValue);
224 static bool isHvacFlagCountdownTimer(
const THVACValue *hvacValue);
225 static bool isHvacFlagForcedOffBySensor(
const THVACValue *hvacValue);
226 static enum HvacCoolSubfunctionFlag getHvacFlagCoolSubfunction(
228 static bool isHvacFlagWeeklyScheduleTemporalOverride(
230 static bool isHvacFlagBatteryCoverOpen(
const THVACValue *hvacValue);
231 static bool isHvacFlagCalibrationError(
const THVACValue *hvacValue);
232 static bool isHvacFlagAntifreezeOverheatActive(
const THVACValue *hvacValue);
234 static void setHvacSetpointTemperatureHeat(
THVACValue *hvacValue,
235 int16_t setpointTemperatureHeat);
236 static void setHvacSetpointTemperatureCool(
THVACValue *hvacValue,
237 int16_t setpointTemperatureCool);
241 static bool isHvacValueValid(
const THVACValue *hvacValue);
243 virtual bool isExtended()
const;
244 bool isUpdateReady()
const;
245 int getChannelNumber()
const;
246 uint32_t getChannelType()
const;
248 void setType(uint32_t type);
252 void setDefault(uint32_t value);
261 uint32_t getDefaultFunction()
const;
262 bool isFunctionValid(uint32_t function)
const;
263 void setFlag(uint64_t flag);
264 void unsetFlag(uint64_t flag);
265 uint64_t getFlags()
const;
266 void setFuncList(uint32_t functions);
267 uint32_t getFuncList()
const;
268 void addToFuncList(uint32_t function);
269 void removeFromFuncList(uint32_t function);
270 void setActionTriggerCaps(uint32_t caps);
271 uint32_t getActionTriggerCaps();
273 void setValidityTimeSec(uint32_t timeSec);
275 virtual void sendUpdate();
279 virtual bool getExtValueAsElectricityMeter(
281 void setCorrection(
double correction,
bool forSecondaryValue =
false);
282 bool isSleepingEnabled();
283 bool isWeeklyScheduleAvailable();
286 bool isBatteryPoweredFieldEnabled()
const;
287 bool isBatteryPowered()
const;
289 void setBatteryPowered(
bool);
306 void setBridgeSignalStrength(
unsigned char level);
307 uint8_t getBridgeSignalStrength()
const;
308 bool isBridgeSignalStrengthAvailable()
const;
310 void setInitialCaption(
const char *caption);
311 bool isInitialCaptionSet()
const;
312 const char* getInitialCaption()
const;
336 void fillRawValue(
void *value);
337 int8_t *getValuePtr();
339 void setSubDeviceId(uint8_t subDeviceId);
340 uint8_t getSubDeviceId()
const;
342 bool isRollerShutterRelayType()
const;
343 void setRelayOvercurrentCutOff(
bool value);
344 bool isRelayOvercurrentCutOff()
const;
347 void setSendGetConfig();
349 bool isChannelStateEnabled()
const;
350 void clearSendValue();
354 bool isValueUpdateReady()
const;
356 void clearSendGetConfig();
357 bool isGetConfigRequested()
const;
359 void setSendInitialCaption();
360 void clearSendInitialCaption();
361 bool isInitialCaptionUpdateReady()
const;
363 void setSendStateInfo();
364 void clearSendStateInfo();
365 bool isStateInfoUpdateReady()
const;
368 static int startingChannelNumber;
371 char *initialCaption =
nullptr;
373 uint32_t functionsBitmap = 0;
375 uint64_t channelFlags = 0;
376 uint32_t validityTimeSec = 0;
378 int16_t channelNumber = -1;
380 uint16_t defaultFunction =
384 uint8_t changedFields = 0;
386 uint8_t batteryLevel = 255;
387 uint8_t batteryPowered = 0;
388 unsigned char bridgeSignalStrength = 255;
391 ChannelType channelType = ChannelType::NOT_SET;
394 uint8_t defaultIcon = 0;
395 uint8_t subDeviceId = 0;
398 int8_t value[SUPLA_CHANNELVALUE_SIZE] = {};