BeeeOn Gateway  v2020.3.1-2-g6f737dc
Platform to interconnect the IoT world
Public Member Functions
BeeeOn::ZWaveNode::Value Class Reference

Value coming from the Z-Wave network. It holds some data (usually sensor data) and metadata to identify the value semantics. More...

#include <ZWaveNode.h>

Public Member Functions

 Value (const ZWaveNode &node, const CommandClass &cc, const std::string &value, const std::string &unit="")
 
 Value (const Identity &node, const CommandClass &cc, const std::string &value, const std::string &unit="")
 
const Identitynode () const
 
const CommandClasscommandClass () const
 
std::string value () const
 
std::string unit () const
 
bool asBool () const
 
uint32_t asHex32 () const
 
double asDouble () const
 
int asInt (bool floor=false) const
 
double asCelsius () const
 
double asLuminance () const
 
double asPM25 () const
 
Poco::Timespan asTime () const
 
std::string toString () const
 

Detailed Description

Value coming from the Z-Wave network. It holds some data (usually sensor data) and metadata to identify the value semantics.

Member Function Documentation

bool ZWaveNode::Value::asBool ( ) const

Interpret the value as a boolean. If the value cannot be represented as boolean, an exception is thrown.

Exceptions
Poco::SyntaxException
double ZWaveNode::Value::asCelsius ( ) const

Interpret the underlying value as temperature. The supported units are C and F (according to Z-Wave). If the value is represented in F (Farenheit) a conversion is applied.

double ZWaveNode::Value::asDouble ( ) const

Interpret the value as a double (real) number. If the value cannot be parsed, it throws an exception.

uint32_t ZWaveNode::Value::asHex32 ( ) const

Interpret the value as an unsigned 32-bit number stored in the hexadecimal format. If the value cannot be parsed, it throws an exception.

int ZWaveNode::Value::asInt ( bool  floor = false) const

Interpret the value as signed int. If the underlying value is real (double) and the argument floor is false then an exception is thrown.

Parameters
floorif the underlying cannot be interpreted as int, and floor is true, it would be interpreted as double and floored
double ZWaveNode::Value::asLuminance ( ) const

Interpret the underlying value as a value of luminance. The luminance is returned in lux. If the underlying value is represented in percent, a conversion is applied.

double ZWaveNode::Value::asPM25 ( ) const

Interpret the underlying value as a value of PM 2.5. The expected and only supported unit is ug/m3.

Timespan ZWaveNode::Value::asTime ( ) const

Interpret the underlying value as a value of time. The expected and only supported unit is seconds.

const ZWaveNode::CommandClass & ZWaveNode::Value::commandClass ( ) const
Returns
command class that's value is represented
const ZWaveNode::Identity & ZWaveNode::Value::node ( ) const
Returns
the associated node's identity
string ZWaveNode::Value::unit ( ) const
Returns
unit that the value is represented in
string ZWaveNode::Value::value ( ) const
Returns
value in string format (raw)

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