ir_prontoIR

Mock Jutsu HOW-TO | EN

The ir_pronto function within the mock-jutsu library is a specialized tool designed to generate realistic Infrared (IR) signals in the industry-standard Pronto Hex format. This format is widely recognized in the home automation and consumer electronics industries for representing IR codes as a series of hexadecimal values. When developers use mock-jutsu to create this specific type of test data, they receive a string that accurately mimics the structure of real-world remote control signals, including the preamble, carrier frequency, and burst pair sequences. By providing high-fidelity mock data, the library ensures that systems designed to parse or transmit IR signals can be validated without requiring physical hardware triggers during the initial stages of development.

Under the hood, the ir_pronto generator follows the strict architectural requirements of the Pronto Hex specification. It produces sequences that typically begin with the "0000" indicator for raw learned codes, followed by the frequency word and the lengths of the one-time and repeat bursts. This level of detail is crucial for developers building signal processing algorithms or smart home integration hubs. Using mock-jutsu allows for the rapid creation of diverse signal patterns, enabling teams to simulate various hardware brands and complex command structures. This versatility makes it an essential component for any testing suite focused on infrared communication protocols or IoT device interoperability where data integrity is paramount.

Testing scenarios for ir_pronto are vast, ranging from mobile apps that act as universal remotes to cloud-based IoT platforms that manage environmental controls. By integrating this function into a CI/CD pipeline via Python, CLI, or JMeter, engineers can automate the verification of signal decoders and database schemas that store remote codes. The primary benefit of using mock-jutsu for this purpose is the elimination of hardware bottlenecks; developers no longer need to manually capture codes from physical remotes to populate their test environments. Furthermore, the ability to generate consistent, valid test data on the fly reduces the risk of edge-case failures in production, ultimately accelerating the development lifecycle for smart technology projects while maintaining high standards of software quality.

CLI Usage
mockjutsu generate ir_prontomockjutsu bulk ir_pronto --count 10mockjutsu export ir_pronto --count 10 --format jsonmockjutsu export ir_pronto --count 10 --format csvmockjutsu export ir_pronto --count 10 --format sql
Python API
from mockjutsu import jutsujutsu.generate('ir_pronto')jutsu.bulk('ir_pronto', count=10)jutsu.template(['ir_pronto'], count=5)
JMeter
${__mockjutsu_iot(ir_pronto)}# JMeter Function: __mockjutsu_iot# Parameter 1: ir_pronto# Parameter 2: (not required for this function)
REST API
GET /generate/ir_pronto# → {"type":"ir_pronto","result":"...","status":"ok"}GET /bulk/ir_pronto?count=10POST /template {"types":["ir_pronto"],"count":1}

Other Languages