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,
60 void setNewValue(uint64_t value);
63 bool setNewValue(
const char *newValue);
65 void setStateOffline();
66 void setStateOnline();
67 void setStateOnlineAndNotAvailable();
68 void setStateFirmwareUpdateOngoing();
69 void setStateOfflineRemoteWakeupNotSupported();
70 bool isStateOnline()
const;
71 bool isStateOnlineAndNotAvailable()
const;
72 bool isStateOfflineRemoteWakeupNotSupported()
const;
73 bool isStateFirmwareUpdateOngoing()
const;
77 void setContainerFillValue(int8_t fillLevel);
78 void setContainerAlarm(
bool active);
79 void setContainerWarning(
bool active);
80 void setContainerInvalidSensorState(
bool invalid);
81 void setContainerSoundAlarmOn(
bool soundAlarmOn);
84 int8_t getContainerFillValue()
const;
85 bool isContainerAlarmActive()
const;
86 bool isContainerWarningActive()
const;
87 bool isContainerInvalidSensorStateActive()
const;
88 bool isContainerSoundAlarmOn()
const;
157 double getValueDouble();
158 double getValueDoubleFirst();
159 double getValueDoubleSecond();
160 int32_t getValueInt32();
161 uint64_t getValueInt64();
162 virtual bool getValueBool();
163 uint8_t getValueRed();
164 uint8_t getValueGreen();
165 uint8_t getValueBlue();
166 uint8_t getValueColorBrightness();
167 uint8_t getValueBrightness();
168 double getLastTemperature();
169 uint8_t getValueClosingPercentage()
const;
170 uint8_t getValueTilt()
const;
171 bool getValueIsCalibrating()
const;
173 void setHvacIsOn(
bool isOn);
174 void setHvacIsOnPercent(uint8_t percent);
175 void setHvacMode(uint8_t mode);
176 void setHvacSetpointTemperatureHeat(int16_t setpointTemperatureHeat);
177 void setHvacSetpointTemperatureCool(int16_t setpointTemperatureCool);
178 void clearHvacSetpointTemperatureHeat();
179 void clearHvacSetpointTemperatureCool();
180 void setHvacFlags(uint16_t alarmsAndFlags);
181 void setHvacFlagSetpointTemperatureHeatSet(
bool value);
182 void setHvacFlagSetpointTemperatureCoolSet(
bool value);
183 void setHvacFlagHeating(
bool value);
184 void setHvacFlagCooling(
bool value);
185 void setHvacFlagWeeklySchedule(
bool value);
186 void setHvacFlagFanEnabled(
bool value);
187 void setHvacFlagThermometerError(
bool value);
188 void setHvacFlagClockError(
bool value);
189 void setHvacFlagCountdownTimer(
bool value);
190 void setHvacFlagForcedOffBySensor(
bool value);
191 void setHvacFlagCoolSubfunction(
enum HvacCoolSubfunctionFlag flag);
192 void setHvacFlagWeeklyScheduleTemporalOverride(
bool value);
193 void setHvacFlagBatteryCoverOpen(
bool value);
194 void setHvacFlagCalibrationError(
bool value);
195 void setHvacFlagAntifreezeOverheatActive(
bool value);
196 void clearHvacState();
198 uint8_t getHvacIsOnRaw()
const;
199 bool getHvacIsOnBool()
const;
200 uint8_t getHvacIsOnPercent()
const;
202 uint8_t getHvacMode()
const;
205 const char *getHvacModeCstr(
int mode = -1)
const;
206 int16_t getHvacSetpointTemperatureHeat()
const;
207 int16_t getHvacSetpointTemperatureCool()
const;
208 uint16_t getHvacFlags()
const;
209 bool isHvacFlagSetpointTemperatureHeatSet()
const;
210 bool isHvacFlagSetpointTemperatureCoolSet()
const;
211 bool isHvacFlagHeating()
const;
212 bool isHvacFlagCooling()
const;
213 bool isHvacFlagWeeklySchedule()
const;
214 bool isHvacFlagFanEnabled()
const;
215 bool isHvacFlagThermometerError()
const;
216 bool isHvacFlagClockError()
const;
217 bool isHvacFlagCountdownTimer()
const;
218 bool isHvacFlagForcedOffBySensor()
const;
219 enum HvacCoolSubfunctionFlag getHvacFlagCoolSubfunction()
const;
220 bool isHvacFlagWeeklyScheduleTemporalOverride()
const;
221 bool isHvacFlagBatteryCoverOpen()
const;
222 bool isHvacFlagCalibrationError()
const;
223 bool isHvacFlagAntifreezeOverheatActive()
const;
225 static bool isHvacFlagSetpointTemperatureHeatSet(
const THVACValue *hvacValue);
226 static bool isHvacFlagSetpointTemperatureCoolSet(
const THVACValue *hvacValue);
227 static bool isHvacFlagHeating(
const THVACValue *hvacValue);
228 static bool isHvacFlagCooling(
const THVACValue *hvacValue);
229 static bool isHvacFlagWeeklySchedule(
const THVACValue *hvacValue);
230 static bool isHvacFlagFanEnabled(
const THVACValue *hvacValue);
231 static bool isHvacFlagThermometerError(
const THVACValue *hvacValue);
232 static bool isHvacFlagClockError(
const THVACValue *hvacValue);
233 static bool isHvacFlagCountdownTimer(
const THVACValue *hvacValue);
234 static bool isHvacFlagForcedOffBySensor(
const THVACValue *hvacValue);
235 static enum HvacCoolSubfunctionFlag getHvacFlagCoolSubfunction(
237 static bool isHvacFlagWeeklyScheduleTemporalOverride(
239 static bool isHvacFlagBatteryCoverOpen(
const THVACValue *hvacValue);
240 static bool isHvacFlagCalibrationError(
const THVACValue *hvacValue);
241 static bool isHvacFlagAntifreezeOverheatActive(
const THVACValue *hvacValue);
243 static void setHvacSetpointTemperatureHeat(
THVACValue *hvacValue,
244 int16_t setpointTemperatureHeat);
245 static void setHvacSetpointTemperatureCool(
THVACValue *hvacValue,
246 int16_t setpointTemperatureCool);
250 static bool isHvacValueValid(
const THVACValue *hvacValue);
252 virtual bool isExtended()
const;
253 bool isUpdateReady()
const;
254 int getChannelNumber()
const;
255 uint32_t getChannelType()
const;
257 void setType(uint32_t type);
261 void setDefault(uint32_t value);
270 uint32_t getDefaultFunction()
const;
271 bool isFunctionValid(uint32_t function)
const;
272 void setFlag(uint64_t flag);
273 void unsetFlag(uint64_t flag);
274 uint64_t getFlags()
const;
275 void setFuncList(uint32_t functions);
276 uint32_t getFuncList()
const;
277 void addToFuncList(uint32_t function);
278 void removeFromFuncList(uint32_t function);
279 void setActionTriggerCaps(uint32_t caps);
280 uint32_t getActionTriggerCaps();
282 void setValidityTimeSec(uint32_t timeSec);
283 virtual void sendUpdate();
287 virtual bool getExtValueAsElectricityMeter(
289 void setCorrection(
double correction,
bool forSecondaryValue =
false);
290 bool isSleepingEnabled();
291 bool isWeeklyScheduleAvailable();
294 bool isBatteryPoweredFieldEnabled()
const;
295 bool isBatteryPowered()
const;
297 void setBatteryPowered(
bool);
314 void setBridgeSignalStrength(
unsigned char level);
315 uint8_t getBridgeSignalStrength()
const;
316 bool isBridgeSignalStrengthAvailable()
const;
318 void setInitialCaption(
const char *caption);
319 bool isInitialCaptionSet()
const;
320 const char* getInitialCaption()
const;
344 void fillRawValue(
void *value);
345 int8_t *getValuePtr();
347 void setSubDeviceId(uint8_t subDeviceId);
348 uint8_t getSubDeviceId()
const;
350 bool isRollerShutterRelayType()
const;
351 void setRelayOvercurrentCutOff(
bool value);
352 bool isRelayOvercurrentCutOff()
const;
355 void setSendGetConfig();
357 bool isChannelStateEnabled()
const;
358 void clearSendValue();
362 bool isValueUpdateReady()
const;
364 void clearSendGetConfig();
365 bool isGetConfigRequested()
const;
367 void setSendInitialCaption();
368 void clearSendInitialCaption();
369 bool isInitialCaptionUpdateReady()
const;
371 void setSendStateInfo();
372 void clearSendStateInfo();
373 bool isStateInfoUpdateReady()
const;
375 static Channel *firstPtr;
376 Channel *nextPtr =
nullptr;
378 char *initialCaption =
nullptr;
380 uint32_t functionsBitmap = 0;
382 uint64_t channelFlags = 0;
383 uint32_t validityTimeSec = 0;
385 int16_t channelNumber = -1;
387 uint16_t defaultFunction =
391 uint8_t changedFields = 0;
393 uint8_t batteryLevel = 255;
394 uint8_t batteryPowered = 0;
395 unsigned char bridgeSignalStrength = 255;
398 ChannelType channelType = ChannelType::NOT_SET;
401 uint8_t defaultIcon = 0;
402 uint8_t subDeviceId = 0;
405 int8_t value[SUPLA_CHANNELVALUE_SIZE] = {};