| LightHub v4.0.0 Smarthome controller firmware

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

`#include <itemCmd.h>`

## 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 (Item *item)
| Constructor with loading value from Item. More...
itemCmd | assignFrom (itemCmd from, short chanType=-1)
bool | loadItem (Item *item, uint16_t optionsFlag=SEND_PARAMETERS)
bool | loadItemDef (Item *item, uint16_t optionsFlag=SEND_PARAMETERS)
bool | saveItem (Item *item, uint16_t optionsFlag=SEND_PARAMETERS)
itemCmd | Int (int32_t i)
itemCmd | Int (uint32_t i)
itemCmd | Float (float f)
itemCmd | Tens (int32_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)
itemCmd | Str (char *str)
bool | setH (uint16_t)
bool | setS (uint8_t)
bool | setColorTemp (int)
int | getColorTemp ()
uint16_t | getH ()
uint16_t | getS ()
itemCmd | setArgType (uint8_t)
itemCmd | convertTo (uint8_t)
uint8_t | getStoragetypeByChanType (short chanType)
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 ()
float | getFloat ()
char * | getString ()
long int | getSingleInt ()
short | getPercents (bool inverse=false)
short | getPercents255 (bool inverse=false)
bool | setPercents (int percents)
uint8_t | getCmd ()
uint8_t | getArgType ()
uint8_t | getCmdParam ()
char * | toString (char *Buffer, int bufLen, int sendFlags=SEND_COMMAND|SEND_PARAMETERS, bool scale100=false)
bool | isCommand ()
bool | isValue ()
bool | isColor ()
itemCmd | setDefault ()
itemCmd | setChanType (short chanType)
void | debugOut ()
int | doMapping (aJsonObject *mappingData)
int | doReverseMapping (aJsonObject *mappingData)
int | doMappingCmd (aJsonObject *mappingData)
int | doReverseMappingCmd (aJsonObject *mappingData)
bool | scale100 ()

## Public Attributes
itemCmdStore | cmd
itemArgStore | param

## Constructor & Destructor Documentation

## ◆ itemCmd() [1/3]

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/3]

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

## ◆ itemCmd() [3/3]

itemCmd::itemCmd | ( | Item * | item | ) |

Constructor with loading value from Item.

Parameters

  Item |

## Member Function Documentation

## ◆ assignFrom()

itemCmd itemCmd::assignFrom | ( | itemCmd | from,
|  | short | chanType = `-1`
| ) |  |

## ◆ Cmd()

itemCmd itemCmd::Cmd | ( | uint8_t | i | ) |

## ◆ convertTo()

itemCmd itemCmd::convertTo | ( | uint8_t | type | ) |

## ◆ debugOut()

void itemCmd::debugOut | ( |  | ) |

## ◆ doMapping()

int itemCmd::doMapping | ( | aJsonObject * | mappingData | ) |

## ◆ doMappingCmd()

int itemCmd::doMappingCmd | ( | aJsonObject * | mappingData | ) |

## ◆ doReverseMapping()

int itemCmd::doReverseMapping | ( | aJsonObject * | mappingData | ) |

## ◆ doReverseMappingCmd()

int itemCmd::doReverseMappingCmd | ( | aJsonObject * | mappingData | ) |

## ◆ Float()

itemCmd itemCmd::Float | ( | float | f | ) |

## ◆ getArgType()

uint8_t itemCmd::getArgType | ( |  | ) |

## ◆ getCmd()

uint8_t itemCmd::getCmd | ( |  | ) |

## ◆ getCmdParam()

uint8_t itemCmd::getCmdParam | ( |  | ) |

## ◆ getColorTemp()

int itemCmd::getColorTemp | ( |  | ) |

Return color tempetature parameter from HSV or HSV255 types. return 153..500 value in success. -1 - if no value stored

## ◆ getFloat()

float itemCmd::getFloat | ( |  | ) |

## ◆ 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 | ( |  | ) |

## ◆ getSingleInt()

long int itemCmd::getSingleInt | ( |  | ) |

## ◆ getStoragetypeByChanType()

uint8_t itemCmd::getStoragetypeByChanType | ( | short | chanType | ) |

## ◆ getString()

char * itemCmd::getString | ( |  | ) |

## ◆ 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,
|  | uint16_t | optionsFlag = `SEND_PARAMETERS`
| ) |  |

## ◆ loadItemDef()

bool itemCmd::loadItemDef | ( | Item * | item,
|  | uint16_t | optionsFlag = `SEND_PARAMETERS`
| ) |  |

## ◆ 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,
|  | uint16_t | optionsFlag = `SEND_PARAMETERS`
| ) |  |

## ◆ scale100()

bool itemCmd::scale100 | ( |  | ) |

## ◆ setArgType()

itemCmd itemCmd::setArgType | ( | uint8_t | type | ) |

## ◆ setChanType()

itemCmd itemCmd::setChanType | ( | short | chanType | ) |

## ◆ setColorTemp()

bool itemCmd::setColorTemp | ( | int | t | ) |

Setup color tempetature parameter for HSV or HSV255 types. It must be 153..500 (mireds) value. Internally 1 - cold, 101 - warm light

## ◆ setDefault()

itemCmd itemCmd::setDefault | ( |  | ) |

## ◆ setH()

bool itemCmd::setH | ( | uint16_t | h | ) |

## ◆ setPercents()

bool itemCmd::setPercents | ( | int | percents | ) |

## ◆ setS()

bool itemCmd::setS | ( | uint8_t | s | ) |

## ◆ setSuffix()

itemCmd itemCmd::setSuffix | ( | uint8_t | suffix | ) |

## ◆ Str()

itemCmd itemCmd::Str | ( | char * | str | ) |

## ◆ Tens()

itemCmd itemCmd::Tens | ( | int32_t | i | ) |

## ◆ toString()

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

## Member Data Documentation

## ◆ cmd

itemCmdStore itemCmd::cmd

## ◆ param

itemArgStore itemCmd::param

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

- itemCmd.h
- itemCmd.cpp