{
    "key": "led-5mm",
    "kind": "actuator",
    "model": {
        "aliases": [
            "led",
            "led-5mm",
            "indicator-led"
        ],
        "device_class": "light"
    },
    "driver": {
        "runtime": {
            "init": {
                "args": {
                    "chip": "{gpio_chip}",
                    "line": "{control_pin}",
                    "active_low": "{active_low}"
                },
                "class": "drivers.gpio_switch.GPIOSwitch"
            },
            "apt_packages": [
                "python3-libgpiod"
            ],
            "pip_packages": [
                "gpiod"
            ],
            "python_module": "drivers.gpio_switch"
        },
        "targets": [
            "raspberrypi"
        ],
        "verified": {
            "by": null,
            "os": null,
            "date": null,
            "board": null,
            "reviewed_by": null,
            "evidence_url": null
        },
        "interface": "gpio-digital",
        "connection": {
            "pins": [
                {
                    "role": "anode",
                    "notes": "Series resistor required between the pin and the anode. Size it for the forward voltage of the colour fitted, typically 220R at 3.3V for red and 100R for blue, green or white.",
                    "required": true
                },
                {
                    "role": "cathode",
                    "notes": "To ground. Use a PWM capable pin on the anode if brightness control is needed.",
                    "required": true
                }
            ],
            "supply_voltage": "3.3V or 5V through a series resistor",
            "level_shift_required": null
        },
        "constraints": {
            "warmup_seconds": null,
            "read_timeout_seconds": null,
            "min_read_interval_seconds": null
        },
        "failure_modes": [
            "A series resistor is mandatory on every anode. Without one the LED is across the full supply and either the die or the GPIO pin fails, usually within seconds and often silently at first.",
            "Sizing the resistor needs the forward voltage of that colour, which is not the same across colours. Red and yellow are around 2.0V, green blue and white around 3.0V to 3.4V. A resistor calculated for red run on a blue LED gives a dim output; one calculated for blue run on red overdrives it.",
            "Reversed polarity does not light and does not obviously fail. The longer leg is the anode. A flat on the rim marks the cathode.",
            "Continuous current above 20mA shortens life even where the LED still lights. Most GPIO pins are rated well below what a chain of LEDs draws, and the total across all pins has its own limit that is easy to exceed with a handful of indicators.",
            "Software PWM produces visible flicker on a loaded processor. Use a hardware PWM pin where the brightness matters."
        ]
    },
    "source": "authored",
    "status": "draft",
    "platform": {
        "name": "5mm LED",
        "states": [
            {
                "label": "On",
                "command": "ON",
                "payload": "ON",
                "parameter": null,
                "sort_order": 1,
                "description": "Turn the LED on at full brightness"
            },
            {
                "label": "Off",
                "command": "OFF",
                "payload": "OFF",
                "parameter": null,
                "sort_order": 2,
                "description": "Turn the LED off"
            },
            {
                "label": "Set Brightness",
                "command": "SET_BRIGHTNESS",
                "payload": "SET_BRIGHTNESS",
                "parameter": {
                    "name": "brightness",
                    "required": true,
                    "data_type": "integer",
                    "range_max": 100,
                    "range_min": 0,
                    "unit_symbol": "%"
                },
                "sort_order": 3,
                "description": "Set brightness by PWM duty cycle. Requires a PWM capable pin"
            },
            {
                "label": "Blink",
                "command": "BLINK",
                "payload": "BLINK",
                "parameter": {
                    "name": "interval",
                    "required": true,
                    "data_type": "float",
                    "range_max": 60,
                    "range_min": 0.1,
                    "unit_symbol": "s"
                },
                "sort_order": 4,
                "description": "Blink at a fixed interval until another command is issued"
            }
        ],
        "protocol": "gpio",
        "description": "Single colour through-hole LED driven from one GPIO pin. Requires a series current limiting resistor. Brightness control needs a PWM capable pin.",
        "manufacturer": null,
        "model_number": "LED-5MM",
        "actuator_type": "led",
        "datasheet_url": null,
        "command_topic_suffix": "command/led",
        "response_topic_suffix": "response/led"
    },
    "revision": 1
}