Documentation
¶
Overview ¶
Package presentation defines BUSY Bar-specific plugin output and selection policy.
Index ¶
- Constants
- Variables
- func CompareBand(left, right Band) int
- func CompareImpact(left, right protocol.Impact) int
- func CompileAudio(applicationName string, cue ResolvedAudioCue) (busylib.PlayAudio, error)
- func CompileBusyTimer(theme string) error
- func CompileScene(applicationName string, priority int, scene ResolvedScene) (busylib.DisplayElements, error)
- func ValidateObservation(pluginID string, observation protocol.Observation, ...) error
- type AssetCompilerResolver
- type AudioCue
- type Band
- type Candidate
- type Decision
- type Element
- type History
- type Identity
- type Policy
- type PolicyConfig
- type ResolvedAudioCue
- type ResolvedElement
- type ResolvedScene
- type Scene
Constants ¶
const ( PolicyAttention = "attention" PolicyInteractive = "interactive" PolicyWhenRelevant = "when_relevant" PolicyRotation = "rotation" )
Variables ¶
var ErrInvalidPresentation = errors.New("invalid BUSY Bar presentation")
ErrInvalidPresentation identifies a deterministic presentation that cannot be represented by the supported BUSY Bar API.
Functions ¶
func CompareBand ¶
CompareBand compares daemon-owned semantic priority.
func CompareImpact ¶
CompareImpact compares the exact four provider impact levels.
func CompileAudio ¶
func CompileAudio(applicationName string, cue ResolvedAudioCue) (busylib.PlayAudio, error)
CompileAudio performs the pure resolved-cue to busylib translation.
func CompileBusyTimer ¶
CompileBusyTimer validates the firmware theme field through the authoritative busylib boundary without reading or mutating device state.
func CompileScene ¶
func CompileScene(applicationName string, priority int, scene ResolvedScene) (busylib.DisplayElements, error)
CompileScene performs the pure public-DSL to busylib translation used at publication and again at the device boundary. It never performs device I/O.
func ValidateObservation ¶
func ValidateObservation(pluginID string, observation protocol.Observation, resolver AssetCompilerResolver) error
ValidateObservation compiles every device-bound part of an observation without I/O. A successful return means the observation is representable by the supported busylib contract at publication time.
Types ¶
type AssetCompilerResolver ¶
type AssetCompilerResolver interface {
ResolveScene(string, Scene) (ResolvedScene, error)
ResolveAudioCue(string, AudioCue) (ResolvedAudioCue, error)
}
AssetCompilerResolver resolves authenticated package IDs and validated stock basenames without exposing physical paths to plugins.
type Band ¶
type Band string
Band is the daemon-derived semantic priority of one eligible candidate. Plugins choose neither the band nor its ordering.
type Candidate ¶
type Candidate struct {
PluginID string `json:"plugin_id"`
InstanceID string `json:"instance_id"`
Channel string `json:"channel"`
Key string `json:"key"`
Revision uint64 `json:"revision"`
Generation uint64 `json:"generation"`
Policy Policy `json:"policy"`
Band Band `json:"band"`
Impact protocol.Impact `json:"impact"`
AdmissionSequence uint64 `json:"admission_sequence"`
Reason string `json:"reason,omitempty"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
ExpiresAt time.Time `json:"expires_at,omitempty"`
HoldMS int `json:"hold_ms,omitempty"`
CooldownMS int `json:"cooldown_ms,omitempty"`
RequiresAck bool `json:"requires_ack,omitempty"`
Acknowledged bool `json:"acknowledged,omitempty"`
DevicePriority int `json:"device_priority,omitempty"`
Scene Scene `json:"scene,omitempty"`
BusyTimer *protocol.BusyTimerPresentation `json:"busy_timer,omitempty"`
AudioCue *protocol.AudioCue `json:"audio_cue,omitempty"`
}
Candidate is one plugin channel's current display offer.
func (Candidate) EffectiveDevicePriority ¶
EffectiveDevicePriority returns a validated policy default when no override exists.
type Decision ¶
type Decision struct {
Candidate *Candidate
}
Decision describes the current winner. A nil candidate means bsbctl should clear.
type Policy ¶
type Policy = string
Policy determines when a candidate may participate in display arbitration.
type PolicyConfig ¶
type PolicyConfig struct {
Policy string `json:"policy"`
DevicePriority int `json:"device_priority,omitempty"`
HoldMS int `json:"hold_ms,omitempty"`
CooldownMS int `json:"cooldown_ms,omitempty"`
RequiresAck bool `json:"requires_ack,omitempty"`
ActivationInput string `json:"activation_input,omitempty"`
ActivationAction string `json:"activation_action,omitempty"`
RotationIntervalMS int `json:"rotation_interval_ms,omitempty"`
RotationJitterPercent int `json:"rotation_jitter_percent,omitempty"`
}
PolicyConfig is daemon-owned arbitration policy for one plugin channel. It is never sent to a plugin process.
type ResolvedAudioCue ¶
func ResolveAudioCue ¶
func ResolveAudioCue(cue AudioCue) ResolvedAudioCue
type ResolvedElement ¶
ResolvedElement is a host-owned element whose logical asset may have been translated to a device path. Path never crosses the plugin wire boundary.
type ResolvedScene ¶
type ResolvedScene struct {
Elements []ResolvedElement `json:"elements"`
}
ResolvedScene is the host-owned form consumed by the device gateway.
func ResolveScene ¶
func ResolveScene(scene Scene) ResolvedScene
ResolveScene copies a public scene into the host-owned resolved form.