Types¶
Pydantic models for request payloads and API responses.
busylib.types
¶
BusySnapshotVariant
module-attribute
¶
BusySnapshotVariant = Annotated[BusySnapshotNotStarted | BusySnapshotInfinite | BusySnapshotSimple | BusySnapshotInterval, Field(discriminator='type')]
BusyTimerSettings
module-attribute
¶
BusyTimerSettings = Annotated[BusyTimerInfiniteSettings | BusyTimerSimpleSettings | BusySnapshotIntervalSettings, Field(discriminator='type')]
DisplayFontName
module-attribute
¶
DisplayFontName = Literal['tiny', 'small', 'normal', 'condensed', 'bold', 'large', 'extra_large', 'global']
DisplayElement
module-attribute
¶
DisplayElement = Annotated[TextElement | ImageElement | AnimationElement | CountdownElement | RectangleElement, Field(discriminator='type')]
BrightnessValue
module-attribute
¶
BrightnessValue = Annotated[int, Field(ge=0, le=100)] | Literal['auto']
BaseModel
¶
Bases: BaseModel
Base response model with domain-level validation error wrapping.
Any pydantic validation failure is converted into a BusyBar-specific exception so callers can rely on a stable error hierarchy.
model_validate
classmethod
¶
model_validate(obj: Any, *, strict: bool | None = None, from_attributes: bool | None = None, context: Any | None = None, by_alias: bool | None = None, by_name: bool | None = None, extra: Any | None = None) -> Any
Validate input object and convert schema errors to domain exceptions.
StrEnum
¶
Bases: str, Enum
Enum that serializes to its value.
This keeps JSON payloads aligned with API strings.
WifiIpMethod
¶
WifiIpType
¶
PowerState
¶
ElementType
¶
DisplayName
¶
InputEventState
¶
InputEvent
¶
SuccessResponse
¶
LogDumpResponse
¶
Bases: SuccessResponse
Response for POST /api/log_dump.
model_config is inherited from SuccessResponse (extra="ignore").
StatusDevice
¶
NetworkInterfaceInfo
¶
StatusPower
¶
DeviceNameUpdate
¶
DeviceTimeResponse
¶
TimezoneInfo
¶
TimezoneListResponse
¶
HttpAccessInfo
¶
TimestampInfo
¶
BusySnapshotNotStarted
¶
BusySnapshotInfinite
¶
BusySnapshotSimple
¶
BusySnapshot
¶
BusyTimerInfiniteSettings
¶
BusyTimerSimpleSettings
¶
BusyBarSettings
¶
AccountState
¶
AccountProfile
¶
AccountBackend
¶
AccountLink
¶
UpdateStatus
¶
UpdateChangelogResponse
¶
StorageFileElement
¶
StorageDirElement
¶
StorageList
¶
StorageStatus
¶
Bases: BaseModel
total
class-attribute
instance-attribute
¶
total: int | None = Field(default=None, alias='total_bytes')
used
class-attribute
instance-attribute
¶
used: int | None = Field(default=None, alias='used_bytes')
free
class-attribute
instance-attribute
¶
free: int | None = Field(default=None, alias='free_bytes')
model_config
class-attribute
instance-attribute
¶
model_config = ConfigDict(extra='ignore', populate_by_name=True)
DisplayElementBase
¶
TextElement
¶
Bases: DisplayElementBase
scroll_rate
class-attribute
instance-attribute
¶
scroll_rate: int | None = Field(default=None, ge=0)
scroll_start_delay
class-attribute
instance-attribute
¶
scroll_start_delay: int | None = Field(default=None, ge=0)
scroll_repeat_delay
class-attribute
instance-attribute
¶
scroll_repeat_delay: int | None = Field(default=None, ge=0)
ImageElement
¶
Bases: DisplayElementBase
AnimationElement
¶
Bases: DisplayElementBase
CountdownElement
¶
Bases: DisplayElementBase
RectangleElement
¶
Bases: DisplayElementBase
DisplayElements
¶
DisplayBrightnessUpdate
¶
AudioVolumeInfo
¶
AudioVolumeUpdate
¶
ConnectRequestConfig
¶
NetworkResponse
¶
ScreenResponse
¶
SmartHomePairingStatus
¶
SmartHomeSwitchState
¶
AccessTokensInfo
¶
AccessTokenMintRequest
¶
whole_volume
¶
whole_volume(value: float) -> int
Round a volume to the whole number the device requires.
The OpenAPI document says number, but the device rejects a decimal
point: ?volume=42 is accepted and ?volume=42.0 answers 400. Callers
may still pass a float, so it is rounded here - half up, not with
round, whose banker's rounding would send 42.5 as 42 and 55.5 as 56.