Loading...
Searching...
No Matches
NewDeviceList.h
Go to the documentation of this file.
#ifndef INCLUDE_HUEPLUSPLUS_NEW_DEVICE_LIST_H
#define INCLUDE_HUEPLUSPLUS_NEW_DEVICE_LIST_H
#include <map>
#include <string>
#include "TimePattern.h"
#include <nlohmann/json.hpp>
namespace hueplusplus
{
class NewDeviceList
{
public:
NewDeviceList(const std::string& lastScan, const std::map<int, std::string>& devices);
const std::map<int, std::string>& getNewDevices() const;
bool hasLastScanTime() const;
bool isScanActive();
time::AbsoluteTime getLastScanTime() const;
static NewDeviceList parse(const nlohmann::json& json);
private:
std::string lastScan;
std::map<int, std::string> devices;
};
} // namespace hueplusplus
#endif
TimePattern.h
hueplusplus::NewDeviceList
List of new devices found during the last scan.
Definition NewDeviceList.h:36
hueplusplus::NewDeviceList::getLastScanTime
time::AbsoluteTime getLastScanTime() const
Get time when last scan was completed.
Definition NewDeviceList.cpp:41
hueplusplus::NewDeviceList::parse
static NewDeviceList parse(const nlohmann::json &json)
Parse from json response.
Definition NewDeviceList.cpp:45
hueplusplus::NewDeviceList::hasLastScanTime
bool hasLastScanTime() const
Get whether a last scan time is available.
Definition NewDeviceList.cpp:33
hueplusplus::NewDeviceList::isScanActive
bool isScanActive()
Get whether scan is currently active.
Definition NewDeviceList.cpp:37
hueplusplus::NewDeviceList::getNewDevices
const std::map< int, std::string > & getNewDevices() const
Get a map of id and name of new devices.
Definition NewDeviceList.cpp:29
hueplusplus::time::AbsoluteTime
One-time, absolute time point.
Definition TimePattern.h:73
hueplusplus
Namespace for the hueplusplus library.
Definition Action.h:28