22#ifndef INCLUDE_HUEPLUSPLUS_ZLL_SENSORS_H
23#define INCLUDE_HUEPLUSPLUS_ZLL_SENSORS_H
64 static constexpr const char*
typeStr =
"ZGPSwitch";
148 static constexpr const char*
typeStr =
"ZLLSwitch";
205 static constexpr const char*
typeStr =
"ZLLPresence";
255 static constexpr const char*
typeStr =
"ZLLTemperature";
320 static constexpr const char*
typeStr =
"ZLLLightLevel";
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
ZigBee Green Power sensor for button presses.
Definition ZLLSensors.h:33
bool isOn() const
Check if sensor is on.
Definition ZLLSensors.cpp:37
static constexpr int c_button1
Code for tap button 1.
Definition ZLLSensors.h:55
int getButtonEvent() const
Get the code of the last switch event.
Definition ZLLSensors.cpp:47
static constexpr int c_button2
Code for tap button 2.
Definition ZLLSensors.h:57
static constexpr int c_button4
Code for tap button 4.
Definition ZLLSensors.h:61
static constexpr int c_button3
Code for tap button 3.
Definition ZLLSensors.h:59
static constexpr const char * typeStr
ZGPSwitch sensor type name.
Definition ZLLSensors.h:64
void setOn(bool on)
Enable or disable sensor.
Definition ZLLSensors.cpp:42
ZGPSwitch(Sensor sensor)
Construct from generic sensor.
Definition ZLLSensors.h:36
ZigBee sensor detecting ambient light level.
Definition ZLLSensors.h:260
ZLLLightLevel(Sensor sensor)
Construct from generic sensor.
Definition ZLLSensors.h:263
int getDarkThreshold() const
Get threshold to detect darkness.
Definition ZLLSensors.cpp:252
bool isDaylight() const
Check whether light level is above light threshold.
Definition ZLLSensors.cpp:281
time::AbsoluteTime getLastUpdated() const
Get time of last status update.
Definition ZLLSensors.cpp:286
void setThresholdOffset(int offset)
Set offset to detect daylight.
Definition ZLLSensors.cpp:266
bool isDark() const
Check whether light level is below dark threshold.
Definition ZLLSensors.cpp:276
int getBatteryState() const
Get battery state.
Definition ZLLSensors.cpp:244
bool isReachable() const
Check whether the sensor is reachable.
Definition ZLLSensors.cpp:248
int getThresholdOffset() const
Get offset over dark threshold to detect daylight.
Definition ZLLSensors.cpp:261
void setOn(bool on)
Enable or disable sensor.
Definition ZLLSensors.cpp:236
bool hasBatteryState() const
Check whether the sensor has a battery state.
Definition ZLLSensors.cpp:240
bool isOn() const
Check if sensor is on.
Definition ZLLSensors.cpp:231
static constexpr const char * typeStr
ZLLLightLevel sensor type name.
Definition ZLLSensors.h:320
void setDarkThreshold(int threshold)
Set threshold to detect darkness.
Definition ZLLSensors.cpp:257
int getLightLevel() const
Get measured light level.
Definition ZLLSensors.cpp:271
Sensor detecting presence in the vicinity.
Definition ZLLSensors.h:153
void setSensitivity(int sensitivity)
Set sensor sensitivity.
Definition ZLLSensors.cpp:159
ZLLPresence(Sensor sensor)
Construct from generic sensor.
Definition ZLLSensors.h:156
bool isOn() const
Check if sensor is on.
Definition ZLLSensors.cpp:119
time::AbsoluteTime getLastUpdated() const
Get time of last status update.
Definition ZLLSensors.cpp:168
static constexpr const char * typeStr
ZLLPresence sensor type name.
Definition ZLLSensors.h:205
bool isReachable() const
Check whether the sensor is reachable.
Definition ZLLSensors.cpp:146
void sendAlert(Alert type)
Send alert.
Definition ZLLSensors.cpp:142
Alert getLastAlert() const
Get last sent alert.
Definition ZLLSensors.cpp:137
int getBatteryState() const
Get battery state.
Definition ZLLSensors.cpp:132
bool getPresence() const
Get presence status.
Definition ZLLSensors.cpp:163
int getMaxSensitivity() const
Get maximum sensitivity.
Definition ZLLSensors.cpp:155
bool hasBatteryState() const
Check whether the sensor has a battery state.
Definition ZLLSensors.cpp:128
void setOn(bool on)
Enable or disable sensor.
Definition ZLLSensors.cpp:124
int getSensitivity() const
Get sensor sensitivity.
Definition ZLLSensors.cpp:151
ZigBee sensor reporting button presses.
Definition ZLLSensors.h:69
void setOn(bool on)
Enable or disable sensor.
Definition ZLLSensors.cpp:75
int getBatteryState() const
Get battery state.
Definition ZLLSensors.cpp:83
static constexpr int c_OFF_SHORT_RELEASED
Button 4 (OFF) released short press.
Definition ZLLSensors.h:143
static constexpr int c_OFF_LONG_RELEASED
Button 4 (OFF) released long press.
Definition ZLLSensors.h:145
time::AbsoluteTime getLastUpdated() const
Get time of last status update.
Definition ZLLSensors.cpp:106
static constexpr int c_DOWN_HOLD
Button 3 (DIM DOWN) held.
Definition ZLLSensors.h:133
static constexpr int c_DOWN_LONG_RELEASED
Button 3 (DIM DOWN) released long press.
Definition ZLLSensors.h:137
static constexpr int c_ON_LONG_RELEASED
Button 1 (ON) released long press.
Definition ZLLSensors.h:121
Alert getLastAlert() const
Get last sent alert.
Definition ZLLSensors.cpp:88
static constexpr int c_DOWN_SHORT_RELEASED
Button 3 (DIM DOWN) released short press.
Definition ZLLSensors.h:135
bool hasBatteryState() const
Check whether the sensor has a battery state.
Definition ZLLSensors.cpp:79
static constexpr int c_ON_INITIAL_PRESS
Button 1 (ON) pressed.
Definition ZLLSensors.h:115
void sendAlert(Alert type)
Send alert.
Definition ZLLSensors.cpp:93
static constexpr int c_ON_SHORT_RELEASED
Button 1 (ON) released short press.
Definition ZLLSensors.h:119
static constexpr int c_OFF_INITIAL_PRESS
Button 4 (OFF) pressed.
Definition ZLLSensors.h:139
static constexpr int c_UP_SHORT_RELEASED
Button 2 (DIM UP) released short press.
Definition ZLLSensors.h:127
ZLLSwitch(Sensor sensor)
Construct from generic sensor.
Definition ZLLSensors.h:72
static constexpr int c_DOWN_INITIAL_PRESS
Button 3 (DIM DOWN) pressed.
Definition ZLLSensors.h:131
static constexpr int c_UP_LONG_RELEASED
Button 2 (DIM UP) released long press.
Definition ZLLSensors.h:129
bool isOn() const
Check if sensor is on.
Definition ZLLSensors.cpp:70
static constexpr int c_OFF_HOLD
Button 4 (OFF) held.
Definition ZLLSensors.h:141
static constexpr const char * typeStr
ZLLSwitch sensor type name.
Definition ZLLSensors.h:148
static constexpr int c_ON_HOLD
Button 1 (ON) held.
Definition ZLLSensors.h:117
bool isReachable() const
Check whether the sensor is reachable.
Definition ZLLSensors.cpp:97
static constexpr int c_UP_HOLD
Button 2 (DIM UP) held.
Definition ZLLSensors.h:125
int getButtonEvent() const
Get the code of the last switch event.
Definition ZLLSensors.cpp:101
static constexpr int c_UP_INITIAL_PRESS
Button 2 (DIM UP) pressed.
Definition ZLLSensors.h:123
ZigBee temperature sensor.
Definition ZLLSensors.h:210
bool hasBatteryState() const
Check whether the sensor has a battery state.
Definition ZLLSensors.cpp:190
bool isReachable() const
Check whether the sensor is reachable.
Definition ZLLSensors.cpp:208
void sendAlert(Alert type)
Send alert.
Definition ZLLSensors.cpp:204
Alert getLastAlert() const
Get last sent alert.
Definition ZLLSensors.cpp:199
int getBatteryState() const
Get battery state.
Definition ZLLSensors.cpp:194
ZLLTemperature(Sensor sensor)
Construct from generic sensor.
Definition ZLLSensors.h:213
void setOn(bool on)
Enable or disable sensor.
Definition ZLLSensors.cpp:186
static constexpr const char * typeStr
ZLLTemperature sensor type name.
Definition ZLLSensors.h:255
time::AbsoluteTime getLastUpdated() const
Get time of last status update.
Definition ZLLSensors.cpp:218
int getTemperature() const
Get recorded temperature.
Definition ZLLSensors.cpp:213
bool isOn() const
Check if sensor is on.
Definition ZLLSensors.cpp:181
One-time, absolute time point.
Definition TimePattern.h:73
detail::ConditionHelper< int > makeConditionLightLevel(const ZLLLightLevel &sensor)
Definition ZLLSensors.cpp:307
detail::ConditionHelper< bool > makeConditionDark(const ZLLLightLevel &sensor)
Definition ZLLSensors.cpp:297
detail::ConditionHelper< bool > makeConditionDaylight(const ZLLLightLevel &sensor)
Definition ZLLSensors.cpp:302
Namespace for the hueplusplus library.
Definition Action.h:28
Alert
Specifies light alert modes.
Definition Sensor.h:39