33class Channel :
public LocalAction {
35 explicit Channel(
int number = -1);
37 static Channel *Begin();
38 static Channel *Last();
39 static Channel *GetByChannelNumber(
int channelNumber);
43 static void resetToDefaults();
48 bool setChannelNumber(
int newChannelNumber);
50 void setNewValue(
double dbl);
51 void setNewValue(
double temp,
double humi);
52 void setNewValue(int32_t value);
53 void setNewValue(
bool value);
55 void setNewValue(uint8_t red,
58 uint8_t colorBrightness,
59 uint8_t whiteBrightness,
60 uint8_t whiteTemperature);
61 void setNewValue(uint64_t value);
64 bool setNewValue(
const char *newValue);
66 void setStateOffline();
67 void setStateOnline();
68 void setStateOnlineAndNotAvailable();
69 void setStateFirmwareUpdateOngoing();
70 void setStateOfflineRemoteWakeupNotSupported();
71 bool isStateOnline()
const;
72 bool isStateOnlineAndNotAvailable()
const;
73 bool isStateOfflineRemoteWakeupNotSupported()
const;
74 bool isStateFirmwareUpdateOngoing()
const;
78 void setContainerFillValue(int8_t fillLevel);
79 void setContainerAlarm(
bool active);
80 void setContainerWarning(
bool active);
81 void setContainerInvalidSensorState(
bool invalid);
82 void setContainerSoundAlarmOn(
bool soundAlarmOn);
85 int8_t getContainerFillValue()
const;
86 bool isContainerAlarmActive()
const;
87 bool isContainerWarningActive()
const;
88 bool isContainerInvalidSensorStateActive()
const;
89 bool isContainerSoundAlarmOn()
const;
158 double getValueDouble();
159 double getValueDoubleFirst();
160 double getValueDoubleSecond();
161 int32_t getValueInt32();
162 uint64_t getValueInt64();
163 virtual bool getValueBool();
164 uint8_t getValueRed()
const;
165 uint8_t getValueGreen()
const;
166 uint8_t getValueBlue()
const;
167 uint8_t getValueColorBrightness()
const;
168 uint8_t getValueBrightness()
const;
169 uint8_t getValueWhiteTemperature()
const;
170 double getLastTemperature();
171 uint8_t getValueClosingPercentage()
const;
172 uint8_t getValueTilt()
const;
173 bool getValueIsCalibrating()
const;
175 void setHvacIsOn(
bool isOn);
176 void setHvacIsOnPercent(uint8_t percent);
177 void setHvacMode(uint8_t mode);
178 void setHvacSetpointTemperatureHeat(int16_t setpointTemperatureHeat);
179 void setHvacSetpointTemperatureCool(int16_t setpointTemperatureCool);
180 void clearHvacSetpointTemperatureHeat();
181 void clearHvacSetpointTemperatureCool();
182 void setHvacFlags(uint16_t alarmsAndFlags);
183 void setHvacFlagSetpointTemperatureHeatSet(
bool value);
184 void setHvacFlagSetpointTemperatureCoolSet(
bool value);
185 void setHvacFlagHeating(
bool value);
186 void setHvacFlagCooling(
bool value);
187 void setHvacFlagWeeklySchedule(
bool value);
188 void setHvacFlagFanEnabled(
bool value);
189 void setHvacFlagThermometerError(
bool value);
190 void setHvacFlagClockError(
bool value);
191 void setHvacFlagCountdownTimer(
bool value);
192 void setHvacFlagForcedOffBySensor(
bool value);
193 void setHvacFlagCoolSubfunction(
enum HvacCoolSubfunctionFlag flag);
194 void setHvacFlagWeeklyScheduleTemporalOverride(
bool value);
195 void setHvacFlagBatteryCoverOpen(
bool value);
196 void setHvacFlagCalibrationError(
bool value);
197 void setHvacFlagAntifreezeOverheatActive(
bool value);
198 void clearHvacState();
200 uint8_t getHvacIsOnRaw()
const;
201 bool getHvacIsOnBool()
const;
202 uint8_t getHvacIsOnPercent()
const;
204 uint8_t getHvacMode()
const;
207 const char *getHvacModeCstr(
int mode = -1)
const;
208 int16_t getHvacSetpointTemperatureHeat()
const;
209 int16_t getHvacSetpointTemperatureCool()
const;
210 uint16_t getHvacFlags()
const;
211 bool isHvacFlagSetpointTemperatureHeatSet()
const;
212 bool isHvacFlagSetpointTemperatureCoolSet()
const;
213 bool isHvacFlagHeating()
const;
214 bool isHvacFlagCooling()
const;
215 bool isHvacFlagWeeklySchedule()
const;
216 bool isHvacFlagFanEnabled()
const;
217 bool isHvacFlagThermometerError()
const;
218 bool isHvacFlagClockError()
const;
219 bool isHvacFlagCountdownTimer()
const;
220 bool isHvacFlagForcedOffBySensor()
const;
221 enum HvacCoolSubfunctionFlag getHvacFlagCoolSubfunction()
const;
222 bool isHvacFlagWeeklyScheduleTemporalOverride()
const;
223 bool isHvacFlagBatteryCoverOpen()
const;
224 bool isHvacFlagCalibrationError()
const;
225 bool isHvacFlagAntifreezeOverheatActive()
const;
227 static bool isHvacFlagSetpointTemperatureHeatSet(
const THVACValue *hvacValue);
228 static bool isHvacFlagSetpointTemperatureCoolSet(
const THVACValue *hvacValue);
229 static bool isHvacFlagHeating(
const THVACValue *hvacValue);
230 static bool isHvacFlagCooling(
const THVACValue *hvacValue);
231 static bool isHvacFlagWeeklySchedule(
const THVACValue *hvacValue);
232 static bool isHvacFlagFanEnabled(
const THVACValue *hvacValue);
233 static bool isHvacFlagThermometerError(
const THVACValue *hvacValue);
234 static bool isHvacFlagClockError(
const THVACValue *hvacValue);
235 static bool isHvacFlagCountdownTimer(
const THVACValue *hvacValue);
236 static bool isHvacFlagForcedOffBySensor(
const THVACValue *hvacValue);
237 static enum HvacCoolSubfunctionFlag getHvacFlagCoolSubfunction(
239 static bool isHvacFlagWeeklyScheduleTemporalOverride(
241 static bool isHvacFlagBatteryCoverOpen(
const THVACValue *hvacValue);
242 static bool isHvacFlagCalibrationError(
const THVACValue *hvacValue);
243 static bool isHvacFlagAntifreezeOverheatActive(
const THVACValue *hvacValue);
245 static void setHvacSetpointTemperatureHeat(
THVACValue *hvacValue,
246 int16_t setpointTemperatureHeat);
247 static void setHvacSetpointTemperatureCool(
THVACValue *hvacValue,
248 int16_t setpointTemperatureCool);
252 static bool isHvacValueValid(
const THVACValue *hvacValue);
254 virtual bool isExtended()
const;
255 bool isUpdateReady()
const;
256 int getChannelNumber()
const;
257 uint32_t getChannelType()
const;
259 void setType(uint32_t type);
263 void setDefault(uint32_t value);
272 uint32_t getDefaultFunction()
const;
273 bool isFunctionValid(uint32_t function)
const;
274 void setFlag(uint64_t flag);
275 void unsetFlag(uint64_t flag);
276 uint64_t getFlags()
const;
277 void setFuncList(uint32_t functions);
278 uint32_t getFuncList()
const;
279 void addToFuncList(uint32_t function);
280 void removeFromFuncList(uint32_t function);
281 void setActionTriggerCaps(uint32_t caps);
282 uint32_t getActionTriggerCaps();
284 void setValidityTimeSec(uint32_t timeSec);
285 virtual void sendUpdate();
289 virtual bool getExtValueAsElectricityMeter(
291 void setCorrection(
double correction,
bool forSecondaryValue =
false);
292 bool isSleepingEnabled();
293 bool isWeeklyScheduleAvailable();
296 bool isBatteryPoweredFieldEnabled()
const;
297 bool isBatteryPowered()
const;
299 void setBatteryPowered(
bool);
316 void setBridgeSignalStrength(
unsigned char level);
317 uint8_t getBridgeSignalStrength()
const;
318 bool isBridgeSignalStrengthAvailable()
const;
320 void setInitialCaption(
const char *caption);
321 bool isInitialCaptionSet()
const;
322 const char* getInitialCaption()
const;
346 void fillRawValue(
void *value);
347 int8_t *getValuePtr();
349 void setSubDeviceId(uint8_t subDeviceId);
350 uint8_t getSubDeviceId()
const;
352 bool isRollerShutterRelayType()
const;
353 void setRelayOvercurrentCutOff(
bool value);
354 bool isRelayOvercurrentCutOff()
const;
357 void setSendGetConfig();
359 bool isChannelStateEnabled()
const;
360 void clearSendValue();
364 bool isValueUpdateReady()
const;
366 void clearSendGetConfig();
367 bool isGetConfigRequested()
const;
369 void setSendInitialCaption();
370 void clearSendInitialCaption();
371 bool isInitialCaptionUpdateReady()
const;
373 void setSendStateInfo();
374 void clearSendStateInfo();
375 bool isStateInfoUpdateReady()
const;
377 static Channel *firstPtr;
378 Channel *nextPtr =
nullptr;
380 char *initialCaption =
nullptr;
382 uint32_t functionsBitmap = 0;
384 uint64_t channelFlags = 0;
385 uint32_t validityTimeSec = 0;
387 int16_t channelNumber = -1;
389 uint16_t defaultFunction =
393 uint8_t changedFields = 0;
395 uint8_t batteryLevel = 255;
396 uint8_t batteryPowered = 0;
397 unsigned char bridgeSignalStrength = 255;
400 ChannelType channelType = ChannelType::NOT_SET;
403 uint8_t defaultIcon = 0;
404 uint8_t subDeviceId = 0;
407 int8_t value[SUPLA_CHANNELVALUE_SIZE] = {};