jheling / freeathome

Free@Home component for Home Assistant
103 stars 37 forks source link

Problem loading platform in latest Homeassistant #3

Closed certl closed 5 years ago

certl commented 5 years ago

component fails to load in latest home assistant with error:

2018-11-09 10:52:58 ERROR (MainThread) [homeassistant.setup] Error during setup of component freeathome
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/dist-packages/homeassistant/setup.py", line 145, in _async_setup_component
    hass, processed_config)
  File "/root/.homeassistant/custom_components/freeathome.py", line 54, in async_setup
    load_platform(hass, 'light', DOMAIN)
TypeError: load_platform() missing 2 required positional arguments: 'discovered' and 'hass_config'

Fix is to replace lines 54-56 in freeathome.py with:

load_platform(hass, 'light', DOMAIN, {}, config)
load_platform(hass, 'scene', DOMAIN, {}, config)
load_platform(hass, 'cover', DOMAIN, {}, config)
jheling commented 5 years ago

Thank you for the fix. Im just in the process of checking all the sources with pylint. As i'm rather new to Python , the sources in the present state are not suitable for integegration in home assistant. Refactoring takes some more time than anticipated. Fortunately user jeroen84 made a pull request, and now this problem is fixed.

certl commented 5 years ago

The version with the fix outlined above is running fine with my home assistant 0.81.6

jheling commented 5 years ago

Yes, the fix has been added the source