pamoja for TypeScript - v0.2.0
    Preparing search index...

    A profile assembled around the parts that make it run: each tick reads, lets the profile's policy decide, switches the output when the policy calls for it, and publishes the reading to the profile's topic. run repeats that at the cadence the profile's power schedule sets for the battery's charge.

    Index
    • Assembles a node.

      Parameters

      Returns profile.Node

      when the profile drives an output and no drive is given, or when its control kind is custom and no policy or registry decides it.

    profile: profile.Profile

    The profile the node runs.

    • get powerMode(): PowerMode | null

      The power mode the last schedule chose, or null before the first.

      Returns PowerMode | null

    • Ticks, then waits the interval the battery's charge calls for, until stopped.

      Parameters

      • Optionaloptions: profile.RunOptions

        when to stop, how to read the battery, and what to hear.

      Returns Promise<void>

      once the signal aborts or the ticks run out.

      the failure of a tick when no onError hears it.

    • Says what power mode the battery's charge puts the node in and how long to wait before the next tick. The node remembers the mode it chose, so a charge hovering at a threshold keeps the slower cadence until it clears the schedule's hysteresis.

      Parameters

      • charge: number

        the state of charge, from 0 to 1.

      • Optionalcharging: boolean

        whether the panel is delivering charge.

      Returns { mode: PowerMode; waitMs: number }

      the mode, and the wait in milliseconds.

    • Runs one read, decide, act, and publish cycle.

      Returns Promise<profile.Tick>

      the reading and what the policy decided about it.

      what the reading, the output, or the link throws.