hueplusplus
1.0.0
|
List of new devices found during the last scan. More...
#include <hueplusplus/NewDeviceList.h>
Public Member Functions | |
NewDeviceList (const std::string &lastScan, const std::map< int, std::string > &devices) | |
Construct from data. More... | |
const std::map< int, std::string > & | getNewDevices () const |
Get a map of id and name of new devices. More... | |
bool | hasLastScanTime () const |
Get whether a last scan time is available. More... | |
bool | isScanActive () |
Get whether scan is currently active. More... | |
time::AbsoluteTime | getLastScanTime () const |
Get time when last scan was completed. More... | |
Static Public Member Functions | |
static NewDeviceList | parse (const nlohmann::json &json) |
Parse from json response. More... | |
List of new devices found during the last scan.
hueplusplus::NewDeviceList::NewDeviceList | ( | const std::string & | lastScan, |
const std::map< int, std::string > & | devices | ||
) |
Construct from data.
time::AbsoluteTime hueplusplus::NewDeviceList::getLastScanTime | ( | ) | const |
Get time when last scan was completed.
HueException | when no time is available or timestamp is invalid |
const std::map< int, std::string > & hueplusplus::NewDeviceList::getNewDevices | ( | ) | const |
Get a map of id and name of new devices.
bool hueplusplus::NewDeviceList::hasLastScanTime | ( | ) | const |
Get whether a last scan time is available.
This can be false if there was no scan since the last restart or if the scan is still running.
bool hueplusplus::NewDeviceList::isScanActive | ( | ) |
Get whether scan is currently active.
When scan is active, no last scan time is available
|
static |
Parse from json response.
std::invalid_argument | when json is invalid. |
nlohmann::json::exception | when json is invalid. |