28 explicit Channel(
int number = -1);
30 static void setStartingChannelNumber(
int channelNumber);
31 static int getStartingChannelNumber();
34 static Channel *GetByChannelNumber(
int channelNumber);
38 static void resetToDefaults();
43 bool setChannelNumber(
int newChannelNumber);
45 void setNewValue(
double dbl);
46 void setNewValue(
double temp,
double humi);
47 void setNewValue(int32_t value);
48 void setNewValue(
bool value);
50 void setNewValue(uint8_t red,
53 uint8_t colorBrightness,
54 uint8_t whiteBrightness,
55 uint8_t whiteTemperature);
56 void setNewValue(uint64_t value);
59 bool setNewValue(
const char *newValue);
61 void setStateOffline();
62 void setStateOnline();
63 void setStateOnlineAndNotAvailable();
64 void setStateFirmwareUpdateOngoing();
65 void setStateOfflineRemoteWakeupNotSupported();
66 bool isStateOnline()
const;
67 bool isStateOnlineAndNotAvailable()
const;
68 bool isStateOfflineRemoteWakeupNotSupported()
const;
69 bool isStateFirmwareUpdateOngoing()
const;
73 void setContainerFillValue(int8_t fillLevel);
74 void setContainerAlarm(
bool active);
75 void setContainerWarning(
bool active);
76 void setContainerInvalidSensorState(
bool invalid);
77 void setContainerSoundAlarmOn(
bool soundAlarmOn);
80 int8_t getContainerFillValue()
const;
81 bool isContainerAlarmActive()
const;
82 bool isContainerWarningActive()
const;
83 bool isContainerInvalidSensorStateActive()
const;
84 bool isContainerSoundAlarmOn()
const;
153 double getValueDouble();
154 double getValueDoubleFirst();
155 double getValueDoubleSecond();
156 int32_t getValueInt32();
157 uint64_t getValueInt64();
158 virtual bool getValueBool();
159 uint8_t getValueRed()
const;
160 uint8_t getValueGreen()
const;
161 uint8_t getValueBlue()
const;
162 uint8_t getValueColorBrightness()
const;
163 uint8_t getValueBrightness()
const;
164 uint8_t getValueWhiteTemperature()
const;
165 double getLastTemperature();
166 uint8_t getValueClosingPercentage()
const;
167 uint8_t getValueTilt()
const;
168 bool getValueIsCalibrating()
const;
170 void setHvacIsOn(
bool isOn);
171 void setHvacIsOnPercent(uint8_t percent);
172 void setHvacMode(uint8_t mode);
173 void setHvacSetpointTemperatureHeat(int16_t setpointTemperatureHeat);
174 void setHvacSetpointTemperatureCool(int16_t setpointTemperatureCool);
175 void clearHvacSetpointTemperatureHeat();
176 void clearHvacSetpointTemperatureCool();
177 void setHvacFlags(uint16_t alarmsAndFlags);
178 void setHvacFlagSetpointTemperatureHeatSet(
bool value);
179 void setHvacFlagSetpointTemperatureCoolSet(
bool value);
180 void setHvacFlagHeating(
bool value);
181 void setHvacFlagCooling(
bool value);
182 void setHvacFlagWeeklySchedule(
bool value);
183 void setHvacFlagFanEnabled(
bool value);
184 void setHvacFlagThermometerError(
bool value);
185 void setHvacFlagClockError(
bool value);
186 void setHvacFlagCountdownTimer(
bool value);
187 void setHvacFlagForcedOffBySensor(
bool value);
188 void setHvacFlagCoolSubfunction(
enum HvacCoolSubfunctionFlag flag);
189 void setHvacFlagWeeklyScheduleTemporalOverride(
bool value);
190 void setHvacFlagBatteryCoverOpen(
bool value);
191 void setHvacFlagCalibrationError(
bool value);
192 void setHvacFlagAntifreezeOverheatActive(
bool value);
193 void clearHvacState();
195 uint8_t getHvacIsOnRaw()
const;
196 bool getHvacIsOnBool()
const;
197 uint8_t getHvacIsOnPercent()
const;
199 uint8_t getHvacMode()
const;
202 const char *getHvacModeCstr(
int mode = -1)
const;
203 int16_t getHvacSetpointTemperatureHeat()
const;
204 int16_t getHvacSetpointTemperatureCool()
const;
205 uint16_t getHvacFlags()
const;
206 bool isHvacFlagSetpointTemperatureHeatSet()
const;
207 bool isHvacFlagSetpointTemperatureCoolSet()
const;
208 bool isHvacFlagHeating()
const;
209 bool isHvacFlagCooling()
const;
210 bool isHvacFlagWeeklySchedule()
const;
211 bool isHvacFlagFanEnabled()
const;
212 bool isHvacFlagThermometerError()
const;
213 bool isHvacFlagClockError()
const;
214 bool isHvacFlagCountdownTimer()
const;
215 bool isHvacFlagForcedOffBySensor()
const;
216 enum HvacCoolSubfunctionFlag getHvacFlagCoolSubfunction()
const;
217 bool isHvacFlagWeeklyScheduleTemporalOverride()
const;
218 bool isHvacFlagBatteryCoverOpen()
const;
219 bool isHvacFlagCalibrationError()
const;
220 bool isHvacFlagAntifreezeOverheatActive()
const;
222 static bool isHvacFlagSetpointTemperatureHeatSet(
const THVACValue *hvacValue);
223 static bool isHvacFlagSetpointTemperatureCoolSet(
const THVACValue *hvacValue);
224 static bool isHvacFlagHeating(
const THVACValue *hvacValue);
225 static bool isHvacFlagCooling(
const THVACValue *hvacValue);
226 static bool isHvacFlagWeeklySchedule(
const THVACValue *hvacValue);
227 static bool isHvacFlagFanEnabled(
const THVACValue *hvacValue);
228 static bool isHvacFlagThermometerError(
const THVACValue *hvacValue);
229 static bool isHvacFlagClockError(
const THVACValue *hvacValue);
230 static bool isHvacFlagCountdownTimer(
const THVACValue *hvacValue);
231 static bool isHvacFlagForcedOffBySensor(
const THVACValue *hvacValue);
232 static enum HvacCoolSubfunctionFlag getHvacFlagCoolSubfunction(
234 static bool isHvacFlagWeeklyScheduleTemporalOverride(
236 static bool isHvacFlagBatteryCoverOpen(
const THVACValue *hvacValue);
237 static bool isHvacFlagCalibrationError(
const THVACValue *hvacValue);
238 static bool isHvacFlagAntifreezeOverheatActive(
const THVACValue *hvacValue);
240 static void setHvacSetpointTemperatureHeat(
THVACValue *hvacValue,
241 int16_t setpointTemperatureHeat);
242 static void setHvacSetpointTemperatureCool(
THVACValue *hvacValue,
243 int16_t setpointTemperatureCool);
247 static bool isHvacValueValid(
const THVACValue *hvacValue);
249 virtual bool isExtended()
const;
250 bool isUpdateReady()
const;
251 int getChannelNumber()
const;
252 virtual uint32_t getChannelType()
const;
254 void setType(uint32_t type);
258 void setDefault(uint32_t value);
267 uint32_t getDefaultFunction()
const;
268 bool isFunctionValid(uint32_t function)
const;
269 void setFlag(uint64_t flag);
270 void unsetFlag(uint64_t flag);
271 uint64_t getFlags()
const;
272 void setFuncList(uint32_t functions);
273 uint32_t getFuncList()
const;
274 void addToFuncList(uint32_t function);
275 void removeFromFuncList(uint32_t function);
276 void setActionTriggerCaps(uint32_t caps);
277 uint32_t getActionTriggerCaps();
279 void setValidityTimeSec(uint32_t timeSec);
281 virtual void sendUpdate();
285 virtual bool getExtValueAsElectricityMeter(
287 void setCorrection(
double correction,
bool forSecondaryValue =
false);
288 bool isSleepingEnabled()
const;
289 uint32_t getValidityTimeSec()
const;
290 bool isWeeklyScheduleAvailable();
293 bool isBatteryPoweredFieldEnabled()
const;
294 bool isBatteryPowered()
const;
296 void setBatteryPowered(
bool);
312 BatteryState getBatteryState()
const;
313 void setBatteryState(BatteryState state,
314 bool applyToWholeDevice =
false);
315 bool isBatteryStateAppliedToWholeDevice()
const;
318 void setBridgeSignalStrength(
unsigned char level);
319 uint8_t getBridgeSignalStrength()
const;
320 bool isBridgeSignalStrengthAvailable()
const;
322 void setInitialCaption(
const char *caption);
323 bool isInitialCaptionSet()
const;
324 const char* getInitialCaption()
const;
348 void fillRawValue(
void *value);
349 int8_t *getValuePtr();
351 void setSubDeviceId(uint8_t subDeviceId);
352 uint8_t getSubDeviceId()
const;
354 bool isRollerShutterRelayType()
const;
355 void setRelayOvercurrentCutOff(
bool value);
356 bool isRelayOvercurrentCutOff()
const;
357 void setRelayMode(uint8_t mode);
358 uint8_t getRelayMode()
const;
359 void setRelayWeeklyScheduleEnabled(
bool enabled);
360 bool isRelayWeeklyScheduleEnabled()
const;
363 void setSendGetConfig();
365 bool isChannelStateEnabled()
const;
366 void clearSendValue();
370 bool isValueUpdateReady()
const;
372 void clearSendGetConfig();
373 bool isGetConfigRequested()
const;
375 void setSendInitialCaption();
376 void clearSendInitialCaption();
377 bool isInitialCaptionUpdateReady()
const;
379 void setSendStateInfo();
380 void clearSendStateInfo();
381 bool isStateInfoUpdateReady()
const;
384 static int startingChannelNumber;
387 char *initialCaption =
nullptr;
389 uint32_t functionsBitmap = 0;
391 uint64_t channelFlags = 0;
392 uint32_t validityTimeSec = 0;
394 int16_t channelNumber = -1;
396 uint16_t defaultFunction =
400 uint8_t changedFields = 0;
402 uint8_t batteryLevel = 255;
403 uint8_t batteryPowered = 0;
404 BatteryState batteryState = BatteryState::NotSet;
405 bool batteryStateAppliedToWholeDevice =
false;
406 unsigned char bridgeSignalStrength = 255;
409 ChannelType channelType = ChannelType::NOT_SET;
412 uint8_t defaultIcon = 0;
413 uint8_t subDeviceId = 0;
416 int8_t value[SUPLA_CHANNELVALUE_SIZE] = {};