Commit 1d7354c171b64646b9236c30c3ed8fafd4b472e6

Authored by Jan
Committed by Moritz Wirger
1 parent f225eaee

Apply documentation changes from code review

Co-authored-by: Moritz Wirger <lj.moritorii@web.de>
README.md
... ... @@ -11,6 +11,7 @@ A simple and easy to use library for Philips Hue Lights
11 11 * function to assign a username or set one manually
12 12 * all common light functions (brightness, color, temperature)
13 13 * extended alert() functions, which alert in a specific color (good for notifications)
  14 +* creating custom sensors and reading sensor values
14 15 * [documented with doxygen](https://enwi.github.io/hueplusplus/)
15 16 * tested with google test, google mock and gcov/lcov
16 17  
... ...
doc/markdown/Mainpage.md
... ... @@ -6,6 +6,7 @@ A simple and easy to use library for Philips Hue Lights.
6 6 * function to assign a username or set one manually
7 7 * all common light functions (brightness, color, temperature)
8 8 * extended alert() functions, which alert in a specific color (good for notifications)
  9 +* creating custom sensors and reading sensor values
9 10 * documented with doxygen
10 11 * tested with google test, google mock and gcov/lcov
11 12  
... ...
include/hueplusplus/CLIPSensors.h
... ... @@ -43,7 +43,7 @@ public:
43 43 //! \throws nlohmann::json::parse_error when response could not be parsed
44 44 void setOn(bool on);
45 45  
46   - //! \brief Get whether sensor has a battery state
  46 + //! \brief Check whether the sensor has a battery state
47 47 bool hasBatteryState() const;
48 48 //! \brief Get battery state
49 49 //! \returns Battery state in percent
... ... @@ -56,11 +56,11 @@ public:
56 56 //! \throws nlohmann::json::parse_error when response could not be parsed
57 57 void setBatteryState(int percent);
58 58  
59   - //! \brief Get whether sensor is reachable
  59 + //! \brief Check whether the sensor is reachable
60 60 //! \note Reachable verification is not implemented for CLIP sensors yet
61 61 bool isReachable() const;
62 62  
63   - //! \brief Get whether sensor has a URL
  63 + //! \brief Check whether the sensor has a URL
64 64 bool hasURL() const;
65 65 //! \brief Get sensor URL
66 66 std::string getURL() const;
... ... @@ -108,7 +108,7 @@ public:
108 108 //! \brief Construct from generic sensor
109 109 explicit CLIPOpenClose(Sensor sensor) : BaseCLIP(std::move(sensor)) { }
110 110  
111   - //! \brief Get whether switch is open
  111 + //! \brief Check whether the switch is open
112 112 bool isOpen() const;
113 113 //! \brief Set switch state
114 114 //!
... ... @@ -130,7 +130,7 @@ public:
130 130 //! \brief Construct from generic sensor
131 131 explicit CLIPPresence(Sensor sensor) : BaseCLIP(std::move(sensor)) { }
132 132  
133   - //! \brief Get whether presence was dtected
  133 + //! \brief Check whether presence was detected
134 134 bool getPresence() const;
135 135 //! \brief Set presence state
136 136 //! \throws std::system_error when system or socket operations fail
... ... @@ -176,7 +176,7 @@ public:
176 176 //! \returns Humidity in 0.01% steps
177 177 int getHumidity() const;
178 178 //! \brief Set humidity
179   - //! \param humidity Humidity in 0.01%
  179 + //! \param humidity Humidity in 0.01% steps
180 180 //! \throws std::system_error when system or socket operations fail
181 181 //! \throws HueException when response contained no body
182 182 //! \throws HueAPIResponseException when response contains an error
... ...
include/hueplusplus/Sensor.h
... ... @@ -67,9 +67,9 @@ public:
67 67 //!\name Config attributes
68 68 ///@{
69 69  
70   - //! \brief Get whether sensor has an on attribute
  70 + //! \brief Check whether the sensor has an on attribute
71 71 bool hasOn() const;
72   - //! \brief Get whether sensor is turned on
  72 + //! \brief check whether the sensor is turned on
73 73 //!
74 74 //! Sensors which are off do not change their status
75 75 //! \throws nlohmann::json::out_of_range when on attribute does not exist.
... ... @@ -81,7 +81,7 @@ public:
81 81 //! \throws nlohmann::json::parse_error when response could not be parsed
82 82 void setOn(bool on);
83 83  
84   - //! \brief Get whether sensor has a battery state
  84 + //! \brief Check whether the sensor has a battery state
85 85 bool hasBatteryState() const;
86 86 //! \brief Get battery state
87 87 //! \returns Battery state in percent
... ... @@ -94,7 +94,7 @@ public:
94 94 //! \throws nlohmann::json::parse_error when response could not be parsed
95 95 void setBatteryState(int percent);
96 96  
97   - //! \brief Get whether sensor has alerts
  97 + //! \brief Check whether the sensor has alerts
98 98 bool hasAlert() const;
99 99 //! \brief Get last sent alert
100 100 //! \note This is not cleared when the alert ends.
... ... @@ -107,13 +107,13 @@ public:
107 107 //! \throws nlohmann::json::parse_error when response could not be parsed
108 108 void sendAlert(Alert type);
109 109  
110   - //! \brief Get whether sensor has reachable validation
  110 + //! \brief Check whether the sensor has reachable validation
111 111 bool hasReachable() const;
112 112 //! \brief Get whether sensor is reachable
113 113 //! \throws nlohmann::json::out_of_range when sensor has no reachable validation
114 114 bool isReachable() const;
115 115  
116   - //! \brief Get whether sensor has user test mode
  116 + //! \brief Check whether the sensor has a user test mode
117 117 bool hasUserTest() const;
118 118 //! \brief Enable or disable user test mode
119 119 //!
... ... @@ -125,7 +125,7 @@ public:
125 125 //! \throws nlohmann::json::parse_error when response could not be parsed
126 126 void setUserTest(bool enabled);
127 127  
128   - //! \brief Get whether sensor has a URL
  128 + //! \brief Check whether the sensor has a URL
129 129 bool hasURL() const;
130 130 //! \brief Get sensor URL
131 131 //!
... ... @@ -145,7 +145,7 @@ public:
145 145 //! Attempts to set pending config entries may cause errors.
146 146 std::vector<std::string> getPendingConfig() const;
147 147  
148   - //! \brief Get whether the sensor has a LED indicator
  148 + //! \brief Check whether the sensor has an LED indicator
149 149 bool hasLEDIndication() const;
150 150 //! \brief Get whether the indicator LED is on
151 151 //! \throws nlohmann::json::out_of_range when sensor has no LED
... ... @@ -183,9 +183,9 @@ public:
183 183 //! The state can usually only be set on CLIP sensors, not on physical devices.
184 184 void setStateAttribute(const std::string& key, const nlohmann::json& value);
185 185  
186   - //! \brief Check if sensor is Hue certified
  186 + //! \brief Check if the sensor is Hue certified
187 187 bool isCertified() const;
188   - //! \brief Check if sensor is primary sensor of the device
  188 + //! \brief Check if the sensor is primary sensor of the device
189 189 //!
190 190 //! When there are multiple sensors on one physical device (same MAC address),
191 191 //! the primary device is used for the device information.
... ... @@ -270,7 +270,7 @@ public:
270 270 //! \brief Construct from generic sensor
271 271 explicit DaylightSensor(Sensor sensor) : BaseDevice(std::move(sensor)) { }
272 272  
273   - //! \brief Check if sensor is on
  273 + //! \brief Check if the sensor is on
274 274 //!
275 275 //! Sensors which are off do not change their status
276 276 bool isOn() const;
... ... @@ -282,7 +282,7 @@ public:
282 282 //! \throws nlohmann::json::parse_error when response could not be parsed
283 283 void setOn(bool on);
284 284  
285   - //! \brief Get whether sensor has a battery state
  285 + //! \brief Check whether the sensor has a battery state
286 286 bool hasBatteryState() const;
287 287 //! \brief Get battery state
288 288 //! \returns Battery state in percent
... ... @@ -333,7 +333,7 @@ public:
333 333 //! \throws nlohmann::json::parse_error when response could not be parsed
334 334 void setSunsetOffset(int minutes);
335 335  
336   - //! \brief Get reported daylight status
  336 + //! \brief Check whether it is daylight or not
337 337 bool isDaylight() const;
338 338  
339 339 //! \brief Get time of last status update
... ...
include/hueplusplus/ZLLSensors.h
... ... @@ -82,7 +82,7 @@ public:
82 82 //! \throws nlohmann::json::parse_error when response could not be parsed
83 83 void setOn(bool on);
84 84  
85   - //! \brief Get whether sensor has a battery state
  85 + //! \brief Check whether the sensor has a battery state
86 86 bool hasBatteryState() const;
87 87 //! \brief Get battery state
88 88 //! \returns Battery state in percent
... ... @@ -98,7 +98,7 @@ public:
98 98 //! \throws nlohmann::json::parse_error when response could not be parsed
99 99 void sendAlert(Alert type);
100 100  
101   - //! \brief Get whether sensor is reachable
  101 + //! \brief Check whether the sensor is reachable
102 102 bool isReachable() const;
103 103  
104 104 //! \brief Get the code of the last switch event.
... ... @@ -166,7 +166,7 @@ public:
166 166 //! \throws nlohmann::json::parse_error when response could not be parsed
167 167 void setOn(bool on);
168 168  
169   - //! \brief Get whether sensor has a battery state
  169 + //! \brief Check whether the sensor has a battery state
170 170 bool hasBatteryState() const;
171 171 //! \brief Get battery state
172 172 //! \returns Battery state in percent
... ... @@ -182,7 +182,7 @@ public:
182 182 //! \throws nlohmann::json::parse_error when response could not be parsed
183 183 void sendAlert(Alert type);
184 184  
185   - //! \brief Get whether sensor is reachable
  185 + //! \brief Check whether the sensor is reachable
186 186 bool isReachable() const;
187 187  
188 188 //! \brief Get sensor sensitivity
... ... @@ -223,7 +223,7 @@ public:
223 223 //! \throws nlohmann::json::parse_error when response could not be parsed
224 224 void setOn(bool on);
225 225  
226   - //! \brief Get whether sensor has a battery state
  226 + //! \brief Check whether the sensor has a battery state
227 227 bool hasBatteryState() const;
228 228 //! \brief Get battery state
229 229 //! \returns Battery state in percent
... ... @@ -239,7 +239,7 @@ public:
239 239 //! \throws nlohmann::json::parse_error when response could not be parsed
240 240 void sendAlert(Alert type);
241 241  
242   - //! \brief Get whether sensor is reachable
  242 + //! \brief Check whether the sensor is reachable
243 243 bool isReachable() const;
244 244  
245 245 //! \brief Get recorded temperature
... ... @@ -273,13 +273,13 @@ public:
273 273 //! \throws nlohmann::json::parse_error when response could not be parsed
274 274 void setOn(bool on);
275 275  
276   - //! \brief Get whether sensor has a battery state
  276 + //! \brief Check whether the sensor has a battery state
277 277 bool hasBatteryState() const;
278 278 //! \brief Get battery state
279 279 //! \returns Battery state in percent
280 280 int getBatteryState() const;
281 281  
282   - //! \brief Get whether sensor is reachable
  282 + //! \brief Check whether the sensor is reachable
283 283 bool isReachable() const;
284 284  
285 285 //! \brief Get threshold to detect darkness
... ...