Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Infrared: Remove duplicates from Projectors universal remote #167

Merged
merged 11 commits into from
Jul 27, 2024

Conversation

Wemmy0
Copy link
Contributor

@Wemmy0 Wemmy0 commented Jul 18, 2024

What's new

Removed more duplicates from the Projectors.ir universal remote


For the reviewer

  • I've uploaded the firmware with this patch to a device and verified its functionality
  • I've confirmed the bug to be fixed / feature to be stable

@Willy-JL Willy-JL added the bugfix Something isn't working label Jul 18, 2024
Wemmy0 added 2 commits July 19, 2024 15:53
Add Amazon Basics Oscillate to universal `fans.ir`
Fix formatting error
@Wemmy0
Copy link
Contributor Author

Wemmy0 commented Jul 19, 2024

Only duplicates removed, nothing missing

Comparing files with python script:
original projectors.ir | new projectors.ir

Original: 197
New: 196
Only empty line missing

Process finished with exit code 0

Script used:

def parse_ir_file(path):
    with open(path, "r") as file:
        data = file.readlines()

    new = list(data)
    for line in data:
        if "name: " in line:
            break
        else:
            new.remove(line)
    return new


def process(ir):
    data = parse_ir_file(ir)
    codes = []
    temp = ()
    for line in data:
        if "#" in line:
            codes.append(temp)
            temp = ()
        else:
            temp += (line,)
    return list(set(codes))


old = process("original projectors.ir")
new = process("new projectors.ir")
print(f"Original: {len(old)}")
print(f"New: {len(new)}")
for i in old:
    if i not in new:
        if i:
            print("#### MISSING ####")
            for l in i:
                print(l, end='')
        else:
            print("Only empty line missing")

@Wemmy0
Copy link
Contributor Author

Wemmy0 commented Jul 19, 2024

Uploaded firmware to flipper and projectors.ir all works as expected but significantly faster.
Power command gone from taking 48s -> 22s (122 -> 65 codes)
IMG_7012
IMG_7015

Copy link
Member

@Willy-JL Willy-JL left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Crazy that there were so many duplicates, but it checks out. You missed one at the added section at the top, fixed it.

Thanks!

@Willy-JL Willy-JL merged commit 1d9336b into Next-Flip:dev Jul 27, 2024
2 checks passed
Willy-JL added a commit that referenced this pull request Jul 27, 2024
Willy-JL added a commit that referenced this pull request Jul 27, 2024
@Willy-JL
Copy link
Member

Willy-JL commented Jul 27, 2024

@Wemmy0 unleashed developer @xMasterX saw this and told me that duplicated signals are intentional: most projectors require 2 button presses to confirm shutdown. I reverted this PR, and only kept the new codes you had added, of which one is doubled for the same reason

@Wemmy0
Copy link
Contributor Author

Wemmy0 commented Jul 27, 2024

Ah that makes a lot of sense and explains why there where so many

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix Something isn't working
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants