Skip to content

Commit

Permalink
added docs
Browse files Browse the repository at this point in the history
  • Loading branch information
dudanov committed May 29, 2024
1 parent c3fcaa6 commit 23a5dd2
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 10 deletions.
17 changes: 15 additions & 2 deletions pyftms/client/backends/event.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

FtmsNumbers = int | float
ControlSource = Literal["callback", "user", "safety", "other"]
SimpleControlEvents = Literal["start", "stop", "pause", "reset"]
ControlEvents = Literal["start", "stop", "pause", "reset"]


class SpinDownEventData(TypedDict, total=False):
Expand Down Expand Up @@ -294,43 +294,56 @@ class TrainingStatusEventData(TypedDict):
"""`TrainingStatusEvent` data."""

code: TrainingStatusCode
"""Training Status Code."""
string: NotRequired[str]
"""Extended string."""


class TrainingStatusEvent(NamedTuple):
"""Training Status Event."""

event_id: Literal["training_status"]
"""Event ID: always `training_status`."""
event_data: TrainingStatusEventData
"""`TrainingStatusEvent` data."""


class UpdateEvent(NamedTuple):
"""Update Event."""

event_id: Literal["update"]
"""Event ID: always `update`."""
event_data: UpdateEventData
"""`UpdateEvent` data."""


class SpinDownEvent(NamedTuple):
"""Spin Down Procedure Event."""

event_id: Literal["spin_down"]
"""Event ID: always `spin_down`."""
event_data: SpinDownEventData
"""`SpinDownEvent` data."""


class SetupEvent(NamedTuple):
"""Setting Event."""

event_id: Literal["setup"]
"""Event ID: always `setup`."""
event_data: SetupEventData
"""`SetupEvent` data."""
event_source: ControlSource
"""Reason of event."""


class ControlEvent(NamedTuple):
"""Control Event."""

event_id: SimpleControlEvents
event_id: ControlEvents
"""Simple Event ID."""
event_source: ControlSource
"""Reason of event."""


FtmsEvents = (
Expand Down
16 changes: 8 additions & 8 deletions pyftms/client/properties/machine_type.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,23 +28,23 @@ class MachineType(Flag):
"""
Fitness Machine Type.
Included in the `Service Data AD Type`.
Included in the Advertisement Service Data.
Described in section `3.1.2: Fitness Machine Type Field`.
Described in section **3.1.2: Fitness Machine Type Field**.
"""

TREADMILL = auto()
"""Treadmill Supported"""
"""Treadmill Machine."""
CROSS_TRAINER = auto()
"""Cross Trainer Supported"""
"""Cross Trainer Machine."""
STEP_CLIMBER = auto()
"""Step Climber Supported"""
"""Step Climber Machine."""
STAIR_CLIMBER = auto()
"""Stair Climber Supported"""
"""Stair Climber Machine."""
ROWER = auto()
"""Rower Supported"""
"""Rower Machine."""
INDOOR_BIKE = auto()
"""Indoor Bike Supported"""
"""Indoor Bike Machine."""


class NotFitnessMachineError(Exception):
Expand Down

0 comments on commit 23a5dd2

Please sign in to comment.