SecKatie / ha-wyzeapi

Home Assistant Integration for Wyze devices.
751 stars 113 forks source link

Error while setting up platform wyzeapi #21

Closed kennedyshane closed 4 years ago

kennedyshane commented 4 years ago

Installed via HACS, I did have this working via manual install and then switched to HACS version for ease of updating and now I'm receiving the following error.

Log Details (ERROR) Mon Dec 30 2019 17:10:56 GMT-0600 (Central Standard Time) Error while setting up platform wyzeapi Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 150, 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 "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run result = self.fn(*self.args, **self.kwargs) File "/config/custom_components/wyzeapi/light.py", line 58, in setup_platform add_entities(WyzeBulb(light) for light in wyze.list_bulbs()) File "/config/custom_components/wyzeapi/wyzeapi/wyzeapi.py", line 88, in list_bulbs for device in self.get_devices(): File "/config/custom_components/wyzeapi/wyzeapi/wyzeapi.py", line 80, in get_devices data = do_request(url, payload, self) File "/config/custom_components/wyzeapi/wyzeapi/wyzeapi_request.py", line 36, in do_request return request_helper(url, payload, api) File "/config/custom_components/wyzeapi/wyzeapi/wyzeapi_request.py", line 25, in request_helper api.initialize() File "/config/custom_components/wyzeapi/wyzeapi/wyzeapi.py", line 26, in initialize updateConfig(self._device_id, self._access_token) File "/config/custom_components/wyzeapi/wyzeapi/wyzeapi_config.py", line 18, in updateConfig config.add_section('auth') File "/usr/local/lib/python3.7/configparser.py", line 1205, in add_section super().add_section(section) File "/usr/local/lib/python3.7/configparser.py", line 658, in add_section raise DuplicateSectionError(section) configparser.DuplicateSectionError: Section 'auth' already exists

Quantum-cross commented 4 years ago

what does your configuration.yaml look like? be sure to blank out any credentials

SecKatie commented 4 years ago

@kennedyshane you must have an old version installed because the latest version doesn’t include configparser

kennedyshane commented 4 years ago

@JoshuaMulliken I am running v0.3.1 (see screenshot)

@Quantum-cross Below is what my "configuration.yaml" file looks like.

Configure a default setup of Home Assistant (frontend, api, etc)

default_config:

Uncomment this if you are using SSL/TLS, running in Docker container, etc.

http:

base_url: example.duckdns.org:8123

Text to speech

tts:

Front End

frontend: themes: !include_dir_merge_named themes

Groups

group: !include groups.yaml

Automation

automation: !include automations.yaml

Script

script: !include scripts.yaml

Scene

scene: !include scenes.yaml

Binary Sensor

binary_sensor:

Lights

light:

2019-12-31 08_10_23-Window

kburnes commented 4 years ago

I also have this error similar to @kennyshane:

2019-12-31 09:30:31 ERROR (MainThread) [homeassistant.components.light] Error while setting up platform wyzeapi Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 150, 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 "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run result = self.fn(*self.args, **self.kwargs) File "/config/custom_components/wyzeapi/light.py", line 58, in setup_platform add_entities(WyzeBulb(light) for light in wyze.list_bulbs()) File "/config/custom_components/wyzeapi/wyzeapi/wyzeapi.py", line 88, in list_bulbs for device in self.get_devices(): File "/config/custom_components/wyzeapi/wyzeapi/wyzeapi.py", line 80, in get_devices data = do_request(url, payload, self) File "/config/custom_components/wyzeapi/wyzeapi/wyzeapi_request.py", line 36, in do_request return request_helper(url, payload, api) File "/config/custom_components/wyzeapi/wyzeapi/wyzeapi_request.py", line 25, in request_helper api.initialize() File "/config/custom_components/wyzeapi/wyzeapi/wyzeapi.py", line 26, in initialize updateConfig(self._device_id, self._access_token) File "/config/custom_components/wyzeapi/wyzeapi/wyzeapi_config.py", line 18, in updateConfig config.add_section('auth') File "/usr/local/lib/python3.7/configparser.py", line 1205, in add_section super().add_section(section) File "/usr/local/lib/python3.7/configparser.py", line 658, in add_section raise DuplicateSectionError(section) configparser.DuplicateSectionError: Section 'auth' already exists

SecKatie commented 4 years ago

@kennedyshane @kburnes please try v0.3.2-beta.1

kennedyshane commented 4 years ago

@JoshuaMulliken Can confirm, upgraded to v0.3.2-beta.1 and it's working like a charm! Thank you very much for your time, assistance and this project :)

kburnes commented 4 years ago

What @kennedyshane said. Thanks!