Loading...
Searching...
No Matches
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.
const std::map< int, std::string > & | getNewDevices () const
| Get a map of id and name of new devices.
bool | hasLastScanTime () const
| Get whether a last scan time is available.
bool | isScanActive ()
| Get whether scan is currently active.
time::AbsoluteTime | getLastScanTime () const
| Get time when last scan was completed.

## Static Public Member Functions

static NewDeviceList | parse (const nlohmann::json &json)
| Parse from json response.

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

  HueException | when 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_argument | when json is invalid.
  nlohmann::json::exception | when json is invalid.

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

- include/hueplusplus/NewDeviceList.h
- src/NewDeviceList.cpp