File tree Expand file tree Collapse file tree 2 files changed +10
-10
lines changed
examples/MatterHumiditySensor Expand file tree Collapse file tree 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
3535const char *password = " your-password" ; // Change this to your WiFi password
3636
3737// 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
4141
4242// Simulate a humidity sensor - add your preferred humidity sensor library code here
4343float getSimulatedHumidity () {
@@ -98,7 +98,7 @@ void setup() {
9898
9999void loop () {
100100 static uint32_t timeCounter = 0 ;
101-
101+
102102 // Print the current humidity value every 5s
103103 if (!(timeCounter++ % 10 )) { // delaying for 500ms x 10 = 5s
104104 // Print the current humidity value
@@ -125,6 +125,6 @@ void loop() {
125125 Serial.println (" Decommissioning the Light Matter Accessory. It shall be commissioned again." );
126126 Matter.decommission ();
127127 }
128-
128+
129129 delay (500 );
130130}
Original file line number Diff line number Diff line change @@ -25,10 +25,10 @@ class MatterHumiditySensor : public MatterEndPoint {
2525 ~MatterHumiditySensor ();
2626 // begin Matter Humidity Sensor endpoint with initial float humidity percent
2727 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+ }
3232 return begin (static_cast <uint16_t >(humidityPercent * 100 .0f ));
3333 }
3434 // this will just stop processing Humidity Sensor Matter events
@@ -52,7 +52,7 @@ class MatterHumiditySensor : public MatterEndPoint {
5252 }
5353 // double conversion operator
5454 operator double () {
55- return (double ) getHumidity ();
55+ return (double )getHumidity ();
5656 }
5757
5858 // 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