filipvh / hass-nhc2

Niko Home Control II Home Assistant Integration
MIT License
36 stars 26 forks source link

cannot import name 'TEMP_CELSIUS' from 'homeassistant.components.climate' #51

Open RubenPauwels1 opened 1 year ago

RubenPauwels1 commented 1 year ago

After upgrading to version 2023.1 of Home Assistant, the integration is getting an error in the logs.

Error:

Logger: homeassistant.config_entries
Source: custom_components/nhc2/coco_climate.py:7
Integration: Niko Home Control II (documentation, issues)
First occurred: 12:14:33 (1 occurrences)
Last logged: 12:14:33

Error setting up entry for nhc2
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 382, in async_setup
    result = await component.async_setup_entry(hass, self)
  File "/config/custom_components/nhc2/__init__.py", line 70, in async_setup_entry
    from .coco import CoCo
  File "/config/custom_components/nhc2/coco.py", line 16, in <module>
    from .coco_climate import CoCoThermostat
  File "/config/custom_components/nhc2/coco_climate.py", line 7, in <module>
    from homeassistant.components.climate import (
ImportError: cannot import name 'TEMP_CELSIUS' from 'homeassistant.components.climate' (/usr/src/homeassistant/homeassistant/components/climate/__init__.py)
RubenPauwels1 commented 1 year ago

There seems to be a fix in PR https://github.com/filipvh/hass-nhc2/pull/50

I can confirm, this fix is working on 2023.1.0

Filipdeclerck commented 1 year ago

Just upgrade HAS core and now I seem to have the same issue:

Deze fout is ontstaan door een aangepaste integratie.

Logger: homeassistant.config_entries Source: custom_components/nhc2/coco_climate.py:7 Integration: Niko Home Control II (documentation, issues) First occurred: 15:40:24 (2 occurrences) Last logged: 22:43:16

Error setting up entry hobby (192.168.1.XX) for nhc2

c Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/config_entries.py", line 382, in async_setup result = await component.async_setup_entry(hass, self) File "/config/custom_components/nhc2/__init__.py", line 70, in async_setup_entry from .coco import CoCo File "/config/custom_components/nhc2/coco.py", line 16, in <module> from .coco_climate import CoCoThermostat File "/config/custom_components/nhc2/coco_climate.py", line 7, in <module> from homeassistant.components.climate import ( ImportError: cannot import name 'TEMP_CELSIUS' from 'homeassistant.components.climate' (/usr/src/homeassistant/homeassistant/components/climate/__init__.py)

System Information

version core-2023.1.1
installation_type Home Assistant OS
dev false
hassio true
docker true
user root
virtualenv false
python_version 3.10.7
os_name Linux
os_version 5.15.76-v8
arch aarch64
timezone Europe/Brussels
config_dir /config
Home Assistant Community Store GitHub API | ok -- | -- GitHub Content | ok GitHub Web | ok GitHub API Calls Remaining | 4875 Installed Version | 1.29.1 Stage | running Available Repositories | 1267 Downloaded Repositories | 5
Home Assistant Cloud logged_in | false -- | -- can_reach_cert_server | ok can_reach_cloud_auth | ok can_reach_cloud | ok
Home Assistant Supervisor host_os | Home Assistant OS 9.4 -- | -- update_channel | stable supervisor_version | supervisor-2022.12.1 agent_version | 1.4.1 docker_version | 20.10.19 disk_total | 28.0 GB disk_used | 8.6 GB healthy | true supported | true board | rpi4-64 supervisor_api | ok version_api | ok installed_addons | File editor (5.4.2), VLC (0.1.3), Duck DNS (1.15.0), Spotify Connect (0.12.2), Terminal & SSH (9.6.1), Plex Media Server (3.2.0), GoSungrow (3.0.3), Google Assistant SDK (2.5.0), MQTT IO (0.1.3), Let's Encrypt (4.12.7), Matter Server (2.0.0), Grafana (8.1.0)
Dashboards dashboards | 2 -- | -- resources | 0 views | 5 mode | storage
Recorder oldest_recorder_run | 14 december 2022 om 08:30 -- | -- current_recorder_run | 7 januari 2023 om 23:07 estimated_db_size | 107.12 MiB database_engine | sqlite database_version | 3.38.5
Spotify api_endpoint_reachable | ok -- | --
blatruwe commented 1 year ago

I can confirm the commit in https://github.com/filipvh/hass-nhc2/pull/50 fixes the issue. Thanks @aureg

claesto commented 1 year ago

Another confirmation that #50 fixes the issue!