diff --git a/README.md b/README.md index b7cd74b..0d908c1 100755 --- a/README.md +++ b/README.md @@ -11,6 +11,7 @@ A simple and easy to use library for Philips Hue Lights * function to assign a username or set one manually * all common light functions (brightness, color, temperature) * extended alert() functions, which alert in a specific color (good for notifications) +* creating custom sensors and reading sensor values * [documented with doxygen](https://enwi.github.io/hueplusplus/) * tested with google test, google mock and gcov/lcov diff --git a/doc/markdown/Mainpage.md b/doc/markdown/Mainpage.md index 78d7aab..dd2cdb7 100644 --- a/doc/markdown/Mainpage.md +++ b/doc/markdown/Mainpage.md @@ -6,6 +6,7 @@ A simple and easy to use library for Philips Hue Lights. * function to assign a username or set one manually * all common light functions (brightness, color, temperature) * extended alert() functions, which alert in a specific color (good for notifications) +* creating custom sensors and reading sensor values * documented with doxygen * tested with google test, google mock and gcov/lcov diff --git a/include/hueplusplus/CLIPSensors.h b/include/hueplusplus/CLIPSensors.h index 4b51ab6..080cd5a 100644 --- a/include/hueplusplus/CLIPSensors.h +++ b/include/hueplusplus/CLIPSensors.h @@ -43,7 +43,7 @@ public: //! \throws nlohmann::json::parse_error when response could not be parsed void setOn(bool on); - //! \brief Get whether sensor has a battery state + //! \brief Check whether the sensor has a battery state bool hasBatteryState() const; //! \brief Get battery state //! \returns Battery state in percent @@ -56,11 +56,11 @@ public: //! \throws nlohmann::json::parse_error when response could not be parsed void setBatteryState(int percent); - //! \brief Get whether sensor is reachable + //! \brief Check whether the sensor is reachable //! \note Reachable verification is not implemented for CLIP sensors yet bool isReachable() const; - //! \brief Get whether sensor has a URL + //! \brief Check whether the sensor has a URL bool hasURL() const; //! \brief Get sensor URL std::string getURL() const; @@ -108,7 +108,7 @@ public: //! \brief Construct from generic sensor explicit CLIPOpenClose(Sensor sensor) : BaseCLIP(std::move(sensor)) { } - //! \brief Get whether switch is open + //! \brief Check whether the switch is open bool isOpen() const; //! \brief Set switch state //! @@ -130,7 +130,7 @@ public: //! \brief Construct from generic sensor explicit CLIPPresence(Sensor sensor) : BaseCLIP(std::move(sensor)) { } - //! \brief Get whether presence was dtected + //! \brief Check whether presence was detected bool getPresence() const; //! \brief Set presence state //! \throws std::system_error when system or socket operations fail @@ -176,7 +176,7 @@ public: //! \returns Humidity in 0.01% steps int getHumidity() const; //! \brief Set humidity - //! \param humidity Humidity in 0.01% + //! \param humidity Humidity in 0.01% steps //! \throws std::system_error when system or socket operations fail //! \throws HueException when response contained no body //! \throws HueAPIResponseException when response contains an error diff --git a/include/hueplusplus/Sensor.h b/include/hueplusplus/Sensor.h index a070e8e..81fbfc6 100644 --- a/include/hueplusplus/Sensor.h +++ b/include/hueplusplus/Sensor.h @@ -67,9 +67,9 @@ public: //!\name Config attributes ///@{ - //! \brief Get whether sensor has an on attribute + //! \brief Check whether the sensor has an on attribute bool hasOn() const; - //! \brief Get whether sensor is turned on + //! \brief check whether the sensor is turned on //! //! Sensors which are off do not change their status //! \throws nlohmann::json::out_of_range when on attribute does not exist. @@ -81,7 +81,7 @@ public: //! \throws nlohmann::json::parse_error when response could not be parsed void setOn(bool on); - //! \brief Get whether sensor has a battery state + //! \brief Check whether the sensor has a battery state bool hasBatteryState() const; //! \brief Get battery state //! \returns Battery state in percent @@ -94,7 +94,7 @@ public: //! \throws nlohmann::json::parse_error when response could not be parsed void setBatteryState(int percent); - //! \brief Get whether sensor has alerts + //! \brief Check whether the sensor has alerts bool hasAlert() const; //! \brief Get last sent alert //! \note This is not cleared when the alert ends. @@ -107,13 +107,13 @@ public: //! \throws nlohmann::json::parse_error when response could not be parsed void sendAlert(Alert type); - //! \brief Get whether sensor has reachable validation + //! \brief Check whether the sensor has reachable validation bool hasReachable() const; //! \brief Get whether sensor is reachable //! \throws nlohmann::json::out_of_range when sensor has no reachable validation bool isReachable() const; - //! \brief Get whether sensor has user test mode + //! \brief Check whether the sensor has a user test mode bool hasUserTest() const; //! \brief Enable or disable user test mode //! @@ -125,7 +125,7 @@ public: //! \throws nlohmann::json::parse_error when response could not be parsed void setUserTest(bool enabled); - //! \brief Get whether sensor has a URL + //! \brief Check whether the sensor has a URL bool hasURL() const; //! \brief Get sensor URL //! @@ -145,7 +145,7 @@ public: //! Attempts to set pending config entries may cause errors. std::vector getPendingConfig() const; - //! \brief Get whether the sensor has a LED indicator + //! \brief Check whether the sensor has an LED indicator bool hasLEDIndication() const; //! \brief Get whether the indicator LED is on //! \throws nlohmann::json::out_of_range when sensor has no LED @@ -183,9 +183,9 @@ public: //! The state can usually only be set on CLIP sensors, not on physical devices. void setStateAttribute(const std::string& key, const nlohmann::json& value); - //! \brief Check if sensor is Hue certified + //! \brief Check if the sensor is Hue certified bool isCertified() const; - //! \brief Check if sensor is primary sensor of the device + //! \brief Check if the sensor is primary sensor of the device //! //! When there are multiple sensors on one physical device (same MAC address), //! the primary device is used for the device information. @@ -270,7 +270,7 @@ public: //! \brief Construct from generic sensor explicit DaylightSensor(Sensor sensor) : BaseDevice(std::move(sensor)) { } - //! \brief Check if sensor is on + //! \brief Check if the sensor is on //! //! Sensors which are off do not change their status bool isOn() const; @@ -282,7 +282,7 @@ public: //! \throws nlohmann::json::parse_error when response could not be parsed void setOn(bool on); - //! \brief Get whether sensor has a battery state + //! \brief Check whether the sensor has a battery state bool hasBatteryState() const; //! \brief Get battery state //! \returns Battery state in percent @@ -333,7 +333,7 @@ public: //! \throws nlohmann::json::parse_error when response could not be parsed void setSunsetOffset(int minutes); - //! \brief Get reported daylight status + //! \brief Check whether it is daylight or not bool isDaylight() const; //! \brief Get time of last status update diff --git a/include/hueplusplus/ZLLSensors.h b/include/hueplusplus/ZLLSensors.h index e45e3c5..210818e 100644 --- a/include/hueplusplus/ZLLSensors.h +++ b/include/hueplusplus/ZLLSensors.h @@ -82,7 +82,7 @@ public: //! \throws nlohmann::json::parse_error when response could not be parsed void setOn(bool on); - //! \brief Get whether sensor has a battery state + //! \brief Check whether the sensor has a battery state bool hasBatteryState() const; //! \brief Get battery state //! \returns Battery state in percent @@ -98,7 +98,7 @@ public: //! \throws nlohmann::json::parse_error when response could not be parsed void sendAlert(Alert type); - //! \brief Get whether sensor is reachable + //! \brief Check whether the sensor is reachable bool isReachable() const; //! \brief Get the code of the last switch event. @@ -166,7 +166,7 @@ public: //! \throws nlohmann::json::parse_error when response could not be parsed void setOn(bool on); - //! \brief Get whether sensor has a battery state + //! \brief Check whether the sensor has a battery state bool hasBatteryState() const; //! \brief Get battery state //! \returns Battery state in percent @@ -182,7 +182,7 @@ public: //! \throws nlohmann::json::parse_error when response could not be parsed void sendAlert(Alert type); - //! \brief Get whether sensor is reachable + //! \brief Check whether the sensor is reachable bool isReachable() const; //! \brief Get sensor sensitivity @@ -223,7 +223,7 @@ public: //! \throws nlohmann::json::parse_error when response could not be parsed void setOn(bool on); - //! \brief Get whether sensor has a battery state + //! \brief Check whether the sensor has a battery state bool hasBatteryState() const; //! \brief Get battery state //! \returns Battery state in percent @@ -239,7 +239,7 @@ public: //! \throws nlohmann::json::parse_error when response could not be parsed void sendAlert(Alert type); - //! \brief Get whether sensor is reachable + //! \brief Check whether the sensor is reachable bool isReachable() const; //! \brief Get recorded temperature @@ -273,13 +273,13 @@ public: //! \throws nlohmann::json::parse_error when response could not be parsed void setOn(bool on); - //! \brief Get whether sensor has a battery state + //! \brief Check whether the sensor has a battery state bool hasBatteryState() const; //! \brief Get battery state //! \returns Battery state in percent int getBatteryState() const; - //! \brief Get whether sensor is reachable + //! \brief Check whether the sensor is reachable bool isReachable() const; //! \brief Get threshold to detect darkness