Limych / ha-gismeteo

Gismeteo Weather Provider for Home Assistant
Other
117 stars 21 forks source link

Cannot setup on 2021.12 ( Unable to import component: cannot import name 'HTTP_OK' ...) #90

Closed ildar170975 closed 2 years ago

ildar170975 commented 2 years ago

Environment

Describe the bug

The integration cannot setup on HA startup. There is an error in the log:

Setup failed for gismeteo: Unable to import component: cannot import name 'HTTP_OK' from 'homeassistant.const' (/usr/src/homeassistant/homeassistant/const.py)

Configuration.yaml The integration is setup via UI.

Steps to Reproduce

Upgrade HA to 2021.12

Expected behavior

The integration is loaded on HA startup.

Debug log


Add your logs here.

Additional context

IgorAga commented 2 years ago

I've got the same problem after upgrading to 2021.12 last night. Configuration and error messages are exactly the same.

AlexeyHimki commented 2 years ago

same

Sacr87 commented 2 years ago

Same issue

HomeNV commented 2 years ago

I've got the same problem after upgrading to 2021.12.0

yuri-vashchenko commented 2 years ago

the same here

huligan575 commented 2 years ago

problem after upgrading to 2021.12.0

strelok15 commented 2 years ago

Quick temporary fix in api.py, similar as there Use http.HTTPStatus instead of const.HTTP_*

urikst commented 2 years ago

Workaround: api.py file, line 50, it was ATTR_NAME, HTTP_OK, STATE_UNKNOWN, ) became: ATTR_NAME, STATE_UNKNOWN, ) HTTP_OK = 200

ildar170975 commented 2 years ago

Quick temporary fix in api.py, similar as there Use http.HTTPStatus instead of const.HTTP_*

Can anyone help me to apply the fix? I am using HA in Docker.

baronrustamov commented 2 years ago

where is api.py file?

IgorAga commented 2 years ago

where is api.py file?

[HA root (location of configuration.yaml)]/custom_components/gismeteo/api.py

baronrustamov commented 2 years ago

it works, thank you

sivanikov commented 2 years ago

same error

ildar170975 commented 2 years ago

This fix helped me - https://github.com/Limych/ha-gismeteo/issues/90#issuecomment-991896750

232max232 commented 2 years ago

Error: File "/config/custom_components/gismeteo/api.py", line 53 HTTP_OK = 200

dezzzm commented 2 years ago

This fixes don't help me. error: Error occurred loading configuration flow for integration gismeteo: cannot import name 'HTTP_OK' from 'homeassistant.const' Home Assistant 2021.12.3

Limych commented 2 years ago

Fixed in #87