23#ifndef INCLUDE_HUEPLUSPLUS_HUE_THING_H
24#define INCLUDE_HUEPLUSPLUS_HUE_THING_H
30#include <nlohmann/json.hpp>
44 virtual int getId()
const;
49 virtual std::string
getType()
const;
64 virtual std::string
getName()
const;
75 virtual std::string
getUId()
const;
111 virtual bool setName(
const std::string& name);
120 virtual void refresh(
bool force =
false);
130 BaseDevice(
int id,
const std::shared_ptr<APICache>& baseCache);
139 std::chrono::steady_clock::duration refreshDuration,
const nlohmann::json& currentState);
151 virtual nlohmann::json
sendPutRequest(
const std::string& subPath,
const nlohmann::json& request,
FileInfo fileInfo);
Caches API GET requests and refreshes regularly.
Definition APICache.h:38
Base class for physical devices connected to the bridge (sensor or light).
Definition BaseDevice.h:36
virtual int getId() const
Const function that returns the id of this device.
Definition BaseDevice.cpp:34
APICache state
holds the current state of the device
Definition BaseDevice.h:155
virtual std::string getName()
Function that returns the name of the device.
Definition BaseDevice.cpp:44
virtual std::string getProductname() const
Const function that returns the productname of the device.
Definition BaseDevice.cpp:69
virtual void setRefreshDuration(std::chrono::steady_clock::duration refreshDuration)
Sets custom refresh interval for this device.
Definition BaseDevice.cpp:123
virtual std::string getType() const
Const function that returns the device type.
Definition BaseDevice.cpp:39
virtual std::string getUId() const
Const function that returns the uniqueid of the device.
Definition BaseDevice.cpp:59
int id
holds the id of the device
Definition BaseDevice.h:154
virtual void refresh(bool force=false)
Refreshes internal cached state.
Definition BaseDevice.cpp:111
virtual std::string getModelId() const
Const function that returns the modelid of the device.
Definition BaseDevice.cpp:54
virtual ~BaseDevice()=default
Virtual destructor.
virtual bool setName(const std::string &name)
Function that sets the name of the device.
Definition BaseDevice.cpp:84
virtual nlohmann::json sendPutRequest(const std::string &subPath, const nlohmann::json &request, FileInfo fileInfo)
Utility function to send a put request to the device.
Definition BaseDevice.cpp:106
virtual std::string getManufacturername() const
Const function that returns the manufacturername of the device.
Definition BaseDevice.cpp:64
virtual std::string getSwVersion()
Function that returns the software version of the device.
Definition BaseDevice.cpp:74
Definition HueCommandAPI.h:38
Namespace for the hueplusplus library.
Definition Action.h:28
Contains information about error location, use CURRENT_FILE_INFO to create.
Definition HueException.h:35