jacdac.button.client_base

Module Contents

Classes

ButtonClientBase

A push-button, which returns to inactive position when not operated anymore.

class jacdac.button.client_base.ButtonClientBase(bus: jacdac.bus.Bus, role: str, *, missing_pressure_value: float | None = None)

Bases: jacdac.bus.SensorClient

A push-button, which returns to inactive position when not operated anymore. Implements a client for the Button service.

property pressure: float | None

Indicates the pressure state of the button, where 0 is open., _: /

property analog: bool | None

(Optional) Indicates if the button provides analog pressure readings.,

on_down(handler: jacdac.bus.EventHandlerFn) jacdac.bus.UnsubscribeFn

Emitted when button goes from inactive to active.

on_up(handler: jacdac.bus.EventHandlerFn) jacdac.bus.UnsubscribeFn

Emitted when button goes from active to inactive. The ‘time’ parameter records the amount of time between the down and up events.

on_hold(handler: jacdac.bus.EventHandlerFn) jacdac.bus.UnsubscribeFn

Emitted when the press time is greater than 500ms, and then at least every 500ms as long as the button remains pressed. The ‘time’ parameter records the the amount of time that the button has been held (since the down event).