SpaIot Library
SpaIot::Event

Spa Events. More...

Public Types

enum  Type {
  PowerOn = Key::Power , FilterOn = Key::Filter , BubbleOn = Key::Bubble , JetOn = Key::Jet ,
  SanitizerOn = Key::Sanitizer , HeaterOn = Key::Heater , HeatReached = Key::HeatReached , WaterTemp = Key::TempUp + 1 ,
  DesiredTemp , SetDesiredTemp , SanitizerTime , ErrorCode ,
  AmbientTemperature , NoEvent = -1 , AnyEvent = -2
}
 Type of event. More...
 

Public Member Functions

 Event (Type type=Type::NoEvent, uint16_t value=0)
 Construct a new Event object. More...
 
virtual ~Event ()
 Destructor.
 
 Event (const Event &other)
 Copy Constructor.
 
 Event (Event &&other)
 Move Constructor after the move, other is null, other.clear() must be called if it is to be used again.
 
Eventoperator= (const Event &other)
 Sets the Event object to be equal to other.
 
Eventoperator= (Event &&other)
 Move assignment after the move, other is null, other.clear() must be called if it is to be used again.
 
void clear ()
 Clears the Event object After the call to this function, the Event object is the same as one that has been default constructed.
 
bool isNull () const
 Returns true if the object is null (i.e. it has not been initialized, d_ptr is null)
 
bool isEmpty () const
 Checks if all attributes are set to their default values (same as the default constructor)
 
bool operator== (const Event &other) const
 Checks if the two objects are equal.
 
bool operator!= (const Event &other) const
 Checks if the two objects are not equal.
 
 operator bool () const
 Conversion to bool. More...
 
 operator uint16_t () const
 Conversion to uint16_t. More...
 
void setValue (uint16_t value)
 Set the Data object. More...
 
void setType (Type type)
 Set the Type object. More...
 
Type type () const
 Get the Type object. More...
 
uint16_t value () const
 Get the Value object. More...
 
String toString () const
 Convert the event to a string. More...
 
bool isBoolean () const
 Returns true if the event type is a boolean.
 

Static Public Member Functions

static String typeToString (Type type)
 Convert the event type to a string. More...
 
static bool TypeIsBoolean (Type type)
 Returns true if the event type is a boolean.
 

Detailed Description

Spa Events.

This enum lists the events that can be sent or receive by the spa

Member Enumeration Documentation

◆ Type

Type of event.

Enumerator
PowerOn 

Power On, boolean, true when the spa is powered on, false when the spa is powered off.

FilterOn 

Filter On, boolean, true when the filter is on, false when the filter is off.

BubbleOn 

Bubble On, boolean, true when the bubble is on, false when the bubble is off.

JetOn 

Jet On, boolean, true when the jet is on, false when the jet is off.

SanitizerOn 

Sanitizer On, boolean, true when the sanitizer is on, false when the sanitizer is off.

HeaterOn 

Heater On, boolean, true when the heater is on, false when the heater is off.

HeatReached 

Heat Reached, boolean, true when the water temperature is reached (led green), false when the water temperature is not reached (led red or Heater Off)

WaterTemp 

Water temperature in °C.

DesiredTemp 

Desired water temperature in °C.

SetDesiredTemp 

Set desired water temperature in °C.

SanitizerTime 

Remaining sanitation time in hours.

ErrorCode 

Error code displayed by the control panel, 0 if no error.

AmbientTemperature 

Ambient temperature in °C (if air temperature sensor is available)

NoEvent 

No event.

AnyEvent 

Any event.

Constructor & Destructor Documentation

◆ Event()

SpaIot::Event::Event ( Type  type = Type::NoEvent,
uint16_t  value = 0 
)

Construct a new Event object.

Parameters
typeThe event type
valueThe event value

Member Function Documentation

◆ operator bool()

SpaIot::Event::operator bool ( ) const

Conversion to bool.

Convert the Event object value to a boolean value.

Returns
true if the event value is true and type is not NoEvent, false otherwise

◆ operator uint16_t()

SpaIot::Event::operator uint16_t ( ) const

Conversion to uint16_t.

Returns
the event value or UnsetValue16 if type is NoEvent, false otherwise

◆ setType()

void SpaIot::Event::setType ( Type  type)

Set the Type object.

Parameters
typeThe event type

◆ setValue()

void SpaIot::Event::setValue ( uint16_t  value)

Set the Data object.

Parameters
value

◆ toString()

String SpaIot::Event::toString ( ) const

Convert the event to a string.

Returns
The event as a string

◆ type()

Type SpaIot::Event::type ( ) const

Get the Type object.

Returns
The event type

◆ typeToString()

static String SpaIot::Event::typeToString ( Type  type)
static

Convert the event type to a string.

Parameters
typeThe event type
Returns
The event type as a string

◆ value()

uint16_t SpaIot::Event::value ( ) const

Get the Value object.

Returns
The event value