Skip to content

Commit

Permalink
v0.22
Browse files Browse the repository at this point in the history
  • Loading branch information
dudanov committed Oct 26, 2024
1 parent 329e199 commit 6d2ca22
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
4 changes: 2 additions & 2 deletions custom_components/ftms/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@
"integration_type": "device",
"iot_class": "local_push",
"issue_tracker": "https://github.com/dudanov/hassio-ftms/issues",
"requirements": ["pyftms==0.3.1"],
"version": "0.21"
"requirements": ["pyftms==0.3.2"],
"version": "0.22"
}
9 changes: 3 additions & 6 deletions custom_components/ftms/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -275,11 +275,6 @@
c.TIME_REMAINING: _TIME_REMAINING,
}

_DEFAULT_VALUES = {
c.MOVEMENT_DIRECTION: "forward",
TRAINING_STATUS: "idle",
}


async def async_setup_entry(
hass: HomeAssistant,
Expand Down Expand Up @@ -312,7 +307,9 @@ class FtmsSensorEntity(FtmsEntity, SensorEntity):
"""Representation of FTMS sensors."""

def __init__(self, entry, description) -> None:
self._attr_native_value = _DEFAULT_VALUES.get(description.key, 0)
if description.device_class != SensorDeviceClass.ENUM:
self._attr_native_value = 0

super().__init__(entry, description)

@callback
Expand Down

0 comments on commit 6d2ca22

Please sign in to comment.