@@ -126,18 +126,18 @@ void parse_config() {
126126 if (entry [0 ] == 'S' && entry [1 ] == 'L' && entry [2 ] == 'P' ) {
127127 // Simultaneous Latching Pulses == SLP
128128 allow_simultaneous_latching_pulses = 1 ;
129- }else if (entry [0 ] == 'D' && entry [1 ] >= '0' && entry [1 ] <= '9' ) {
129+ } else if (entry [0 ] == 'D' && entry [1 ] >= '0' && entry [1 ] <= '9' ) {
130130 // D<N> sets the global debounce duration in milliseconds.
131131 debounce_ms = (uint16_t )parse_int (entry + 1 );
132132 for (int i = 0 ; i < buttons_cnt ; i ++ ) {
133133 buttons [i ].debounce_delay_ms = debounce_ms ;
134134 }
135- }else if (entry [0 ] == 'B' && entry [1 ] == 'T' ) {
135+ } else if (entry [0 ] == 'B' && entry [1 ] == 'T' ) {
136136 // Battery: BT<pin>, e.g. BTC5
137137 hal_gpio_pin_t pin = hal_gpio_parse_pin (entry + 2 );
138138 battery .pin = pin ;
139139 battery_init (& battery );
140- }else if (entry [0 ] == 'B' ) {
140+ } else if (entry [0 ] == 'B' ) {
141141 hal_gpio_pin_t pin = hal_gpio_parse_pin (entry + 1 );
142142 hal_gpio_pull_t pull = hal_gpio_parse_pull (entry + 3 );
143143 hal_gpio_init (pin , 1 , pull );
@@ -148,7 +148,7 @@ void parse_config() {
148148 buttons [buttons_cnt ].debounce_delay_ms = debounce_ms ;
149149 buttons [buttons_cnt ].on_long_press = on_reset_clicked ;
150150 buttons_cnt ++ ;
151- }else if (entry [0 ] == 'L' ) {
151+ } else if (entry [0 ] == 'L' ) {
152152 hal_gpio_pin_t pin = hal_gpio_parse_pin (entry + 1 );
153153 hal_gpio_init (pin , 0 , HAL_GPIO_PULL_NONE );
154154 leds [leds_cnt ].pin = pin ;
@@ -162,7 +162,7 @@ void parse_config() {
162162
163163 has_dedicated_status_led = true;
164164 leds_cnt ++ ;
165- }else if (entry [0 ] == 'I' ) {
165+ } else if (entry [0 ] == 'I' ) {
166166 hal_gpio_pin_t pin = hal_gpio_parse_pin (entry + 1 );
167167 hal_gpio_init (pin , 0 , HAL_GPIO_PULL_NONE );
168168 leds [leds_cnt ].pin = pin ;
@@ -192,7 +192,7 @@ void parse_config() {
192192 }
193193 }
194194 leds_cnt ++ ;
195- }else if (entry [0 ] == 'S' ) {
195+ } else if (entry [0 ] == 'S' ) {
196196 hal_gpio_pin_t pin = hal_gpio_parse_pin (entry + 1 );
197197 hal_gpio_pull_t pull = hal_gpio_parse_pull (entry + 3 );
198198 hal_gpio_init (pin , 1 , pull );
@@ -205,7 +205,6 @@ void parse_config() {
205205
206206 if (entry [3 ] == 'd' )
207207 buttons [buttons_cnt ].pressed_when_high = 1 ;
208-
209208 switch_clusters [switch_clusters_cnt ].switch_idx = switch_clusters_cnt ;
210209 switch_clusters [switch_clusters_cnt ].mode =
211210 ZCL_ONOFF_CONFIGURATION_SWITCH_TYPE_TOGGLE ;
@@ -218,10 +217,9 @@ void parse_config() {
218217 switch_clusters [switch_clusters_cnt ].relay_index = switch_clusters_cnt + 1 ;
219218 switch_clusters [switch_clusters_cnt ].button = & buttons [buttons_cnt ];
220219 switch_clusters [switch_clusters_cnt ].level_move_rate = 50 ;
221-
222220 buttons_cnt ++ ;
223221 switch_clusters_cnt ++ ;
224- }else if (entry [0 ] == 'R' ) {
222+ } else if (entry [0 ] == 'R' ) {
225223 hal_gpio_pin_t pin = hal_gpio_parse_pin (entry + 1 );
226224 hal_gpio_init (pin , 0 , HAL_GPIO_PULL_NONE );
227225
@@ -240,7 +238,7 @@ void parse_config() {
240238
241239 relays_cnt ++ ;
242240 relay_clusters_cnt ++ ;
243- }else if (entry [0 ] == 'X' ) {
241+ } else if (entry [0 ] == 'X' ) {
244242 hal_gpio_pin_t open_pin = hal_gpio_parse_pin (entry + 1 );
245243 hal_gpio_pin_t close_pin = hal_gpio_parse_pin (entry + 3 );
246244 hal_gpio_pull_t pull = hal_gpio_parse_pull (entry + 5 );
@@ -269,7 +267,7 @@ void parse_config() {
269267 cover_switch_clusters [cover_switch_clusters_cnt ].cover_switch_idx =
270268 cover_switch_clusters_cnt ;
271269 cover_switch_clusters_cnt ++ ;
272- }else if (entry [0 ] == 'C' ) {
270+ } else if (entry [0 ] == 'C' ) {
273271 hal_gpio_pin_t open_pin = hal_gpio_parse_pin (entry + 1 );
274272 hal_gpio_pin_t close_pin = hal_gpio_parse_pin (entry + 3 );
275273
@@ -290,15 +288,15 @@ void parse_config() {
290288 cover_clusters [cover_clusters_cnt ].close_relay = close_relay ;
291289 cover_clusters [cover_clusters_cnt ].cover_idx = cover_clusters_cnt ;
292290 cover_clusters_cnt ++ ;
293- }else if (entry [0 ] == 'i' ) {
291+ } else if (entry [0 ] == 'i' ) {
294292 uint32_t image_type = parse_int (entry + 1 );
295293 hal_zigbee_set_image_type (image_type );
296- }else if (entry [0 ] == 'M' ) {
294+ } else if (entry [0 ] == 'M' ) {
297295 for (int index = 0 ; index < switch_clusters_cnt ; index ++ ) {
298296 switch_clusters [index ].mode =
299297 ZCL_ONOFF_CONFIGURATION_SWITCH_TYPE_MOMENTARY ;
300298 }
301- }else if (entry [0 ] == 'E' ) {
299+ } else if (entry [0 ] == 'E' ) {
302300 hal_gpio_pin_t a_pin = hal_gpio_parse_pin (entry + 1 );
303301 hal_gpio_pull_t a_pull = hal_gpio_parse_pull (entry + 3 );
304302 hal_gpio_pin_t b_pin = hal_gpio_parse_pin (entry + 4 );
@@ -449,7 +447,7 @@ void network_indicator_on_network_status_change(
449447 network_indicator_connected (& network_indicator );
450448 update_switch_clusters ();
451449 update_relay_clusters ();
452- }else {
450+ } else {
453451 network_indicator_not_connected (& network_indicator );
454452 }
455453}
@@ -471,7 +469,7 @@ void peripherals_init() {
471469 network_indicator_connected (& network_indicator );
472470 update_switch_clusters ();
473471 update_relay_clusters ();
474- }else {
472+ } else {
475473 network_indicator_not_connected (& network_indicator );
476474 }
477475 hal_register_on_network_status_change_callback (
0 commit comments