LSH-Core
A robust C++ framework for Arduino-based home automation nodes
Loading...
Searching...
No Matches
Actuators Namespace Reference

Forward declaration. More...

Functions

void addActuator (Actuator *const actuator)
 Adds an actuator to the system.
 
auto getActuator (uint8_t actuatorId) -> Actuator *
 Get a single actuator.
 
auto getIndex (uint8_t actuatorId) -> uint8_t
 Get a single actuator index (in device vector of actuators).
 
auto actuatorExists (uint8_t actuatorId) -> bool
 Get if the actuator actually exists.
 
auto actuatorsAutoOffTimersCheck () -> bool
 Performs an auto-off timers check for actuators.
 
auto turnOffAllActuators () -> bool
 Turns off all actuators.
 
auto turnOffUnprotectedActuators () -> bool
 Turns off all unprotected actuators.
 
auto setAllActuatorsState (const etl::array< bool, CONFIG_MAX_ACTUATORS > &states) -> bool
 Set the state for all actuators.
 
void finalizeSetup ()
 Populates actuatorsWithAutoOffIndexes.
 

Variables

uint8_t totalActuators = 0U
 Device real total Actuators.
 
etl::array< Actuator *, CONFIG_MAX_ACTUATORS > actuators {}
 All device actuators (like relays)
 
etl::map< uint8_t, uint8_t, CONFIG_MAX_ACTUATORS > actuatorsMap {}
 Device actuators map (UUID -> actuator index)
 
etl::vector< uint8_t, CONFIG_MAX_ACTUATORS > actuatorsWithAutoOffIndexes {}
 Indexes of actuators with auto off functionality active.
 

Detailed Description

Forward declaration.

Globally stores all actuators (relays) and to operates over them.

Function Documentation

◆ actuatorExists()

auto Actuators::actuatorExists ( uint8_t  actuatorId) -> bool

Get if the actuator actually exists.

Parameters
actuatorIdUnique ID of the actuator.
Returns
true if actuator exists.
false if actuator doesn't exist.
Here is the caller graph for this function:

◆ actuatorsAutoOffTimersCheck()

auto Actuators::actuatorsAutoOffTimersCheck ( ) -> bool

Performs an auto-off timers check for actuators.

Returns
true if any actuator has been automatically switched off.
false otherwise.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ addActuator()

void Actuators::addActuator ( Actuator *const  actuator)

Adds an actuator to the system.

The actuator is stored in the main array and its ID is mapped to its index for fast lookups. If the maximum number of actuators is exceeded, the device will reset to prevent undefined behavior.

Parameters
actuatorA pointer to the Actuator object to add.
Here is the call graph for this function:

◆ getActuator()

auto Actuators::getActuator ( uint8_t  actuatorId) -> Actuator *

Get a single actuator.

Parameters
actuatorIdactuator UUID.
Returns
Actuator* a single actuator.

◆ getIndex()

auto Actuators::getIndex ( uint8_t  actuatorId) -> uint8_t

Get a single actuator index (in device vector of actuators).

Parameters
actuatorIdactuator UUID.
Returns
uint8_t a single actuator index (in device vector of actuators).
Here is the caller graph for this function:

◆ setAllActuatorsState()

auto Actuators::setAllActuatorsState ( const etl::array< bool, CONFIG_MAX_ACTUATORS > &  states) -> bool

Set the state for all actuators.

Parameters
statesAn array of boolean states to be set. The size must match the number of actuators.
Returns
true if any actuator performed the switch.
false otherwise.

◆ turnOffAllActuators()

auto Actuators::turnOffAllActuators ( ) -> bool

Turns off all actuators.

Returns
true if any actuator performed the switch.
false otherwise.

◆ turnOffUnprotectedActuators()

auto Actuators::turnOffUnprotectedActuators ( ) -> bool

Turns off all unprotected actuators.

Returns
true if any actuator performed the switch.
false otherwise.
Here is the caller graph for this function:

Variable Documentation

◆ actuatorsMap

etl::map< uint8_t, uint8_t, CONFIG_MAX_ACTUATORS > Actuators::actuatorsMap {}

Device actuators map (UUID -> actuator index)

Device actuators map (UUID (integer) -> actuator index)