siku2/hass-weatherlink

Failed to set up after update

Closed this issue · 3 comments

After upgrade the integration stopped working : "Failed to set up"

Home Assistant 2023.3.6
Supervisor 2023.03.2
Operating System 9.5
Frontend 20230309.1 - latest

Here are the Log Errors:

Logger: homeassistant.config_entries
Source: custom_components/weatherlink/units.py:213
Integration: WeatherLink (documentation, issues)
First occurred: March 23, 2023, 10:10:35 PM (1 occurrences)
Last logged: March 23, 2023, 10:10:35 PM

Error setting up entry WeatherLink 001D0A716E61 for weatherlink
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 383, in async_setup
result = await component.async_setup_entry(hass, self)
File "/config/custom_components/weatherlink/init.py", line 165, in async_setup_entry
await setup_coordinator(hass, entry)
File "/config/custom_components/weatherlink/init.py", line 156, in setup_coordinator
coordinator = await WeatherLinkCoordinator.build(
File "/config/custom_components/weatherlink/init.py", line 145, in build
await coordinator.__initalize(session, entry)
File "/config/custom_components/weatherlink/init.py", line 92, in __initalize
await self.__update_config(self.hass, entry)
File "/config/custom_components/weatherlink/init.py", line 71, in __update_config
self.units = get_unit_config(hass, entry)
File "/config/custom_components/weatherlink/units.py", line 213, in get_unit_config
if hass.config.units.name == CONF_UNIT_SYSTEM_IMPERIAL:
AttributeError: 'UnitSystem' object has no attribute 'name'

This error originated from a custom integration.

Logger: aiohttp.server
Source: custom_components/weatherlink/units.py:213
Integration: WeatherLink (documentation, issues)
First occurred: 3:11:05 AM (1 occurrences)
Last logged: 3:11:05 AM

Error handling request
Traceback (most recent call last):
File "/usr/local/lib/python3.10/site-packages/aiohttp/web_protocol.py", line 433, 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 67, 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 234, in auth_middleware
return await handler(request)
File "/usr/src/homeassistant/homeassistant/components/http/view.py", line 146, in handle
result = await result
File "/usr/src/homeassistant/homeassistant/components/config/config_entries.py", line 241, 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 271, in async_configure
result = await self._async_handle_step(
File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 367, in _async_handle_step
result: FlowResult = await getattr(flow, method)(user_input)
File "/config/custom_components/weatherlink/config_flow.py", line 129, in async_step_misc
return await self.async_step_units()
File "/config/custom_components/weatherlink/config_flow.py", line 155, in async_step_units
data_schema=get_unit_config(self.hass, self.config_entry).units_schema(),
File "/config/custom_components/weatherlink/units.py", line 213, in get_unit_config
if hass.config.units.name == CONF_UNIT_SYSTEM_IMPERIAL:
AttributeError: 'UnitSystem' object has no attribute 'name'

This is solved in the latest commit that I don't think has a release yet (I used https://github.com/xdecock/hass-weatherlink which solves it)

Hi Simon (@siku2), Thank you so much for all the work you've done on this integration. Would you please publish a release so we can apply the two commits that are waiting for us in the master?
Thanks! - Jay

siku2 commented

Hi Simon (@siku2), Thank you so much for all the work you've done on this integration. Would you please publish a release so we can apply the two commits that are waiting for us in the master? Thanks! - Jay

I wanted to make some changes to the changelog first but simply haven't had the chance to do that until now.