File tree 2 files changed +10
-10
lines changed
examples/MatterHumiditySensor
2 files changed +10
-10
lines changed Original file line number Diff line number Diff line change @@ -35,9 +35,9 @@ const char *ssid = "your-ssid"; // Change this to your WiFi SSID
35
35
const char *password = " your-password" ; // Change this to your WiFi password
36
36
37
37
// Button control - decommision the Matter Node
38
- uint32_t button_time_stamp = 0 ; // debouncing control
39
- bool button_state = false ; // false = released | true = pressed
40
- const uint32_t decommissioningTimeout = 5000 ; // keep the button pressed for 5s, or longer, to decommission
38
+ uint32_t button_time_stamp = 0 ; // debouncing control
39
+ bool button_state = false ; // false = released | true = pressed
40
+ const uint32_t decommissioningTimeout = 5000 ; // keep the button pressed for 5s, or longer, to decommission
41
41
42
42
// Simulate a humidity sensor - add your preferred humidity sensor library code here
43
43
float getSimulatedHumidity () {
@@ -98,7 +98,7 @@ void setup() {
98
98
99
99
void loop () {
100
100
static uint32_t timeCounter = 0 ;
101
-
101
+
102
102
// Print the current humidity value every 5s
103
103
if (!(timeCounter++ % 10 )) { // delaying for 500ms x 10 = 5s
104
104
// Print the current humidity value
@@ -125,6 +125,6 @@ void loop() {
125
125
Serial.println (" Decommissioning the Light Matter Accessory. It shall be commissioned again." );
126
126
Matter.decommission ();
127
127
}
128
-
128
+
129
129
delay (500 );
130
130
}
Original file line number Diff line number Diff line change @@ -25,10 +25,10 @@ class MatterHumiditySensor : public MatterEndPoint {
25
25
~MatterHumiditySensor ();
26
26
// begin Matter Humidity Sensor endpoint with initial float humidity percent
27
27
bool begin (double humidityPercent = 0.00 ) {
28
- if (humidityPercent < 0.0 || humidityPercent > 100.0 ) {
29
- log_e (" Humidity Sensor Percentage value out of range [0..100]." );
30
- return false ;
31
- }
28
+ if (humidityPercent < 0.0 || humidityPercent > 100.0 ) {
29
+ log_e (" Humidity Sensor Percentage value out of range [0..100]." );
30
+ return false ;
31
+ }
32
32
return begin (static_cast <uint16_t >(humidityPercent * 100 .0f ));
33
33
}
34
34
// this will just stop processing Humidity Sensor Matter events
@@ -52,7 +52,7 @@ class MatterHumiditySensor : public MatterEndPoint {
52
52
}
53
53
// double conversion operator
54
54
operator double () {
55
- return (double ) getHumidity ();
55
+ return (double )getHumidity ();
56
56
}
57
57
58
58
// this function is called by Matter internal event processor. It could be overwritten by the application, if necessary.
You can’t perform that action at this time.
0 commit comments