#include "AccessoryLight.hpp"
Public Member Functions | |
AccessoryLight () | |
void | begin (Port *inpPort, unsigned long inId, unsigned long inBlinkDuration = 0, int inIntensity = 255) |
void | SetFading (uint8_t inStep, uint8_t inDelay) |
bool | IsOn () const |
bool | IsBlinking () const |
bool | IsFading () const |
void | Event (unsigned long inId, ACCESSORIES_EVENT_TYPE inEvent = ACCESSORIES_EVENT_MOVEPOSITIONID, int inData = 0) |
void | SetState (ACC_STATE inState) |
ACC_STATE | Toggle () |
void | LightOn () |
void | LightOff () |
void | Blink () |
int | EEPROMLoad (int inPos) |
![]() | |
Accessory () | |
void | begin (ACC_STATE inStartingState = STATE_NONE) |
Port * | GetPort () const |
ACC_STATE | GetState () const |
ACC_STATE | GetPreviousState () const |
bool | IsNone () const |
bool | IsFirst () const |
bool | IsSecond () const |
uint8_t | AddMovingPosition (unsigned long inId, int inPosition) |
unsigned int | GetDebounceDelay () const |
unsigned long | GetLastMoveTime () const |
unsigned long | GetDuration () const |
bool | loop () |
virtual int | EEPROMSave (int inPos, bool inSimulate = false) |
void | AdjustMovingPositionsSize (uint8_t inNewSize) |
bool | IsEmpty () const |
uint8_t | IndexOfMovingPosition (unsigned long inId) const |
int | GetMovingPosition (unsigned long inId) const |
int | GetMovingPositionByIndex (int inIndex) const |
unsigned long | GetMovingPositionIdByIndex (int inIndex) const |
const uint8_t | GetLastMovingPosition () const |
const uint8_t | GetMovingPositionSize () const |
void | SetLastMovingPosition (uint8_t inLastPositionIndex) |
void | SetDebounceDelay (unsigned int inDebounceDelay) |
void | SetLastMoveTime () |
void | SetDuration (unsigned long inDuration) |
void | SetNextAccessory (Accessory *inAccessory) |
Accessory * | GetNextAccessory () const |
unsigned long | GetActionStartingMillis () const |
virtual void | StartAction (ACC_STATE inState) |
bool | IsActionDelayPending () const |
virtual bool | IsGroupActionPending () const |
virtual bool | CanBePositional () const |
virtual void | MovePosition (int inPosition) |
void | SetStateRaw (ACC_STATE inNewState) |
void | SetStartingMillis () |
void | ResetStartingMillis () |
Additional Inherited Members | |
![]() | |
static void | ExecuteEvent (unsigned long inId, ACCESSORIES_EVENT_TYPE inEvent = ACCESSORIES_EVENT_MOVEPOSITIONID, int inData = 0) |
static uint8_t | GetCount () |
static bool | IsActionPending () |
static Accessory * | GetFirstAccessory () |
![]() | |
Port * | pPort |
ACC_STATE | prevState |
This class describes a single light accessory.
Definition at line 15 of file AccessoryLight.hpp.
AccessoryLight::AccessoryLight | ( | ) |
Default constructor.
Definition at line 12 of file AccessoryLight.cpp.
void AccessoryLight::begin | ( | Port * | inpPort, |
unsigned long | inId, | ||
unsigned long | inBlinkDuration = 0 , |
||
int | inIntensity = 255 |
||
) |
Initialize the instance.
inpPort | Port driven this light. |
inId | Id of this accessory. |
inBlinkDuration | Blink duration, 0 for fix light. Default is 0. |
inIntensity | Intensity of this light. Default is maximum, 255. |
Definition at line 16 of file AccessoryLight.cpp.
|
inline |
Turn the light on and blink.
Definition at line 71 of file AccessoryLight.hpp.
|
virtual |
|
virtual |
Execute a new event.
inId | Id of an accessory or an accessory item. |
inEvent | Type of the new event. Default is ACCESSORIES_EVENT_MOVEPOSITIONID. |
inData | Associated data to the event type. Default is 0. |
Reimplemented from Accessory.
Definition at line 41 of file AccessoryLight.cpp.
|
inline |
Checks if the light is blinking.
Definition at line 44 of file AccessoryLight.hpp.
|
inline |
Checks if the light is fading.
Definition at line 49 of file AccessoryLight.hpp.
|
inline |
Checks if the light is on.
Definition at line 40 of file AccessoryLight.hpp.
|
inline |
Turn the light off.
Definition at line 69 of file AccessoryLight.hpp.
|
inline |
Turn the light on.
Definition at line 67 of file AccessoryLight.hpp.
|
inline |
Set the fading mode, defining its speed.
inStep | Number of steps between light on and light off. |
inDelay | Duration of each step. |
Definition at line 35 of file AccessoryLight.hpp.
|
inlinevirtual |
Sets the internal state.
inState | new state LIGHTON, LIGHTOFF or LIGHTBLINKING. |
Reimplemented from Accessory.
Definition at line 61 of file AccessoryLight.hpp.
|
inlinevirtual |
Change the state from ON to OFF or OFF to ON.
Implements Accessory.
Definition at line 65 of file AccessoryLight.hpp.