Commit 8a049f5
authored
Gree: Fix reporting vertical swing (crankyoldgit#2125)
toCommonSwingV() is only called when SwingAuto is false, but it converts kGreeSwingLastPos to kAuto. It doesn't make sense, because: 1. kGreeSwingLastPos means that swinging is stopped (i.e. the shutter remains in its last position), which corresponds to kOff. 2. kAuto shouldn't be returned from this function at all, because it's handled separately in toCommon() when SwingAuto is true. 3. As can be seen in setSwingVertical(), when automatic is false, the valid set of positions includes kGreeSwingLastPos, but not kGreeSwingAuto. Fix the logic by amending toCommonSwingV() according to the considerations above. It fixes parsing of received IR packets when the user disables vertical swinging from the remote (tested with YAP1FB). For consistency and robustness, educate setSwingVertical() and convertSwingV() about the supported kGreeSwingLastPos mode. Add a unit test for the described bug.1 parent 850a45f commit 8a049f5
2 files changed
+8
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
375 | 375 | | |
376 | 376 | | |
377 | 377 | | |
| 378 | + | |
378 | 379 | | |
379 | 380 | | |
380 | 381 | | |
| |||
503 | 504 | | |
504 | 505 | | |
505 | 506 | | |
| 507 | + | |
506 | 508 | | |
507 | 509 | | |
508 | 510 | | |
| |||
562 | 564 | | |
563 | 565 | | |
564 | 566 | | |
565 | | - | |
| 567 | + | |
566 | 568 | | |
567 | 569 | | |
568 | 570 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
701 | 701 | | |
702 | 702 | | |
703 | 703 | | |
| 704 | + | |
| 705 | + | |
| 706 | + | |
| 707 | + | |
| 708 | + | |
704 | 709 | | |
705 | 710 | | |
706 | 711 | | |
| |||
0 commit comments