hueplusplus  1.0.0
Public Member Functions | Static Public Member Functions | List of all members
hueplusplus::NewDeviceList Class Reference

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...
 

Detailed Description

List of new devices found during the last scan.

Constructor & Destructor Documentation

◆ NewDeviceList()

hueplusplus::NewDeviceList::NewDeviceList ( const std::string &  lastScan,
const std::map< int, std::string > &  devices 
)

Construct from data.

Member Function Documentation

◆ getLastScanTime()

time::AbsoluteTime hueplusplus::NewDeviceList::getLastScanTime ( ) const

Get time when last scan was completed.

Exceptions
HueExceptionwhen no time is available or timestamp is invalid
Note
Must only be called when hasLastScanTime() is true.

◆ getNewDevices()

const std::map< int, std::string > & hueplusplus::NewDeviceList::getNewDevices ( ) const

Get a map of id and name of new devices.

◆ hasLastScanTime()

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.

◆ isScanActive()

bool hueplusplus::NewDeviceList::isScanActive ( )

Get whether scan is currently active.

When scan is active, no last scan time is available

◆ parse()

NewDeviceList hueplusplus::NewDeviceList::parse ( const nlohmann::json &  json)
static

Parse from json response.

Exceptions
std::invalid_argumentwhen json is invalid.
nlohmann::json::exceptionwhen json is invalid.

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