Skip to content
This repository has been archived by the owner on Oct 31, 2023. It is now read-only.

Commit

Permalink
Changed Meditation units to Minutes
Browse files Browse the repository at this point in the history
  • Loading branch information
tomshaffner authored Dec 9, 2020
1 parent c3d2ea9 commit e4a07f5
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions custom_components/google_fit/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -771,7 +771,7 @@ def _name_suffix(self):
@property
def unit_of_measurement(self):
"""Returns the unit of measurement."""
return MEDITATION
return 'min'

@property
def icon(self):
Expand Down Expand Up @@ -805,9 +805,8 @@ def update(self):
start_time = datetime.fromtimestamp(round(min(starts) / 1000))
end_time = datetime.fromtimestamp(round(max(ends) / 1000))
total_meditation = sum(meditation,timedelta())
total_meditation=total_meditation-timedelta(microseconds=total_meditation.microseconds)
state_dict = dict({'first_start_time': str(start_time), 'last_end_time': str(end_time), 'total_meditation': str(total_meditation)})
self._state = str(total_meditation)
self._state = total_meditation.total_seconds() // 60
self._attributes = state_dict
self._last_updated = time.time()
else:
Expand Down

0 comments on commit e4a07f5

Please sign in to comment.