Limych / ha-narodmon

Component to integrate Narodmon cloud into Home Assistant
Other
26 stars 5 forks source link

Component error. Cannot setup on 2021.12 #53

Closed dronix27 closed 2 years ago

dronix27 commented 2 years ago

Environment

Describe the bug

The integration cannot setup on HA startup. There is an error in the log: Error occurred loading configuration flow for integration narodmon: cannot import name 'HTTP_OK' from 'homeassistant.const' (/usr/src/homeassistant/homeassistant/const.py)

Configuration.yaml


Add your configs here if any.
narodmon:
  apikey: !secret narodmon_apikey
  devices:
    - name: "Narodmon"

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

yarodin commented 2 years ago

Same story for Home Assistant 2021.12.3 "Setup failed for narodmon: Unable to import component: cannot import name 'HTTP_OK' from 'homeassistant.const' (/usr/src/homeassistant/homeassistant/const.py)"

alexsheyko commented 2 years ago

кому срочно, изменить

custom_components/narodmon/api.py

#from homeassistant.const import ATTR_ID, HTTP_OK
from homeassistant.const import ATTR_ID

                    #if resp.status != HTTP_OK:
                    if resp.status != 200:
Limych commented 2 years ago

Fixed in #46