33class Channel :
public LocalAction {
35 explicit Channel(
int number = -1);
37 static void setStartingChannelNumber(
int channelNumber);
38 static int getStartingChannelNumber();
39 static Channel *Begin();
40 static Channel *Last();
41 static Channel *GetByChannelNumber(
int channelNumber);
45 static void resetToDefaults();
50 bool setChannelNumber(
int newChannelNumber);
52 void setNewValue(
double dbl);
53 void setNewValue(
double temp,
double humi);
54 void setNewValue(int32_t value);
55 void setNewValue(
bool value);
57 void setNewValue(uint8_t red,
60 uint8_t colorBrightness,
61 uint8_t whiteBrightness,
62 uint8_t whiteTemperature);
63 void setNewValue(uint64_t value);
66 bool setNewValue(
const char *newValue);
68 void setStateOffline();
69 void setStateOnline();
70 void setStateOnlineAndNotAvailable();
71 void setStateFirmwareUpdateOngoing();
72 void setStateOfflineRemoteWakeupNotSupported();
73 bool isStateOnline()
const;
74 bool isStateOnlineAndNotAvailable()
const;
75 bool isStateOfflineRemoteWakeupNotSupported()
const;
76 bool isStateFirmwareUpdateOngoing()
const;
80 void setContainerFillValue(int8_t fillLevel);
81 void setContainerAlarm(
bool active);
82 void setContainerWarning(
bool active);
83 void setContainerInvalidSensorState(
bool invalid);
84 void setContainerSoundAlarmOn(
bool soundAlarmOn);
87 int8_t getContainerFillValue()
const;
88 bool isContainerAlarmActive()
const;
89 bool isContainerWarningActive()
const;
90 bool isContainerInvalidSensorStateActive()
const;
91 bool isContainerSoundAlarmOn()
const;
160 double getValueDouble();
161 double getValueDoubleFirst();
162 double getValueDoubleSecond();
163 int32_t getValueInt32();
164 uint64_t getValueInt64();
165 virtual bool getValueBool();
166 uint8_t getValueRed()
const;
167 uint8_t getValueGreen()
const;
168 uint8_t getValueBlue()
const;
169 uint8_t getValueColorBrightness()
const;
170 uint8_t getValueBrightness()
const;
171 uint8_t getValueWhiteTemperature()
const;
172 double getLastTemperature();
173 uint8_t getValueClosingPercentage()
const;
174 uint8_t getValueTilt()
const;
175 bool getValueIsCalibrating()
const;
177 void setHvacIsOn(
bool isOn);
178 void setHvacIsOnPercent(uint8_t percent);
179 void setHvacMode(uint8_t mode);
180 void setHvacSetpointTemperatureHeat(int16_t setpointTemperatureHeat);
181 void setHvacSetpointTemperatureCool(int16_t setpointTemperatureCool);
182 void clearHvacSetpointTemperatureHeat();
183 void clearHvacSetpointTemperatureCool();
184 void setHvacFlags(uint16_t alarmsAndFlags);
185 void setHvacFlagSetpointTemperatureHeatSet(
bool value);
186 void setHvacFlagSetpointTemperatureCoolSet(
bool value);
187 void setHvacFlagHeating(
bool value);
188 void setHvacFlagCooling(
bool value);
189 void setHvacFlagWeeklySchedule(
bool value);
190 void setHvacFlagFanEnabled(
bool value);
191 void setHvacFlagThermometerError(
bool value);
192 void setHvacFlagClockError(
bool value);
193 void setHvacFlagCountdownTimer(
bool value);
194 void setHvacFlagForcedOffBySensor(
bool value);
195 void setHvacFlagCoolSubfunction(
enum HvacCoolSubfunctionFlag flag);
196 void setHvacFlagWeeklyScheduleTemporalOverride(
bool value);
197 void setHvacFlagBatteryCoverOpen(
bool value);
198 void setHvacFlagCalibrationError(
bool value);
199 void setHvacFlagAntifreezeOverheatActive(
bool value);
200 void clearHvacState();
202 uint8_t getHvacIsOnRaw()
const;
203 bool getHvacIsOnBool()
const;
204 uint8_t getHvacIsOnPercent()
const;
206 uint8_t getHvacMode()
const;
209 const char *getHvacModeCstr(
int mode = -1)
const;
210 int16_t getHvacSetpointTemperatureHeat()
const;
211 int16_t getHvacSetpointTemperatureCool()
const;
212 uint16_t getHvacFlags()
const;
213 bool isHvacFlagSetpointTemperatureHeatSet()
const;
214 bool isHvacFlagSetpointTemperatureCoolSet()
const;
215 bool isHvacFlagHeating()
const;
216 bool isHvacFlagCooling()
const;
217 bool isHvacFlagWeeklySchedule()
const;
218 bool isHvacFlagFanEnabled()
const;
219 bool isHvacFlagThermometerError()
const;
220 bool isHvacFlagClockError()
const;
221 bool isHvacFlagCountdownTimer()
const;
222 bool isHvacFlagForcedOffBySensor()
const;
223 enum HvacCoolSubfunctionFlag getHvacFlagCoolSubfunction()
const;
224 bool isHvacFlagWeeklyScheduleTemporalOverride()
const;
225 bool isHvacFlagBatteryCoverOpen()
const;
226 bool isHvacFlagCalibrationError()
const;
227 bool isHvacFlagAntifreezeOverheatActive()
const;
229 static bool isHvacFlagSetpointTemperatureHeatSet(
const THVACValue *hvacValue);
230 static bool isHvacFlagSetpointTemperatureCoolSet(
const THVACValue *hvacValue);
231 static bool isHvacFlagHeating(
const THVACValue *hvacValue);
232 static bool isHvacFlagCooling(
const THVACValue *hvacValue);
233 static bool isHvacFlagWeeklySchedule(
const THVACValue *hvacValue);
234 static bool isHvacFlagFanEnabled(
const THVACValue *hvacValue);
235 static bool isHvacFlagThermometerError(
const THVACValue *hvacValue);
236 static bool isHvacFlagClockError(
const THVACValue *hvacValue);
237 static bool isHvacFlagCountdownTimer(
const THVACValue *hvacValue);
238 static bool isHvacFlagForcedOffBySensor(
const THVACValue *hvacValue);
239 static enum HvacCoolSubfunctionFlag getHvacFlagCoolSubfunction(
241 static bool isHvacFlagWeeklyScheduleTemporalOverride(
243 static bool isHvacFlagBatteryCoverOpen(
const THVACValue *hvacValue);
244 static bool isHvacFlagCalibrationError(
const THVACValue *hvacValue);
245 static bool isHvacFlagAntifreezeOverheatActive(
const THVACValue *hvacValue);
247 static void setHvacSetpointTemperatureHeat(
THVACValue *hvacValue,
248 int16_t setpointTemperatureHeat);
249 static void setHvacSetpointTemperatureCool(
THVACValue *hvacValue,
250 int16_t setpointTemperatureCool);
254 static bool isHvacValueValid(
const THVACValue *hvacValue);
256 virtual bool isExtended()
const;
257 bool isUpdateReady()
const;
258 int getChannelNumber()
const;
259 uint32_t getChannelType()
const;
261 void setType(uint32_t type);
265 void setDefault(uint32_t value);
274 uint32_t getDefaultFunction()
const;
275 bool isFunctionValid(uint32_t function)
const;
276 void setFlag(uint64_t flag);
277 void unsetFlag(uint64_t flag);
278 uint64_t getFlags()
const;
279 void setFuncList(uint32_t functions);
280 uint32_t getFuncList()
const;
281 void addToFuncList(uint32_t function);
282 void removeFromFuncList(uint32_t function);
283 void setActionTriggerCaps(uint32_t caps);
284 uint32_t getActionTriggerCaps();
286 void setValidityTimeSec(uint32_t timeSec);
287 virtual void sendUpdate();
291 virtual bool getExtValueAsElectricityMeter(
293 void setCorrection(
double correction,
bool forSecondaryValue =
false);
294 bool isSleepingEnabled();
295 bool isWeeklyScheduleAvailable();
298 bool isBatteryPoweredFieldEnabled()
const;
299 bool isBatteryPowered()
const;
301 void setBatteryPowered(
bool);
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;
359 void setSendGetConfig();
361 bool isChannelStateEnabled()
const;
362 void clearSendValue();
366 bool isValueUpdateReady()
const;
368 void clearSendGetConfig();
369 bool isGetConfigRequested()
const;
371 void setSendInitialCaption();
372 void clearSendInitialCaption();
373 bool isInitialCaptionUpdateReady()
const;
375 void setSendStateInfo();
376 void clearSendStateInfo();
377 bool isStateInfoUpdateReady()
const;
379 static Channel *firstPtr;
380 static int startingChannelNumber;
381 Channel *nextPtr =
nullptr;
383 char *initialCaption =
nullptr;
385 uint32_t functionsBitmap = 0;
387 uint64_t channelFlags = 0;
388 uint32_t validityTimeSec = 0;
390 int16_t channelNumber = -1;
392 uint16_t defaultFunction =
396 uint8_t changedFields = 0;
398 uint8_t batteryLevel = 255;
399 uint8_t batteryPowered = 0;
400 unsigned char bridgeSignalStrength = 255;
403 ChannelType channelType = ChannelType::NOT_SET;
406 uint8_t defaultIcon = 0;
407 uint8_t subDeviceId = 0;
410 int8_t value[SUPLA_CHANNELVALUE_SIZE] = {};