Skip to content

Commit

Permalink
Merge pull request #190 from craibo/duration-formatting
Browse files Browse the repository at this point in the history
2024.12.0 Use int for times
  • Loading branch information
craibo authored Dec 18, 2024
2 parents d03e100 + 724922e commit 4f0f15b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
22 changes: 11 additions & 11 deletions custom_components/ha_strava/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -352,8 +352,8 @@ def _sensor_activity(self, activity: dict, geocode: str) -> dict:
activity.get("start_date_local", "2000-01-01T00:00:00Z"),
"%Y-%m-%dT%H:%M:%SZ",
),
CONF_SENSOR_ELAPSED_TIME: float(activity.get("elapsed_time", -1)),
CONF_SENSOR_MOVING_TIME: float(activity.get("moving_time", -1)),
CONF_SENSOR_ELAPSED_TIME: int(activity.get("elapsed_time", -1)),
CONF_SENSOR_MOVING_TIME: int(activity.get("moving_time", -1)),
CONF_SENSOR_KUDOS: int(activity.get("kudos_count", -1)),
CONF_SENSOR_CALORIES: int(
activity.get(
Expand Down Expand Up @@ -393,7 +393,7 @@ def _sensor_summary_stats(self, summary_stats: dict) -> dict:
"count", 0
)
),
CONF_SENSOR_MOVING_TIME: float(
CONF_SENSOR_MOVING_TIME: int(
summary_stats.get("recent_ride_totals", {"moving_time": 0}).get(
"moving_time", 0
)
Expand All @@ -416,7 +416,7 @@ def _sensor_summary_stats(self, summary_stats: dict) -> dict:
"count", 0
)
),
CONF_SENSOR_MOVING_TIME: float(
CONF_SENSOR_MOVING_TIME: int(
summary_stats.get("ytd_ride_totals", {"moving_time": 0}).get(
"moving_time", 0
)
Expand All @@ -439,7 +439,7 @@ def _sensor_summary_stats(self, summary_stats: dict) -> dict:
"count", 0
)
),
CONF_SENSOR_MOVING_TIME: float(
CONF_SENSOR_MOVING_TIME: int(
summary_stats.get("all_ride_totals", {"moving_time": 0}).get(
"moving_time", 0
)
Expand Down Expand Up @@ -470,7 +470,7 @@ def _sensor_summary_stats(self, summary_stats: dict) -> dict:
"count", 0
)
),
CONF_SENSOR_MOVING_TIME: float(
CONF_SENSOR_MOVING_TIME: int(
summary_stats.get("recent_run_totals", {"moving_time": 0}).get(
"moving_time", 0
)
Expand All @@ -493,7 +493,7 @@ def _sensor_summary_stats(self, summary_stats: dict) -> dict:
"count", 0
)
),
CONF_SENSOR_MOVING_TIME: float(
CONF_SENSOR_MOVING_TIME: int(
summary_stats.get("ytd_run_totals", {"moving_time": 0}).get(
"moving_time", 0
)
Expand All @@ -516,7 +516,7 @@ def _sensor_summary_stats(self, summary_stats: dict) -> dict:
"count", 0
)
),
CONF_SENSOR_MOVING_TIME: float(
CONF_SENSOR_MOVING_TIME: int(
summary_stats.get("all_run_totals", {"moving_time": 0}).get(
"moving_time", 0
)
Expand All @@ -541,7 +541,7 @@ def _sensor_summary_stats(self, summary_stats: dict) -> dict:
"count", 0
)
),
CONF_SENSOR_MOVING_TIME: float(
CONF_SENSOR_MOVING_TIME: int(
summary_stats.get("recent_swim_totals", {"moving_time": 0}).get(
"moving_time", 0
)
Expand All @@ -559,7 +559,7 @@ def _sensor_summary_stats(self, summary_stats: dict) -> dict:
"count", 0
)
),
CONF_SENSOR_MOVING_TIME: float(
CONF_SENSOR_MOVING_TIME: int(
summary_stats.get("ytd_swim_totals", {"moving_time": 0}).get(
"moving_time", 0
)
Expand All @@ -577,7 +577,7 @@ def _sensor_summary_stats(self, summary_stats: dict) -> dict:
"count", 0
)
),
CONF_SENSOR_MOVING_TIME: float(
CONF_SENSOR_MOVING_TIME: int(
summary_stats.get("all_swim_totals", {"moving_time": 0}).get(
"moving_time", 0
)
Expand Down
2 changes: 1 addition & 1 deletion custom_components/ha_strava/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@
"iot_class": "cloud_polling",
"issue_tracker": "https://github.com/craibo/ha_strava/issues",
"requirements": ["aiofiles>=23.2.1", "aiohttp>=3.9.5", "voluptuous>=0.11.7"],
"version": "3.2.39"
"version": "3.2.43"
}

0 comments on commit 4f0f15b

Please sign in to comment.