22#ifndef INCLUDE_HUEPLUSPLUS_CLIP_SENSORS_H
23#define INCLUDE_HUEPLUSPLUS_CLIP_SENSORS_H
66 std::string
getURL()
const;
72 void setURL(
const std::string& url);
101 static constexpr const char*
typeStr =
"CLIPSwitch";
123 static constexpr const char*
typeStr =
"CLIPOpenClose";
145 static constexpr const char*
typeStr =
"CLIPPresence";
167 static constexpr const char*
typeStr =
"CLIPTemperature";
189 static constexpr const char*
typeStr =
"CLIPHumidity";
239 static constexpr const char*
typeStr =
"CLIPLightLevel";
261 static constexpr const char*
typeStr =
"CLIPGenericFlag";
285 static constexpr const char*
typeStr =
"CLIPGenericStatus";
Base class for physical devices connected to the bridge (sensor or light).
Definition BaseDevice.h:36
Class for generic or unknown sensor types.
Definition Sensor.h:60
Common methods for CLIP sensors.
Definition CLIPSensors.h:33
bool hasBatteryState() const
Check whether the sensor has a battery state.
Definition CLIPSensors.cpp:39
void setOn(bool on)
Enable or disable sensor.
Definition CLIPSensors.cpp:35
bool hasURL() const
Check whether the sensor has a URL.
Definition CLIPSensors.cpp:56
void setBatteryState(int percent)
Set battery state.
Definition CLIPSensors.cpp:47
BaseCLIP(Sensor sensor)
Protected constructor to be used by subclasses.
Definition CLIPSensors.h:81
void setURL(const std::string &url)
Set sensor URL.
Definition CLIPSensors.cpp:64
std::string getURL() const
Get sensor URL.
Definition CLIPSensors.cpp:60
bool isOn() const
Check if sensor is on.
Definition CLIPSensors.cpp:30
int getBatteryState() const
Get battery state.
Definition CLIPSensors.cpp:43
time::AbsoluteTime getLastUpdated() const
Get time of last status update.
Definition CLIPSensors.cpp:69
bool isReachable() const
Check whether the sensor is reachable.
Definition CLIPSensors.cpp:51
CLIP sensor for a generic 3rd party sensor.
Definition CLIPSensors.h:246
CLIPGenericFlag(Sensor sensor)
Construct from generic sensor.
Definition CLIPSensors.h:249
void setFlag(bool flag)
Set flag.
Definition CLIPSensors.cpp:193
bool getFlag() const
Get boolean flag.
Definition CLIPSensors.cpp:189
static constexpr const char * typeStr
CLIPGenericFlag sensor type name.
Definition CLIPSensors.h:261
CLIP sensor for a generic 3rd party status.
Definition CLIPSensors.h:270
CLIPGenericStatus(Sensor sensor)
Construct from generic sensor.
Definition CLIPSensors.h:273
static constexpr const char * typeStr
CLIPGenericStatus sensor type name.
Definition CLIPSensors.h:285
void setStatus(int status)
Set sensor status.
Definition CLIPSensors.cpp:210
int getStatus() const
Get sensor status.
Definition CLIPSensors.cpp:205
CLIP sensor for humidity.
Definition CLIPSensors.h:172
CLIPHumidity(Sensor sensor)
Construct from generic sensor.
Definition CLIPSensors.h:175
void setHumidity(int humidity)
Set humidity.
Definition CLIPSensors.cpp:136
int getHumidity() const
Get measured humidity.
Definition CLIPSensors.cpp:132
static constexpr const char * typeStr
CLIPHumidity sensor type name.
Definition CLIPSensors.h:189
CLIP sensor for light level.
Definition CLIPSensors.h:196
int getThresholdOffset() const
Get offset over dark threshold to detect daylight.
Definition CLIPSensors.cpp:157
bool isDark() const
Check whether light level is below dark threshold.
Definition CLIPSensors.cpp:177
void setThresholdOffset(int offset)
Set offset to detect daylight.
Definition CLIPSensors.cpp:162
int getLightLevel() const
Get measured light level.
Definition CLIPSensors.cpp:167
void setDarkThreshold(int threshold)
Set threshold to detect darkness.
Definition CLIPSensors.cpp:153
int getDarkThreshold() const
Get threshold to detect darkness.
Definition CLIPSensors.cpp:148
static constexpr const char * typeStr
CLIPLightLevel sensor type name.
Definition CLIPSensors.h:239
bool isDaylight() const
Check whether light level is above light threshold.
Definition CLIPSensors.cpp:182
void setLightLevel(int level)
Set measured light level.
Definition CLIPSensors.cpp:172
CLIPLightLevel(Sensor sensor)
Construct from generic sensor.
Definition CLIPSensors.h:199
CLIP sensor detecting whether a contact is open or closed.
Definition CLIPSensors.h:106
static constexpr const char * typeStr
CLIPOpenClose sensor type name.
Definition CLIPSensors.h:123
void setOpen(bool open)
Set switch state.
Definition CLIPSensors.cpp:97
bool isOpen() const
Check whether the switch is open.
Definition CLIPSensors.cpp:93
CLIPOpenClose(Sensor sensor)
Construct from generic sensor.
Definition CLIPSensors.h:109
CLIP sensor to detect presence.
Definition CLIPSensors.h:130
CLIPPresence(Sensor sensor)
Construct from generic sensor.
Definition CLIPSensors.h:133
bool getPresence() const
Check whether presence was detected.
Definition CLIPSensors.cpp:110
static constexpr const char * typeStr
CLIPPresence sensor type name.
Definition CLIPSensors.h:145
void setPresence(bool presence)
Set presence state.
Definition CLIPSensors.cpp:114
CLIP sensor for button presses.
Definition CLIPSensors.h:86
static constexpr const char * typeStr
CLIPSwitch sensor type name.
Definition CLIPSensors.h:101
CLIPSwitch(Sensor sensor)
Construct from generic sensor.
Definition CLIPSensors.h:89
void setButtonEvent(int code)
Set the button event code.
Definition CLIPSensors.cpp:86
int getButtonEvent() const
Get the code of the last switch event.
Definition CLIPSensors.cpp:82
CLIP sensor for temperature.
Definition CLIPSensors.h:150
void setTemperature(int temperature)
Set temperature.
Definition CLIPSensors.cpp:125
int getTemperature() const
Get measured temperature.
Definition CLIPSensors.cpp:121
static constexpr const char * typeStr
CLIPTemperature sensor type name.
Definition CLIPSensors.h:167
CLIPTemperature(Sensor sensor)
Construct from generic sensor.
Definition CLIPSensors.h:153
One-time, absolute time point.
Definition TimePattern.h:73
detail::ConditionHelper< bool > makeCondition(const CLIPOpenClose &sensor)
Definition CLIPSensors.cpp:103
Namespace for the hueplusplus library.
Definition Action.h:28