peterbuga / HASS-sonoff-ewelink

Home Assistant component to control Sonoff/eWeLink devices with original firmware
MIT License
791 stars 296 forks source link

Error while setting up sonoff platform for switch #239

Closed fiservedpi closed 4 years ago

fiservedpi commented 4 years ago

Home assistant: 0.109.6 HASS OS: no SLOW_SETUP_MAX_WAIT TypeError: string indices must be integers


Source: custom_components/sonoff/__init__.py:516
Integration: Switch (documentation, issues)
First occurred: 6:14:13 AM (1 occurrences)
Last logged: 6:14:13 AM

Error while setting up sonoff platform for switch
Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 178, in _async_setup_platform await asyncio.wait_for(asyncio.shield(task), SLOW_SETUP_MAX_WAIT) File "/usr/local/lib/python3.7/asyncio/tasks.py", line 442, in wait_for return fut.result() File "/config/custom_components/sonoff/switch.py", line 15, in async_setup_platform outlets_number = hass.data[SONOFF_DOMAIN].get_outlets(device) File "/config/custom_components/sonoff/__init__.py", line 516, in get_outlets if device['uiid'] in uiid_to_name.keys() and \ TypeError: string indices must be integers ```
peterbuga commented 4 years ago

@fiservedpi do this https://github.com/peterbuga/HASS-sonoff-ewelink/issues/237#issuecomment-628086842

fiservedpi commented 4 years ago

Awesome ty for the quick response sorry for the duplicate

fiservedpi commented 4 years ago

thanks seems to be working after applying the async branch

peterbuga commented 4 years ago

good 👍

fiservedpi commented 4 years ago

Can I just delete the platforms I don't use? I only have one sonoff basic deployed


Source: setup.py:249
First occurred: 1:10:44 PM (1 occurrences)
Last logged: 1:10:44 PM

Unable to prepare setup for platform sonoff.light: Platform not found (No module named 'custom_components.sonoff.light').```
peterbuga commented 4 years ago

@fiservedpi if you don't have the devices nothing else will be loaded (it's just organized logic), but if you really want less files you can edit this line in __init.py__ and remove stuff you don't need for component in ['switch', 'sensor', 'binary_sensor', 'light', 'fan']:

fiservedpi commented 4 years ago

Ok was just wondering since it's showing up as an error but I'll just leave well enough alone, thanks again

fiservedpi commented 4 years ago

Also looks like some changes are coming down the pipe (of course!) Home Assistant 0.110.0b1 HASSIO: No


Source: components/switch/__init__.py:125
Integration: Switch (documentation, issues)
First occurred: 8:59:22 PM (2 occurrences)
Last logged: 8:59:22 PM

SwitchDevice is deprecated, modify SonoffSwitch to extend SwitchEntity
SwitchDevice is deprecated, modify SonoffDebugSwitch to extend SwitchEntity```
peterbuga commented 4 years ago

it'll have to wait now...