/// Map a ZCL level (0-254) onto an LEDC duty range, shared by every PWM
/// backend so they all sit on the same integer curve (a CCT and a dimmable
/// light at the same level must land on the same duty cycle, and any rounding
/// change happens in exactly one place).
pub
/// Resolve the electrical duty for a channel, honoring the wiring polarity.
///
/// `inverted = false` (default): active-high — duty grows with level, for a
/// low-side switch (N-MOSFET/transistor) or an LED wired GPIO-high = on.
/// `inverted = true`: sink drive — the GPIO sinks current directly from the
/// LED's cathode, so electrical duty is reversed (`max_duty` = dark, 0 = full
/// on) and "off" must park the pin high.
pub