Skip to content

Commit db0062a

Browse files
SuGliderCopilot
andauthored
fix(matter): better variable name
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 77d3fda commit db0062a

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

libraries/Matter/examples/MatterWindowCovering/MatterWindowCovering.ino

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -331,18 +331,18 @@ void loop() {
331331
if (digitalRead(buttonPin) == HIGH && button_state && time_diff > debounceTime) {
332332
// Button is released - cycle lift percentage by 20%
333333
button_state = false; // released
334-
uint8_t myTargetLiftPercent = currentLiftPercent;
334+
uint8_t targetLiftPercent = currentLiftPercent;
335335
// go to the closest next 20% or move 20% more
336-
if ((myTargetLiftPercent % 20) != 0) {
337-
myTargetLiftPercent = ((myTargetLiftPercent / 20) + 1) * 20;
336+
if ((targetLiftPercent % 20) != 0) {
337+
targetLiftPercent = ((targetLiftPercent / 20) + 1) * 20;
338338
} else {
339-
myTargetLiftPercent += 20;
339+
targetLiftPercent += 20;
340340
}
341-
if (myTargetLiftPercent > 100) {
342-
myTargetLiftPercent = 0;
341+
if (targetLiftPercent > 100) {
342+
targetLiftPercent = 0;
343343
}
344-
Serial.printf("User button released. Setting lift to %d%%\r\n", myTargetLiftPercent);
345-
WindowBlinds.setTargetLiftPercent100ths(myTargetLiftPercent * 100);
344+
Serial.printf("User button released. Setting lift to %d%%\r\n", targetLiftPercent);
345+
WindowBlinds.setTargetLiftPercent100ths(targetLiftPercent * 100);
346346
}
347347

348348
// Onboard User Button is kept pressed for longer than 5 seconds in order to decommission matter node

0 commit comments

Comments
 (0)