hd-toggle
on changeAn on/off switch bound to a boolean capability with bind (or the explicit form: value with data-hd-on-change).
| Attribute | What it is |
|---|---|
bind | The capability it is bound to, e.g. {{ settings.light.cap.dim }} (the whole capability, no .value): it shows its value, takes min, max and step from it, and sends changes back (shown at once, sprung back if refused, range checked). A device that is unavailable shows its last value, disabled. |
value | The explicit form instead of bind: what it shows, e.g. {{ cap.onoff.value }} (or a live capability, followed); a change only goes to data-hd-on-change, which decides what it does. Without a handler it can’t be changed. |
tone | Colour when on.One of lit, accent. Default lit. |
label | Accessible label. |
<hd-toggle bind="{{ cap.onoff }}" label="{{ device.name }}"></hd-toggle>