supla-device
Loading...
Searching...
No Matches
Channel Class Reference
Inheritance diagram for Channel:
Collaboration diagram for Channel:

Public Member Functions

 Channel (int number=-1)
 
Channelnext ()
 
void fillDeviceChannelStruct (TDS_SuplaDeviceChannel_D *deviceChannelStruct)
 
void fillDeviceChannelStruct (TDS_SuplaDeviceChannel_E *deviceChannelStruct)
 
bool setChannelNumber (int newChannelNumber)
 
void setNewValue (double dbl)
 
void setNewValue (double temp, double humi)
 
void setNewValue (int32_t value)
 
void setNewValue (bool value)
 
void setNewValue (const TElectricityMeter_ExtendedValue_V3 &emValue)
 
void setNewValue (uint8_t red, uint8_t green, uint8_t blue, uint8_t colorBrightness, uint8_t brightness)
 
void setNewValue (uint64_t value)
 
void setNewValue (const TDSC_RollerShutterValue &value)
 
bool setNewValue (const char *newValue)
 
void setStateOffline ()
 
void setStateOnline ()
 
void setStateOnlineAndNotAvailable ()
 
void setStateFirmwareUpdateOngoing ()
 
void setStateOfflineRemoteWakeupNotSupported ()
 
bool isStateOnline () const
 
bool isStateOnlineAndNotAvailable () const
 
bool isStateOfflineRemoteWakeupNotSupported () const
 
bool isStateFirmwareUpdateOngoing () const
 
void setContainerFillValue (int8_t fillLevel)
 
void setContainerAlarm (bool active)
 
void setContainerWarning (bool active)
 
void setContainerInvalidSensorState (bool invalid)
 
void setContainerSoundAlarmOn (bool soundAlarmOn)
 
int8_t getContainerFillValue () const
 
bool isContainerAlarmActive () const
 
bool isContainerWarningActive () const
 
bool isContainerInvalidSensorStateActive () const
 
bool isContainerSoundAlarmOn () const
 
void setValveOpenState (uint8_t openState)
 Sets the open state (open/close) of the Valve channel.
 
void setValveFloodingFlag (bool active)
 Sets the flooding flag of the Valve channel.
 
void setValveManuallyClosedFlag (bool active)
 Sets the manually closed flag of the Valve channel.
 
void setValveMotorProblemFlag (bool active)
 Sets the motor problem flag of the Valve channel.
 
uint8_t getValveOpenState () const
 Returns the open state (open/close) of the Valve channel.
 
bool isValveOpen () const
 Returns the open state (open/close) of the Valve channel.
 
bool isValveFloodingFlagActive () const
 Returns the flooding flag of the Valve channel.
 
bool isValveManuallyClosedFlagActive () const
 Returns the manually closed flag of the Valve channel.
 
bool isValveMotorProblemFlagActive () const
 Returns the motor problem flag of the Valve channel.
 
double getValueDouble ()
 
double getValueDoubleFirst ()
 
double getValueDoubleSecond ()
 
int32_t getValueInt32 ()
 
uint64_t getValueInt64 ()
 
virtual bool getValueBool ()
 
uint8_t getValueRed ()
 
uint8_t getValueGreen ()
 
uint8_t getValueBlue ()
 
uint8_t getValueColorBrightness ()
 
uint8_t getValueBrightness ()
 
double getLastTemperature ()
 
uint8_t getValueClosingPercentage () const
 
uint8_t getValueTilt () const
 
bool getValueIsCalibrating () const
 
void setHvacIsOn (bool isOn)
 
void setHvacIsOnPercent (uint8_t percent)
 
void setHvacMode (uint8_t mode)
 
void setHvacSetpointTemperatureHeat (int16_t setpointTemperatureHeat)
 
void setHvacSetpointTemperatureCool (int16_t setpointTemperatureCool)
 
void clearHvacSetpointTemperatureHeat ()
 
void clearHvacSetpointTemperatureCool ()
 
void setHvacFlags (uint16_t alarmsAndFlags)
 
void setHvacFlagSetpointTemperatureHeatSet (bool value)
 
void setHvacFlagSetpointTemperatureCoolSet (bool value)
 
void setHvacFlagHeating (bool value)
 
void setHvacFlagCooling (bool value)
 
void setHvacFlagWeeklySchedule (bool value)
 
void setHvacFlagFanEnabled (bool value)
 
void setHvacFlagThermometerError (bool value)
 
void setHvacFlagClockError (bool value)
 
void setHvacFlagCountdownTimer (bool value)
 
void setHvacFlagForcedOffBySensor (bool value)
 
void setHvacFlagCoolSubfunction (enum HvacCoolSubfunctionFlag flag)
 
void setHvacFlagWeeklyScheduleTemporalOverride (bool value)
 
void setHvacFlagBatteryCoverOpen (bool value)
 
void setHvacFlagCalibrationError (bool value)
 
void setHvacFlagAntifreezeOverheatActive (bool value)
 
void clearHvacState ()
 
uint8_t getHvacIsOnRaw () const
 
bool getHvacIsOnBool () const
 
uint8_t getHvacIsOnPercent () const
 
uint8_t getHvacMode () const
 
const char * getHvacModeCstr (int mode=-1) const
 
int16_t getHvacSetpointTemperatureHeat () const
 
int16_t getHvacSetpointTemperatureCool () const
 
uint16_t getHvacFlags () const
 
bool isHvacFlagSetpointTemperatureHeatSet () const
 
bool isHvacFlagSetpointTemperatureCoolSet () const
 
bool isHvacFlagHeating () const
 
bool isHvacFlagCooling () const
 
bool isHvacFlagWeeklySchedule () const
 
bool isHvacFlagFanEnabled () const
 
bool isHvacFlagThermometerError () const
 
bool isHvacFlagClockError () const
 
bool isHvacFlagCountdownTimer () const
 
bool isHvacFlagForcedOffBySensor () const
 
enum HvacCoolSubfunctionFlag getHvacFlagCoolSubfunction () const
 
bool isHvacFlagWeeklyScheduleTemporalOverride () const
 
bool isHvacFlagBatteryCoverOpen () const
 
bool isHvacFlagCalibrationError () const
 
bool isHvacFlagAntifreezeOverheatActive () const
 
THVACValuegetValueHvac ()
 
const THVACValuegetValueHvac () const
 
virtual bool isExtended () const
 
bool isUpdateReady () const
 
int getChannelNumber () const
 
_supla_int_t getChannelType () const
 
void setType (_supla_int_t type)
 
void setDefault (_supla_int_t value)
 
void setDefaultFunction (_supla_int_t function)
 
int32_t getDefaultFunction () const
 
bool isFunctionValid (int32_t function) const
 
void setFlag (uint64_t flag)
 
void unsetFlag (uint64_t flag)
 
uint64_t getFlags () const
 
void setFuncList (_supla_int_t functions)
 
_supla_int_t getFuncList () const
 
void addToFuncList (_supla_int_t function)
 
void removeFromFuncList (_supla_int_t function)
 
void setActionTriggerCaps (_supla_int_t caps)
 
_supla_int_t getActionTriggerCaps ()
 
void setValidityTimeSec (uint32_t timeSec)
 
virtual void sendUpdate ()
 
virtual TSuplaChannelExtendedValuegetExtValue ()
 
virtual bool getExtValueAsElectricityMeter (TElectricityMeter_ExtendedValue_V3 *out)
 
void setCorrection (double correction, bool forSecondaryValue=false)
 
bool isSleepingEnabled ()
 
bool isWeeklyScheduleAvailable ()
 
bool isBatteryPoweredFieldEnabled () const
 
bool isBatteryPowered () const
 
void setBatteryPowered (bool)
 
uint8_t getBatteryLevel () const
 Returns battery level.
 
void setBatteryLevel (int level)
 Sets battery level.
 
void setBridgeSignalStrength (unsigned char level)
 
uint8_t getBridgeSignalStrength () const
 
bool isBridgeSignalStrengthAvailable () const
 
void setInitialCaption (const char *caption)
 
bool isInitialCaptionSet () const
 
const char * getInitialCaption () const
 
void setDefaultIcon (uint8_t iconId)
 
uint8_t getDefaultIcon () const
 
void fillRawValue (void *value)
 
int8_t * getValuePtr ()
 
void setSubDeviceId (uint8_t subDeviceId)
 
uint8_t getSubDeviceId () const
 
bool isRollerShutterRelayType () const
 
void onRegistered ()
 
void setSendGetConfig ()
 
bool isChannelStateEnabled () const
 
void clearSendValue ()
 
- Public Member Functions inherited from Supla::LocalAction
virtual void addAction (uint16_t action, ActionHandler &client, uint16_t event, bool alwaysEnabled=false)
 
virtual void addAction (uint16_t action, ActionHandler *client, uint16_t event, bool alwaysEnabled=false)
 
virtual void runAction (uint16_t event) const
 
virtual bool isEventAlreadyUsed (uint16_t event, bool ignoreAlwaysEnabled)
 
virtual ActionHandlerClientgetHandlerForFirstClient (uint16_t event)
 
virtual ActionHandlerClientgetHandlerForClient (ActionHandler *client, uint16_t event)
 
virtual void disableOtherClients (const ActionHandler &client, uint16_t event)
 
virtual void enableOtherClients (const ActionHandler &client, uint16_t event)
 
virtual void disableOtherClients (const ActionHandler *client, uint16_t event)
 
virtual void enableOtherClients (const ActionHandler *client, uint16_t event)
 
virtual void disableAction (int32_t action, ActionHandler *client, int32_t event)
 
virtual void enableAction (int32_t action, ActionHandler *client, int32_t event)
 
virtual bool disableActionsInConfigMode ()
 

Static Public Member Functions

static ChannelBegin ()
 
static ChannelLast ()
 
static ChannelGetByChannelNumber (int channelNumber)
 
static void setHvacSetpointTemperatureHeat (THVACValue *hvacValue, int16_t setpointTemperatureHeat)
 
static void setHvacSetpointTemperatureCool (THVACValue *hvacValue, int16_t setpointTemperatureCool)
 
static bool isHvacFlagSetpointTemperatureHeatSet (const THVACValue *hvacValue)
 
static bool isHvacFlagSetpointTemperatureCoolSet (const THVACValue *hvacValue)
 
static bool isHvacFlagHeating (const THVACValue *hvacValue)
 
static bool isHvacFlagCooling (const THVACValue *hvacValue)
 
static bool isHvacFlagWeeklySchedule (const THVACValue *hvacValue)
 
static bool isHvacFlagFanEnabled (const THVACValue *hvacValue)
 
static bool isHvacFlagThermometerError (const THVACValue *hvacValue)
 
static bool isHvacFlagClockError (const THVACValue *hvacValue)
 
static bool isHvacFlagCountdownTimer (const THVACValue *hvacValue)
 
static bool isHvacFlagForcedOffBySensor (const THVACValue *hvacValue)
 
static enum HvacCoolSubfunctionFlag getHvacFlagCoolSubfunction (const THVACValue *hvacValue)
 
static bool isHvacFlagWeeklyScheduleTemporalOverride (const THVACValue *hvacValue)
 
static bool isHvacFlagBatteryCoverOpen (const THVACValue *hvacValue)
 
static bool isHvacFlagCalibrationError (const THVACValue *hvacValue)
 
static bool isHvacFlagAntifreezeOverheatActive (const THVACValue *hvacValue)
 
static bool isHvacValueValid (const THVACValue *hvacValue)
 
- Static Public Member Functions inherited from Supla::LocalAction
static void DeleteActionsHandledBy (const ActionHandler *client)
 
static void DeleteActionsTriggeredBy (const LocalAction *action)
 
static void NullifyActionsHandledBy (const ActionHandler *client)
 
static ActionHandlerClientgetClientListPtr ()
 

Static Public Attributes

static uint32_t lastCommunicationTimeMs = 0
 

Protected Member Functions

void setSendValue ()
 
bool isValueUpdateReady () const
 
void clearSendGetConfig ()
 
bool isGetConfigRequested () const
 
void setSendInitialCaption ()
 
void clearSendInitialCaption ()
 
bool isInitialCaptionUpdateReady () const
 
void setSendStateInfo ()
 
void clearSendStateInfo ()
 
bool isStateInfoUpdateReady () const
 

Protected Attributes

ChannelnextPtr = nullptr
 
char * initialCaption = nullptr
 
uint64_t channelFlags = 0
 
uint32_t functionsBitmap = 0
 
uint32_t validityTimeSec = 0
 
int16_t channelNumber = -1
 
uint16_t defaultFunction
 
uint8_t changedFields = 0
 
uint8_t batteryLevel = 255
 
uint8_t batteryPowered = 0
 
unsigned char bridgeSignalStrength = 255
 
ChannelType channelType = ChannelType::NOT_SET
 
uint8_t state = 0
 
uint8_t defaultIcon = 0
 
uint8_t subDeviceId = 0
 
union { 
 
   int8_t   value [SUPLA_CHANNELVALUE_SIZE] = {} 
 
   TActionTriggerProperties   actionTriggerProperties 
 
   THVACValue   hvacValue 
 
};  
 

Static Protected Attributes

static ChannelfirstPtr = nullptr
 

Member Function Documentation

◆ getBatteryLevel()

uint8_t Channel::getBatteryLevel ( ) const

Returns battery level.

Returns
0..100 (0 = empty, 100 = full), or 255 if not available

◆ getValveOpenState()

uint8_t Channel::getValveOpenState ( ) const

Returns the open state (open/close) of the Valve channel.

Returns
0-100 range, 0 = closed, 100 = open

◆ isValveFloodingFlagActive()

bool Channel::isValveFloodingFlagActive ( ) const

Returns the flooding flag of the Valve channel.

Returns
true if flooding flag is active

◆ isValveManuallyClosedFlagActive()

bool Channel::isValveManuallyClosedFlagActive ( ) const

Returns the manually closed flag of the Valve channel.

Returns
true if manually closed flag is active

◆ isValveMotorProblemFlagActive()

bool Channel::isValveMotorProblemFlagActive ( ) const

Returns the motor problem flag of the Valve channel.

Returns
true if motor problem flag is active

◆ isValveOpen()

bool Channel::isValveOpen ( ) const

Returns the open state (open/close) of the Valve channel.

Returns
true if open

◆ setBatteryLevel()

void Channel::setBatteryLevel ( int level)

Sets battery level.

Parameters
level0..100

◆ setValveFloodingFlag()

void Channel::setValveFloodingFlag ( bool active)

Sets the flooding flag of the Valve channel.

Flooding flag is set when the valve was closed because of flood/leak detection.

Parameters
active

◆ setValveManuallyClosedFlag()

void Channel::setValveManuallyClosedFlag ( bool active)

Sets the manually closed flag of the Valve channel.

Manually closed flag is set when the valve was closed manually or in other way by valve (i.e. radio).

Parameters
active

◆ setValveMotorProblemFlag()

void Channel::setValveMotorProblemFlag ( bool active)

Sets the motor problem flag of the Valve channel.

Parameters
active

◆ setValveOpenState()

void Channel::setValveOpenState ( uint8_t openState)

Sets the open state (open/close) of the Valve channel.

Parameters
openState0-100 range, 0 = closed, 100 = open. For OpenClose variant of the channel, 0 = closed, >= 1 = open (converted to 100)

Member Data Documentation

◆ defaultFunction

uint16_t Supla::Channel::defaultFunction
protected
Initial value:
=
0

The documentation for this class was generated from the following files: