Skip to content

Commit

Permalink
v0.4.1 - fix training status
Browse files Browse the repository at this point in the history
  • Loading branch information
dudanov committed Oct 27, 2024
1 parent 6c736ba commit c83678a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 deletions.
21 changes: 11 additions & 10 deletions pyftms/client/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,15 +95,11 @@ def __init__(
self._data_updater = DataUpdater(self._data_model, self._on_event)
self._controller = MachineController(self._on_event)

@classmethod
def _get_supported_properties(
self, features: MachineFeatures = MachineFeatures(~0)
) -> tuple[str, ...]:
properties = self._data_model._get_features(features)

if self.training_status is not None:
properties.append(c.TRAINING_STATUS)

return tuple(properties)
cls, features: MachineFeatures = MachineFeatures(~0)
) -> list[str]:
return cls._data_model._get_features(features)

async def __aenter__(self):
await self.connect()
Expand Down Expand Up @@ -204,12 +200,17 @@ def supported_properties(self) -> tuple[str, ...]:
*May contain both meaningless properties and may not contain
some properties that are supported by the machine.*
"""
return self._get_supported_properties(self._m_features)
x = self._get_supported_properties(self._m_features)
if self.training_status is not None:
x.append(c.TRAINING_STATUS)
return tuple(x)

@cached_property
def available_properties(self) -> tuple[str, ...]:
"""All properties that *MAY BE* supported by this machine type."""
return self._get_supported_properties()
x = self._get_supported_properties()
x.append(c.TRAINING_STATUS)
return tuple(x)

@cached_property
def supported_settings(self) -> tuple[str, ...]:
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "pyftms"
version = "0.4.0"
version = "0.4.1"
description = "PyFTMS - Python Fitness Machine Service client library."
authors = ["Sergey V. DUDANOV <[email protected]>"]
readme = "README.md"
Expand Down

0 comments on commit c83678a

Please sign in to comment.