Skip to content

project-arete/widget-library

Repository files navigation

Arete Widget Library

The online widget library for Arete Widget — plain YAML definitions of virtual widgets for CNS/CP realms, published as a static catalog that every copy of the app fetches on Reload:

Catalog: https://project-arete.github.io/widget-library/index.json

Add a widget here and it appears in everyone's Widget library — no app update required.

How it works

  • widgets/*.yaml — the definitions (see the format below).
  • On every PR and push, CI validates each definition against the live CP registry (cp.padi.io) with the same validator the app uses: the CP must exist, roles must be provider/consumer, every bound property must exist, and writes must match the role's side. An invalid definition fails the build and never reaches the catalog.
  • On merge to main, CI publishes index.json + the YAML files to GitHub Pages.

Contributing a widget

  1. Make sure the Connection Profile exists in the CP registry — the library refuses unregistered CPs by design.
  2. Copy an existing definition (widgets/bulb.yaml is the simplest; the trust and lease pairs show bigger faceplates) and adapt it.
  3. Check it locally: npm install && npm run build — your file must come out ✓.
  4. Open a PR. CI re-validates; merge publishes.

Definition format

widget: bulb                  # unique id slug
title: Virtual Bulb
description: A light being controlled.
capabilities:
  - profile: padi.light       # must exist at cp.padi.io/profiles/<name>
    role: consumer            # provider | consumer
view:                         # faceplate, top to bottom
  - { type: lamp,   bind: sOut, on: "1" }
  - { type: label,  bind: sLabel, caption: controller }
  - { type: value,  bind: cState, caption: reported state }
  # toggle (interactive on/off) and field (editable text) are also available —
  # only on properties this widget's role is allowed to write.
behavior:                     # optional auto-actualize
  init: { cState: "0" }       # puts issued once, when first created
  rules:
    - { when: sOut, set: cState }      # mirror (optional map: {"1":"on"})

Primitives: lamp, toggle, value, label, field.

Current widgets

Widget CP Role
Virtual Bulb / Virtual Switch padi.light consumer / provider
Trust Provider / Trust Consumer padi.trust.basic provider / consumer
OADR Controller / OADR Simple Device skycentrics.oadr3.event.simple provider / consumer
Lease Landlord / Lease Tenant padi.lease.basic provider / consumer

About

The online widget library for Arete Widget — YAML widget definitions validated against the cp.padi.io CP registry, published as a static catalog.

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors