Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error setting up Corona sensor sensor.sweden_coronavirus_current (Data for Sweden) #36599

Closed
HikingMike opened this issue Jun 9, 2020 · 8 comments · Fixed by #36614
Closed

Comments

@HikingMike
Copy link

The problem

Environment

  • Home Assistant Core release with the issue: 0.110.6
  • Last working Home Assistant Core release (if known): 0.110.4
  • Operating environment (Home Assistant/Supervised/Docker/venv): venv
  • Integration causing this issue:
  • Link to integration documentation on our website: https://www.home-assistant.io/integrations/coronavirus/

Problem-relevant configuration.yaml

Traceback/Error logs

Additional information

@HikingMike
Copy link
Author

Logginformation (ERROR)
Logger: homeassistant.components.sensor
Source: components/coronavirus/sensor.py:58
Integration: Sensor (documentation, issues)
First occurred: 11:45:22 (1 occurrences)
Last logged: 11:45:22

Error while setting up coronavirus platform for sensor
Traceback (most recent call last):
File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/helpers/entity_platform.py", line 186, in _async_setup_platform
await asyncio.gather(*pending)
File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/helpers/entity_platform.py", line 295, in async_add_entities
await asyncio.gather(*tasks)
File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/helpers/entity_platform.py", line 446, in _async_add_entity
entity.async_write_ha_state()
File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/helpers/entity.py", line 297, in async_write_ha_state
self._async_write_ha_state() # type: ignore
File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/helpers/entity.py", line 320, in _async_write_ha_state
state = self.state
File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/components/coronavirus/sensor.py", line 58, in state
return getattr(self.coordinator.data[self.country], self.info_type)
File "/srv/homeassistant/lib/python3.7/site-packages/coronavirus/init.py", line 25, in current
return self.confirmed - self.deaths - self.recovered
TypeError: unsupported operand type(s) for -: 'int' and 'NoneType'

@probot-home-assistant
Copy link

Hey there @home_assistant/core, mind taking a look at this issue as its been labeled with a integration (coronavirus) you are listed as a codeowner for? Thanks!
(message by CodeOwnersMention)

@probot-home-assistant
Copy link

coronavirus documentation
coronavirus source
(message by IssueLinks)

@papacrown
Copy link

I'm also getting this same error, I'm located in Mexico.

@airdrummingfool
Copy link

I'm having the same issue. I'm located in the US, but have sensors set up for Worldwide as well as US. The error only appears to affect a couple of my worldwide sensors - the rest seem to be updating just fine.

image

Error while setting up coronavirus platform for sensor
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 186, in _async_setup_platform
    await asyncio.gather(*pending)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 295, in async_add_entities
    await asyncio.gather(*tasks)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 446, in _async_add_entity
    entity.async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 297, in async_write_ha_state
    self._async_write_ha_state()  # type: ignore
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 320, in _async_write_ha_state
    state = self.state
  File "/usr/src/homeassistant/homeassistant/components/coronavirus/sensor.py", line 55, in state
    getattr(case, self.info_type) for case in self.coordinator.data.values()
  File "/usr/src/homeassistant/homeassistant/components/coronavirus/sensor.py", line 55, in <genexpr>
    getattr(case, self.info_type) for case in self.coordinator.data.values()
  File "/usr/local/lib/python3.7/site-packages/coronavirus/__init__.py", line 25, in current
    return self.confirmed - self.deaths - self.recovered
TypeError: unsupported operand type(s) for -: 'int' and 'NoneType'

@stickpin
Copy link
Contributor

stickpin commented Jun 10, 2020

Hi All,

After upgrading to the v0.111.0 issue still present.
Worldwide became partially broken.

Screenshot 2020-06-10 at 22 14 45

Screenshot 2020-06-10 at 22 15 03

In the log I see the following:

2020-06-10 22:07:48 ERROR (MainThread) [homeassistant.components.sensor] Error while setting up coronavirus platform for sensor
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 186, in _async_setup_platform
    await asyncio.gather(*pending)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 292, in async_add_entities
    await asyncio.gather(*tasks)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 443, in _async_add_entity
    entity.async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 297, in async_write_ha_state
    self._async_write_ha_state()  # type: ignore
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 320, in _async_write_ha_state
    state = self.state
  File "/usr/src/homeassistant/homeassistant/components/coronavirus/sensor.py", line 55, in state
    getattr(case, self.info_type) for case in self.coordinator.data.values()
TypeError: unsupported operand type(s) for +: 'int' and 'NoneType'

@HikingMike
Copy link
Author

Still problems after upgrading to 0.111.0... :-(
Does anybody know if this ticket can be re-opened?

@stickpin
Copy link
Contributor

@HikingMike I've raised a new issue: #36716
You can add your comments if you experiencing the same issues. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants