diff --git a/applications/main/infrared/resources/infrared/assets/digital_sign.ir b/applications/main/infrared/resources/infrared/assets/digital_sign.ir index bfe058c54..7c7c81fef 100644 --- a/applications/main/infrared/resources/infrared/assets/digital_sign.ir +++ b/applications/main/infrared/resources/infrared/assets/digital_sign.ir @@ -76,30 +76,6 @@ address: 80 02 20 00 command: 70 00 00 00 # name: POWER -type: parsed -protocol: RC6 -address: 00 00 00 00 -command: 0C 00 00 00 -# -name: SOURCE -type: parsed -protocol: RC6 -address: 00 00 00 00 -command: 38 00 00 00 -# -name: PLAY -type: parsed -protocol: RC6 -address: 00 00 00 00 -command: 2C 00 00 00 -# -name: STOP -type: parsed -protocol: RC6 -address: 00 00 00 00 -command: 31 00 00 00 -# -name: POWER type: raw frequency: 38000 duty_cycle: 0.330000 diff --git a/scripts/fix_ir_universals.py b/scripts/fix_ir_universals.py new file mode 100755 index 000000000..e51687593 --- /dev/null +++ b/scripts/fix_ir_universals.py @@ -0,0 +1,40 @@ +#!/usr/bin/env python3 +import pathlib + +universals = ( + pathlib.Path(__file__).parent + / "../applications/main/infrared/resources/infrared/assets" +) + +for universal in universals.glob("*.ir"): + text = universal.read_text() + lines = text.splitlines() + signal = [] + comment = [] + signals = [] + for line in lines: + if line.startswith("#"): + comment.append(line) + continue + signal.append(line) + if line.startswith(("data: ", "command: ")): # Last line of this signal + signals.append(("\n".join(signal), "\n".join(comment))) + signal.clear() + comment.clear() + found = dict() + for signal, comment in signals: + if signal in found: + if ( + universal.stem == "projectors" + and found[signal] == 1 + and signal.startswith("name: Power") + ): + # Projectors need double press of power to confirm shutdown, so 1 dupe is fine + found[signal] += 1 + continue + replace = f"\n{comment}\n{signal}" + pos = text.rfind(replace) + text = text[:pos] + text[pos + len(replace) :] + continue + found[signal] = 1 + universal.write_text(text) diff --git a/scripts/fix_mfc_dict.py b/scripts/fix_mfc_dict.py old mode 100644 new mode 100755 index 3bdaf5c69..f89973d3c --- a/scripts/fix_mfc_dict.py +++ b/scripts/fix_mfc_dict.py @@ -1,3 +1,4 @@ +#!/usr/bin/env python3 import pathlib import string