RobertD502 / home-assistant-iocare

Home Assistant custom component for monitoring and controlling Coway Airmega Purifiers
MIT License
50 stars 8 forks source link

Unknown error while trying to configure #20

Closed waogden closed 1 year ago

waogden commented 1 year ago

Attempting to configure the integration for the first time. No other coway integrations have ever been installed and I just created a coway account today (so I think it's the new account type?). HA error log below.

Thanks!

This error originated from a custom integration.

Logger: aiohttp.server Source: custom_components/coway/config_flow.py:102 Integration: Coway IoCare (documentation, issues) First occurred: 6:39:25 PM (8 occurrences) Last logged: 7:17:23 PM

Error handling request Traceback (most recent call last): File "/usr/local/lib/python3.10/site-packages/aiohttp/web_protocol.py", line 435, in _handle_request resp = await request_handler(request) File "/usr/local/lib/python3.10/site-packages/aiohttp/web_app.py", line 504, in _handle resp = await handler(request) File "/usr/local/lib/python3.10/site-packages/aiohttp/web_middlewares.py", line 117, in impl return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/security_filter.py", line 60, in security_filter_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/forwarded.py", line 94, in forwarded_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 28, in request_context_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 80, in ban_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 236, in auth_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/view.py", line 145, in handle result = await result File "/usr/src/homeassistant/homeassistant/components/config/config_entries.py", line 180, in post return await super().post(request, flow_id) File "/usr/src/homeassistant/homeassistant/components/http/data_validator.py", line 72, in wrapper result = await method(view, request, data, *args, **kwargs) File "/usr/src/homeassistant/homeassistant/helpers/data_entry_flow.py", line 110, in post result = await self._flow_mgr.async_configure(flow_id, data) File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 253, in async_configure result = await self._async_handle_step( File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 335, in _async_handle_step result: FlowResult = await getattr(flow, method)(user_input) File "/config/custom_components/coway/config_flow.py", line 102, in async_step_user skip_password_change = user_input[SKIP_PASSWORD_CHANGE] KeyError: 'skip_password_change'

RobertD502 commented 1 year ago

That is due to my error as I forgot to set that key to false if a user doesn't select that option during initial setup. Just pushed out a new release (0.1.8) that addresses the issue.

Just a heads up: Coway will eventually bug you after 60 days or so that your password should be changed. If you don't select the skip password change then the integration will stop working eventually when Coway starts presenting you with the password change page. At that time one of your options will be to open the IoCare app and manually change the password followed by reauthenticating the Home Assistant integration using the new password. Your other option will be to reauthenticate with Home Assistant (using the old password) and selecting the Skip password change option.

The skip password change option, essentially, selects the skip password change for now option on the page that Coway presents when it detects the password is 60 or so days old. My recommendation is for you to select that option from the get go or you'll be faced with the scenario described above.