hueplusplus  1.0.0
NewDeviceList.h
Go to the documentation of this file.
1 
22 #ifndef INCLUDE_HUEPLUSPLUS_NEW_DEVICE_LIST_H
23 #define INCLUDE_HUEPLUSPLUS_NEW_DEVICE_LIST_H
24 
25 #include <map>
26 #include <string>
27 
28 #include "TimePattern.h"
29 
30 #include "json/json.hpp"
31 
32 namespace hueplusplus
33 {
36 {
37 public:
39  NewDeviceList(const std::string& lastScan, const std::map<int, std::string>& devices);
40 
42  const std::map<int, std::string>& getNewDevices() const;
43 
48  bool hasLastScanTime() const;
52  bool isScanActive();
57 
61  static NewDeviceList parse(const nlohmann::json& json);
62 
63 private:
64  std::string lastScan;
65  std::map<int, std::string> devices;
66 };
67 } // namespace hueplusplus
68 
69 #endif
time::AbsoluteTime getLastScanTime() const
Get time when last scan was completed.
Definition: NewDeviceList.cpp:41
static NewDeviceList parse(const nlohmann::json &json)
Parse from json response.
Definition: NewDeviceList.cpp:45
bool isScanActive()
Get whether scan is currently active.
Definition: NewDeviceList.cpp:37
Namespace for the hueplusplus library.
Definition: Action.h:27
List of new devices found during the last scan.
Definition: NewDeviceList.h:35
const std::map< int, std::string > & getNewDevices() const
Get a map of id and name of new devices.
Definition: NewDeviceList.cpp:29
One-time, absolute time point.
Definition: TimePattern.h:72
NewDeviceList(const std::string &lastScan, const std::map< int, std::string > &devices)
Construct from data.
Definition: NewDeviceList.cpp:26
bool hasLastScanTime() const
Get whether a last scan time is available.
Definition: NewDeviceList.cpp:33