cyberjunky / home-assistant-google_fit

:hearts: This component tracks your Google Fit activities.
MIT License
99 stars 20 forks source link

advise on error required #7

Closed scooper1 closed 2 years ago

scooper1 commented 3 years ago

i was using your integration from about a year ago - because hacs lost the custom directory i think i re-added the integration and this updated it and has broken please advise on how to fix

2021-04-29 00:56:21 ERROR (MainThread) [homeassistant.components.sensor] Error adding entities for domain sensor with platform google_fit
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 364, in async_add_entities
    await asyncio.gather(*tasks)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 558, in _async_add_entity
    await entity.add_to_platform_finish()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 581, in add_to_platform_finish
    self.async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 334, in async_write_ha_state
    self._async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 375, in _async_write_ha_state
    extra_state_attributes = self.device_state_attributes
  File "/config/custom_components/google_fit/sensor.py", line 247, in device_state_attributes
    return self._attributes
AttributeError: 'GoogleFitWeightSensor' object has no attribute '_attributes'
2021-04-29 00:56:21 ERROR (MainThread) [homeassistant.components.device_tracker] Error setting up platform legacy google_maps
2021-04-29 00:56:21 ERROR (MainThread) [homeassistant.components.sensor] google_fit: Error on device update!
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 407, in _async_add_entity
    await entity.async_device_update(warning=False)
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 516, in async_device_update
    await task
  File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/src/homeassistant/homeassistant/util/__init__.py", line 280, in wrapper
    result = method(*args, **kwargs)
  File "/usr/src/homeassistant/homeassistant/util/__init__.py", line 280, in wrapper
    result = method(*args, **kwargs)
  File "/config/custom_components/google_fit/sensor.py", line 428, in update
    heartrate_datasources = self._get_datasources('com.google.heart_rate.bpm')
  File "/config/custom_components/google_fit/sensor.py", line 272, in _get_datasources
    datasources_request = self._client.users().dataSources().list(
AttributeError: 'NoneType' object has no attribute 'users'
VeksKM commented 3 years ago

The same error (new installation): Traceback (most recent call last): File "/srv/homeassistant/lib/python3.8/site-packages/homeassistant/helpers/entity_platform.py", line 383, in async_add_entities await asyncio.gather(*tasks) File "/srv/homeassistant/lib/python3.8/site-packages/homeassistant/helpers/entity_platform.py", line 588, in _async_add_entity await entity.add_to_platform_finish() File "/srv/homeassistant/lib/python3.8/site-packages/homeassistant/helpers/entity.py", line 615, in add_to_platform_finish self.async_write_ha_state() File "/srv/homeassistant/lib/python3.8/site-packages/homeassistant/helpers/entity.py", line 368, in async_write_ha_state self._async_write_ha_state() File "/srv/homeassistant/lib/python3.8/site-packages/homeassistant/helpers/entity.py", line 409, in _async_write_ha_state extra_state_attributes = self.device_state_attributes File "/home/homeassistant/.homeassistant/custom_components/google_fit/sensor.py", line 247, in device_state_attributes return self._attributes AttributeError: 'GoogleFitWeightSensor' object has no attribute '_attributes'

cyberjunky commented 3 years ago

I will have a look

VeksKM commented 3 years ago

After a few days the problem disappeared.

Maharshi-Pathak commented 3 years ago

I am having the same issue.

harphere commented 3 years ago

Just added this integration tonight and experiencing the same error.

cyberjunky commented 2 years ago

Stale issue, please update to latest version and (re)open ticket if needed.