LightHub
Public Member Functions | Public Attributes | List of all members
itemCmd Class Reference

#include <itemCmd.h>

Collaboration diagram for itemCmd:
Collaboration graph
[legend]

Public Member Functions

 itemCmd (uint8_t _type=ST_VOID, uint8_t _code=CMD_VOID)
 Constructor with definition of type and command. More...
 
 itemCmd (float val)
 Constructor with definition of FLOAT value in storage. More...
 
itemCmd assignFrom (itemCmd from)
 
bool loadItem (Item *item, bool includeCommand=false)
 
bool saveItem (Item *item, bool includeCommand=false)
 
itemCmd Int (int32_t i)
 
itemCmd Int (uint32_t i)
 
itemCmd Cmd (uint8_t i)
 
itemCmd HSV (uint16_t h, uint8_t s, uint8_t v)
 
itemCmd HSV255 (uint16_t h, uint8_t s, uint8_t v)
 
itemCmd HS (uint16_t h, uint8_t s)
 
itemCmd RGB (uint8_t r, uint8_t g, uint8_t b)
 
itemCmd RGBW (uint8_t r, uint8_t g, uint8_t b, uint8_t w)
 
bool setH (uint16_t)
 
bool setS (uint8_t)
 
bool setColorTemp (uint8_t)
 
int8_t getColorTemp ()
 
uint16_t getH ()
 
uint16_t getS ()
 
itemCmd setArgType (uint8_t)
 
itemCmd Percents (int i)
 
itemCmd Percents255 (int i)
 
uint8_t getSuffix ()
 
itemCmd setSuffix (uint8_t suffix)
 
bool incrementPercents (int16_t)
 
bool incrementH (int16_t)
 
bool incrementS (int16_t)
 
long int getInt ()
 
short getPercents (bool inverse=false)
 
short getPercents255 (bool inverse=false)
 
uint8_t getCmd ()
 
uint8_t getArgType ()
 
uint8_t getCmdParam ()
 
char * toString (char *Buffer, int bufLen, int sendFlags=SEND_COMMAND|SEND_PARAMETERS)
 
bool isCommand ()
 
bool isValue ()
 
bool isColor ()
 
itemCmd setDefault ()
 
itemCmd setChanType (short chanType)
 
void debugOut ()
 

Public Attributes

itemCmdStore cmd
 
itemArgStore param
 

Constructor & Destructor Documentation

◆ itemCmd() [1/2]

itemCmd::itemCmd ( uint8_t  _type = ST_VOID,
uint8_t  _code = CMD_VOID 
)

Constructor with definition of type and command.

Parameters
type- type of value (ST_???, ST_VOID by default)
code- code of command (CMD_VOID by default)

◆ itemCmd() [2/2]

itemCmd::itemCmd ( float  val)

Constructor with definition of FLOAT value in storage.

Parameters
float
type- type of value (ST_FLOAT or ST_FLOAT_CELSIUS or ST_FLOAT_FARENHEIT) - optional

Member Function Documentation

◆ assignFrom()

itemCmd itemCmd::assignFrom ( itemCmd  from)

◆ Cmd()

itemCmd itemCmd::Cmd ( uint8_t  i)

◆ debugOut()

void itemCmd::debugOut ( )

◆ getArgType()

uint8_t itemCmd::getArgType ( )

◆ getCmd()

uint8_t itemCmd::getCmd ( )

◆ getCmdParam()

uint8_t itemCmd::getCmdParam ( )

◆ getColorTemp()

int8_t itemCmd::getColorTemp ( )

Setup color tempetature parameter from HSV or HSV255 types. return 0..100 value in success. -1 - if no value stored

◆ getH()

uint16_t itemCmd::getH ( )

◆ getInt()

long int itemCmd::getInt ( )

◆ getPercents()

short itemCmd::getPercents ( bool  inverse = false)

◆ getPercents255()

short itemCmd::getPercents255 ( bool  inverse = false)

◆ getS()

uint16_t itemCmd::getS ( )

◆ getSuffix()

uint8_t itemCmd::getSuffix ( )

◆ HS()

itemCmd itemCmd::HS ( uint16_t  h,
uint8_t  s 
)

◆ HSV()

itemCmd itemCmd::HSV ( uint16_t  h,
uint8_t  s,
uint8_t  v 
)

◆ HSV255()

itemCmd itemCmd::HSV255 ( uint16_t  h,
uint8_t  s,
uint8_t  v 
)

◆ incrementH()

bool itemCmd::incrementH ( int16_t  dif)

◆ incrementPercents()

bool itemCmd::incrementPercents ( int16_t  dif)

◆ incrementS()

bool itemCmd::incrementS ( int16_t  dif)

◆ Int() [1/2]

itemCmd itemCmd::Int ( int32_t  i)

◆ Int() [2/2]

itemCmd itemCmd::Int ( uint32_t  i)

◆ isColor()

bool itemCmd::isColor ( )

◆ isCommand()

bool itemCmd::isCommand ( )

◆ isValue()

bool itemCmd::isValue ( )

◆ loadItem()

bool itemCmd::loadItem ( Item item,
bool  includeCommand = false 
)

◆ Percents()

itemCmd itemCmd::Percents ( int  i)

◆ Percents255()

itemCmd itemCmd::Percents255 ( int  i)

◆ RGB()

itemCmd itemCmd::RGB ( uint8_t  r,
uint8_t  g,
uint8_t  b 
)

◆ RGBW()

itemCmd itemCmd::RGBW ( uint8_t  r,
uint8_t  g,
uint8_t  b,
uint8_t  w 
)

◆ saveItem()

bool itemCmd::saveItem ( Item item,
bool  includeCommand = false 
)

◆ setArgType()

itemCmd itemCmd::setArgType ( uint8_t  type)

◆ setChanType()

itemCmd itemCmd::setChanType ( short  chanType)

◆ setColorTemp()

bool itemCmd::setColorTemp ( uint8_t  t)

Setup color tempetature parameter for HSV or HSV255 types. It must be 0..100 value. 0 - cold, 100 - warm light

◆ setDefault()

itemCmd itemCmd::setDefault ( )

◆ setH()

bool itemCmd::setH ( uint16_t  h)

◆ setS()

bool itemCmd::setS ( uint8_t  s)

◆ setSuffix()

itemCmd itemCmd::setSuffix ( uint8_t  suffix)

◆ toString()

char * itemCmd::toString ( char *  Buffer,
int  bufLen,
int  sendFlags = SEND_COMMAND | SEND_PARAMETERS 
)

Member Data Documentation

◆ cmd

itemCmdStore itemCmd::cmd

◆ param

itemArgStore itemCmd::param

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