hacf-fr/sfrbox-api

Temperature type conflict - Unknown error occurred - haos

Closed this issue · 0 comments

Here is the continuation of the previous issue created in home-assistant/core#125336.

The problem

Hi,

When I try to add the SFR Box integration to my haos, I have the following error:

I've got this on the api webpage : http://a.b.c.d/api/1.0/?method=system.getInfo

<rsp stat="ok" version="1.0">
<script id="nimlmejbmnecnaghgmbahmbaddhjbecg"/>
<script/>
<script/>
<system product_id="ALGD1-UBE-r0" serial_number="MU1B01140006020043" mac_addr="***hidden***" net_mode="router" net_infra="fttb" uptime="1564075" version_mainfirmware="3DCM020200r015" version_rescuefirmware="3DCM020200r015" version_bootloader="3.00" version_dsldriver="" current_datetime="20240905131928" refclient="" idur="RNCUAOL" alimvoltage="12251" temperature="57.4"/>
</rsp>

Anything in the logs that might be useful for us?

2024-09-05 13:09:08.791 DEBUG (MainThread) [sfrbox_api.bridge] HTTP Response: GET http://192.168.1.1/api/1.0/?method=system.getInfo "HTTP/1.1 200 Ok" <?xml version="1.0" encoding="UTF-8"?><rsp stat="ok" version="1.0"><system product_id="ALGD1-UBE-r0" serial_number="MU1B01140006020043" mac_addr="***hidden***" net_mode="router" net_infra="fttb" uptime="1563441" version_mainfirmware="3DCM020200r015" version_rescuefirmware="3DCM020200r015" version_bootloader="3.00" version_dsldriver="" current_datetime="20240905130854" refclient="" idur="RNCUAOL" alimvoltage="12251" temperature="57.5" />
</rsp>
2024-09-05 13:09:08.792 ERROR (MainThread) [aiohttp.server] Error handling request
Traceback (most recent call last):
File "/usr/local/lib/python3.12/site-packages/aiohttp/web_protocol.py", line 462, in _handle_request
resp = await request_handler(request)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/aiohttp/web_app.py", line 537, in _handle
resp = await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/aiohttp/web_middlewares.py", line 114, in impl
return await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/http/security_filter.py", line 92, in security_filter_middleware
return await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/http/forwarded.py", line 210, in forwarded_middleware
return await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 26, in request_context_middleware
return await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 85, in ban_middleware
return await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 242, in auth_middleware
return await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/http/headers.py", line 32, in headers_middleware
response = await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/http.py", line 73, in handle
result = await handler(request, **request.match_info)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/http/decorators.py", line 81, in with_admin
return await func(self, request, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/config/config_entries.py", line 222, in post
return await super().post(request, flow_id)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/http/data_validator.py", line 74, in wrapper
return await method(view, request, data, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/data_entry_flow.py", line 122, in post
result = await self._flow_mgr.async_configure(flow_id, data)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 366, in async_configure
result = await self._async_configure(flow_id, user_input)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 413, in _async_configure
result = await self._async_handle_step(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 516, in _async_handle_step
result: _FlowResultT = await getattr(flow, method)(user_input)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/sfr_box/config_flow.py", line 50, in async_step_user
system_info = await box.system_get_info()
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/sfrbox_api/bridge.py", line 179, in system_get_info
return SystemInfo(**xml_response.attrib) # type: ignore[arg-type]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "pydantic/dataclasses.py", line 332, in pydantic.dataclasses._add_pydantic_validation_attributes.new_init
File "pydantic/dataclasses.py", line 447, in pydantic.dataclasses._dataclass_validate_values
pydantic.error_wrappers.ValidationError: 1 validation error for SystemInfo
temperature
value is not a valid integer (type=type_error.integer)

Additional information

The request to http://a.b.c.d/api/1.0/?method=auth.getToken seems to give me a correct token:

<rsp stat="ok" version="1.0">
<script id="nimlmejbmnecnaghgmbahmbaddhjbecg"/>
<script/>
<script/>
<auth token="***hidden***" method="all"/>
</rsp>