Skip to content

Commit

Permalink
2022.12.5-2
Browse files Browse the repository at this point in the history
- Refactor variables from response
  • Loading branch information
craibo committed Dec 27, 2022
1 parent 5bd80e0 commit ee347f3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions custom_components/ha_strava/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,10 @@ def _sensor_summary_stats(self, summary_stats: dict) -> dict:
)
),
CONF_SENSOR_BIGGEST_RIDE_DISTANCE: float(
summary_stats.get(CONF_SENSOR_BIGGEST_RIDE_DISTANCE, 0)
summary_stats.get("biggest_ride_distance", 0)
),
CONF_SENSOR_BIGGEST_ELEVATION_GAIN: float(
summary_stats.get("biggest_climb_elevation_gain", 0)
),
},
},
Expand Down Expand Up @@ -390,9 +393,6 @@ def _sensor_summary_stats(self, summary_stats: dict) -> dict:
"moving_time", 0
)
),
CONF_SENSOR_BIGGEST_ELEVATION_GAIN: float(
summary_stats.get(CONF_SENSOR_BIGGEST_ELEVATION_GAIN, 0)
),
},
},
CONF_ACTIVITY_TYPE_SWIM: {
Expand Down
2 changes: 1 addition & 1 deletion custom_components/ha_strava/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ def suggested_unit_of_measurement(self):
@property
def name(self):
if self._metric == CONF_SENSOR_BIGGEST_ELEVATION_GAIN:
return "ALL Run Biggest Elevation Gain"
return "ALL Ride Biggest Elevation Gain"

if self._metric == CONF_SENSOR_BIGGEST_ELEVATION_GAIN:
return "ALL Ride Biggest Distance"
Expand Down

0 comments on commit ee347f3

Please sign in to comment.