ZigBee Green Power sensor for button presses.
More...
#include <hueplusplus/ZLLSensors.h>
|
| ZGPSwitch (Sensor sensor) |
| Construct from generic sensor. More...
|
|
bool | isOn () const |
| Check if sensor is on. More...
|
|
void | setOn (bool on) |
| Enable or disable sensor. More...
|
|
int | getButtonEvent () const |
| Get the code of the last switch event. More...
|
|
virtual | ~BaseDevice ()=default |
| Virtual destructor. More...
|
|
virtual int | getId () const |
| Const function that returns the id of this device. More...
|
|
virtual std::string | getType () const |
| Const function that returns the device type. More...
|
|
virtual std::string | getName () |
| Function that returns the name of the device. More...
|
|
virtual std::string | getName () const |
| Const function that returns the name of the device. More...
|
|
virtual std::string | getModelId () const |
| Const function that returns the modelid of the device. More...
|
|
virtual std::string | getUId () const |
| Const function that returns the uniqueid of the device. More...
|
|
virtual std::string | getManufacturername () const |
| Const function that returns the manufacturername of the device. More...
|
|
virtual std::string | getProductname () const |
| Const function that returns the productname of the device. More...
|
|
virtual std::string | getSwVersion () |
| Function that returns the software version of the device. More...
|
|
virtual std::string | getSwVersion () const |
| Const function that returns the software version of the device. More...
|
|
virtual bool | setName (const std::string &name) |
| Function that sets the name of the device. More...
|
|
virtual void | refresh (bool force=false) |
| Refreshes internal cached state. More...
|
|
virtual void | setRefreshDuration (std::chrono::steady_clock::duration refreshDuration) |
| Sets custom refresh interval for this device. More...
|
|
|
| BaseDevice (int id, const std::shared_ptr< APICache > &baseCache) |
| Protected ctor that is used by subclasses, construct with shared cache. More...
|
|
| BaseDevice (int id, const HueCommandAPI &commands, const std::string &path, std::chrono::steady_clock::duration refreshDuration, const nlohmann::json ¤tState) |
| Protected ctor that is used by subclasses. More...
|
|
virtual nlohmann::json | sendPutRequest (const std::string &subPath, const nlohmann::json &request, FileInfo fileInfo) |
| Utility function to send a put request to the device. More...
|
|
int | id |
| holds the id of the device More...
|
|
APICache | state |
| holds the current state of the device More...
|
|
ZigBee Green Power sensor for button presses.
◆ ZGPSwitch()
hueplusplus::sensors::ZGPSwitch::ZGPSwitch |
( |
Sensor |
sensor | ) |
|
|
inlineexplicit |
Construct from generic sensor.
◆ getButtonEvent()
int hueplusplus::sensors::ZGPSwitch::getButtonEvent |
( |
| ) |
const |
Get the code of the last switch event.
Possible values are c_button1 etc., or any other value.
◆ isOn()
bool hueplusplus::sensors::ZGPSwitch::isOn |
( |
| ) |
const |
Check if sensor is on.
Sensors which are off do not change their status
◆ setOn()
void hueplusplus::sensors::ZGPSwitch::setOn |
( |
bool |
on | ) |
|
Enable or disable sensor.
- Exceptions
-
std::system_error | when system or socket operations fail |
HueException | when response contained no body |
HueAPIResponseException | when response contains an error |
nlohmann::json::parse_error | when response could not be parsed |
◆ c_button1
constexpr int hueplusplus::sensors::ZGPSwitch::c_button1 = 34 |
|
static |
◆ c_button2
constexpr int hueplusplus::sensors::ZGPSwitch::c_button2 = 16 |
|
static |
◆ c_button3
constexpr int hueplusplus::sensors::ZGPSwitch::c_button3 = 17 |
|
static |
◆ c_button4
constexpr int hueplusplus::sensors::ZGPSwitch::c_button4 = 18 |
|
static |
◆ typeStr
constexpr const char * hueplusplus::sensors::ZGPSwitch::typeStr = "ZGPSwitch" |
|
static |
The documentation for this class was generated from the following files: