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

Import Error on upgrade to Python3.8 #13

Open
tinstep opened this issue Nov 21, 2019 · 8 comments
Open

Import Error on upgrade to Python3.8 #13

tinstep opened this issue Nov 21, 2019 · 8 comments

Comments

@tinstep
Copy link

tinstep commented Nov 21, 2019

Hi
After upgrade to 0.102.0 Home Assistant and python upgrade to 3.8 (from 3.6), I got the following error in the logs and the climate_ip component is unavailable.
It cant import 'ATTR_HVAC_ACTIONS'

2019-11-21 15:54:40 WARNING (MainThread) [homeassistant.loader] You are using a custom integration for climate_ip which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you do experience issues with Home Assistant.                                                                                                                            
2019-11-21 15:54:40 ERROR (MainThread) [homeassistant.config] Platform error: climate                                                                                                                   
Traceback (most recent call last):                                                                                                                                                                      
  File "/srv/homeassistant/lib/python3.8/site-packages/homeassistant/config.py", line 762, in async_process_component_config                                                                            
    platform = p_integration.get_platform(domain)                                                                                                                                                       
  File "/srv/homeassistant/lib/python3.8/site-packages/homeassistant/loader.py", line 231, in get_platform                                                                                              
    cache[full_name] = importlib.import_module(                                                                                                                                                         
  File "/usr/lib/python3.8/importlib/__init__.py", line 127, in import_module                                                                                                                           
    return _bootstrap._gcd_import(name[level:], package, level)                                                                                                                                         
  File "<frozen importlib._bootstrap>", line 1014, in _gcd_import                                                                                                                                       
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load                                                                                                                                     
  File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked                                                                                                                            
  File "<frozen importlib._bootstrap>", line 671, in _load_unlocked                                                                                                                                     
  File "<frozen importlib._bootstrap_external>", line 783, in exec_module                                                                                                                               
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed                                                                                                                          
  File "/home/homeassistant/.homeassistant/custom_components/climate_ip/climate.py", line 21, in <module>                                                                                               
    from homeassistant.components.climate import (ClimateDevice, DOMAIN,                                                                                                                                
ImportError: cannot import name 'ATTR_HVAC_ACTIONS' from 'homeassistant.components.climate' (/srv/homeassistant/lib/python3.8/site-packages/homeassistant/components/climate/__init__.py)               
2019-11-21 15:54:40 ERROR (MainThread) [homeassistant.config] Platform error: climate                                                                                                                   
Traceback (most recent call last):                                                                                                                                                                      
  File "/srv/homeassistant/lib/python3.8/site-packages/homeassistant/config.py", line 762, in async_process_component_config                                                                            
    platform = p_integration.get_platform(domain)                                                                                                                                                       
  File "/srv/homeassistant/lib/python3.8/site-packages/homeassistant/loader.py", line 231, in get_platform                                                                                              
    cache[full_name] = importlib.import_module(                                                                                                                                                         
  File "/usr/lib/python3.8/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 783, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/home/homeassistant/.homeassistant/custom_components/climate_ip/climate.py", line 21, in <module>
    from homeassistant.components.climate import (ClimateDevice, DOMAIN,
ImportError: cannot import name 'ATTR_HVAC_ACTIONS' from 'homeassistant.components.climate' (/srv/homeassistant/lib/python3.8/site-packages/homeassistant/components/climate/__init__.py)
2019-11-21 15:54:45 ERROR (SyncWorker_1) [homeassistant.components.nut.sensor] NUT Sensor has no data, unable to set up
2019-11-21 15:54:46 WARNING (MainThread) [homeassistant.components.sensor] Platform nut not ready yet. Retrying in 30 seconds.

@orsacchiotto
Copy link

Hi
After upgrade to 0.102.0 , Same problem here

@GGalloppa
Copy link

GGalloppa commented Nov 21, 2019

Same here

arch x86_64
dev false
docker true
hassio true
os_name Linux
python_version 3.7.4
timezone Europe/Rome
version 0.102.0
virtualenv false

@emme73
Copy link

emme73 commented Nov 22, 2019

I'm using Climate_ip platform from HACS to connect to a Samsung CDZ
https://github.com/SebuZet/samsungrac/

I've checked and think to have found the issue:
homeassistant.components.climate const after update is ATTR_HVAC_ACTION
while climate_ip is calling ATTR_HVAC_ACTIONS

a wired thing is that the same const file include both
ATTR_HVAC_MODE and
ATTR_HVAC_MODES

don't know if this is wanted or just miss the ATTR_HVAC_ACTIONS in the new HA climate file

@atxbyea
Copy link
Contributor

atxbyea commented Nov 22, 2019

Broken here after 0.102.0 also, tried removing "ATTR_HVAC_ACTIONS" and "MODES" but that only made it worse ;-)

@emme73
Copy link

emme73 commented Nov 22, 2019

I think we do need to replace all calls to ATTR_HVAC_ACTIONS to ATTR_HVAC_ACTION in the samsungrac component

unfortunately my HA hangs and I'm not at home to reboot it :(

@emme73
Copy link

emme73 commented Nov 22, 2019

folks, I confirm! you need to edit climate.py file under /config/custom_components/climate_ip and replace the 2 references on ATTR_HVAC_ACTIONS to ATTR_HVAC_ACTION, save and reboot, it will work

@tinstep
Copy link
Author

tinstep commented Nov 23, 2019

@emme73 That worked like a charm.
well done and thanks!

@atxbyea
Copy link
Contributor

atxbyea commented Nov 24, 2019

Verified, working nice here too, I will create a pull request for it.

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

No branches or pull requests

5 participants