Skip to content

Commit

Permalink
added targets speed and inclination
Browse files Browse the repository at this point in the history
  • Loading branch information
dudanov committed Jul 18, 2024
1 parent f2f9d7a commit c92750f
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion custom_components/ftms/number.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
NumberEntity,
NumberEntityDescription,
)
from homeassistant.const import UnitOfPower
from homeassistant.const import UnitOfPower, UnitOfSpeed
from homeassistant.core import HomeAssistant, callback
from homeassistant.helpers.entity_platform import AddEntitiesCallback
from pyftms.client import const as c
Expand All @@ -18,6 +18,18 @@

_LOGGER = logging.getLogger(__name__)

_SPEED = NumberEntityDescription(
key=c.TARGET_SPEED,
device_class=NumberDeviceClass.SPEED,
native_unit_of_measurement=UnitOfSpeed.KILOMETERS_PER_HOUR,
)

_INCLINATION = NumberEntityDescription(
key=c.TARGET_INCLINATION,
native_unit_of_measurement="%",
)


_RESISTANCE_LEVEL = NumberEntityDescription(
key=c.TARGET_RESISTANCE,
)
Expand All @@ -32,6 +44,8 @@
_ENTITIES = (
_RESISTANCE_LEVEL,
_POWER,
_SPEED,
_INCLINATION,
)


Expand Down

0 comments on commit c92750f

Please sign in to comment.