23 #ifndef INCLUDE_HUEPLUSPLUS_HUE_THING_H 24 #define INCLUDE_HUEPLUSPLUS_HUE_THING_H 30 #include "json/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);
Definition: HueCommandAPI.h:37
int id
holds the id of the device
Definition: BaseDevice.h:154
virtual int getId() const
Const function that returns the id of this device.
Definition: BaseDevice.cpp:34
Namespace for the hueplusplus library.
Definition: Action.h:27
virtual std::string getManufacturername() const
Const function that returns the manufacturername of the device.
Definition: BaseDevice.cpp:64
Caches API GET requests and refreshes regularly.
Definition: APICache.h:37
virtual std::string getUId() const
Const function that returns the uniqueid of the device.
Definition: BaseDevice.cpp:59
Base class for physical devices connected to the bridge (sensor or light).
Definition: BaseDevice.h:35
virtual std::string getProductname() const
Const function that returns the productname of the device.
Definition: BaseDevice.cpp:69
virtual std::string getName()
Function that returns the name of the device.
Definition: BaseDevice.cpp:44
Contains information about error location, use CURRENT_FILE_INFO to create.
Definition: HueException.h:34
APICache state
holds the current state of the device
Definition: BaseDevice.h:155
virtual void setRefreshDuration(std::chrono::steady_clock::duration refreshDuration)
Sets custom refresh interval for this device.
Definition: BaseDevice.cpp:123
virtual std::string getSwVersion()
Function that returns the software version of the device.
Definition: BaseDevice.cpp:74
virtual std::string getType() const
Const function that returns the device type.
Definition: BaseDevice.cpp:39
virtual ~BaseDevice()=default
Virtual destructor.
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 bool setName(const std::string &name)
Function that sets the name of the device.
Definition: BaseDevice.cpp:84
BaseDevice(int id, const std::shared_ptr< APICache > &baseCache)
Protected ctor that is used by subclasses, construct with shared cache.
Definition: BaseDevice.cpp:94
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