Proposal: Infrared JavaScript Module for Flipper Zero
Following up on #4322 — I'd like to propose implementing the JavaScript Infrared module and would be willing to contribute a PR.
Scope:
infrared JS module wrapping the existing C IR API
- Send raw signals (timings array + frequency)
- Send protocol-based commands (NEC, Samsung, RC5, RC6, etc.)
- Send commands from saved
.ir files by name
- Optional: receive with timeout (polling-based)
Implementation Plan:
- Create
js_infrared.c following the pattern in js_gpio.c / js_serial.c
- Register module in the JS engine plugin system
- Expose
infrared_send_raw(), infrared_send() from the C API
- Add
.ir file parser for named command lookup
- Write documentation + example scripts
API Design:
let ir = require('infrared');
// Protocol-based
ir.send('NEC', 0x04, 0x08);
// From file
ir.sendFile('/ext/infrared/tv.ir', 'Power');
// Raw timings
ir.sendRaw([9000, 4500, 560, 560], 38000);
About Me:
Happy to discuss the approach or adapt to the team's preferred architecture.
Proposal: Infrared JavaScript Module for Flipper Zero
Following up on #4322 — I'd like to propose implementing the JavaScript Infrared module and would be willing to contribute a PR.
Scope:
infraredJS module wrapping the existing C IR API.irfiles by nameImplementation Plan:
js_infrared.cfollowing the pattern injs_gpio.c/js_serial.cinfrared_send_raw(),infrared_send()from the C API.irfile parser for named command lookupAPI Design:
About Me:
Happy to discuss the approach or adapt to the team's preferred architecture.