2021-04-21 10:53:45 ERROR (MainThread) [homeassistant.components.water_heater] Error while setting up yunmi_water_heater platform for water_heater
Traceback (most recent call last):
File "/config/custom_components/yunmi_water_heater/water_heater.py", line 217, in yunmi_login
res = requests.get(url, headers=headers)
File "/usr/local/lib/python3.8/site-packages/requests/api.py", line 76, in get
return request('get', url, params=params, **kwargs)
File "/usr/local/lib/python3.8/site-packages/requests/api.py", line 61, in request
return session.request(method=method, url=url, **kwargs)
File "/usr/local/lib/python3.8/site-packages/requests/sessions.py", line 542, in request
resp = self.send(prep, **send_kwargs)
File "/usr/local/lib/python3.8/site-packages/requests/sessions.py", line 655, in send
r = adapter.send(request, **kwargs)
File "/usr/local/lib/python3.8/site-packages/requests/adapters.py", line 439, in send
resp = conn.urlopen(
File "/usr/local/lib/python3.8/site-packages/urllib3/connectionpool.py", line 699, in urlopen
httplib_response = self._make_request(
File "/usr/local/lib/python3.8/site-packages/urllib3/connectionpool.py", line 394, in _make_request
conn.request(method, url, **httplib_request_kw)
File "/usr/local/lib/python3.8/site-packages/urllib3/connection.py", line 234, in request
super(HTTPConnection, self).request(method, url, body=body, headers=headers)
File "/usr/local/lib/python3.8/http/client.py", line 1255, in request
self._send_request(method, url, body, headers, encode_chunked)
File "/usr/local/lib/python3.8/http/client.py", line 1266, in _send_request
self.putrequest(method, url, **skips)
File "/usr/local/lib/python3.8/site-packages/urllib3/connection.py", line 214, in putrequest
return _HTTPConnection.putrequest(self, method, url, *args, **kwargs)
File "/usr/src/homeassistant/homeassistant/util/async_.py", line 150, in protected_loop_func
check_loop()
File "/usr/src/homeassistant/homeassistant/util/async_.py", line 139, in check_loop
raise RuntimeError(
RuntimeError: I/O must be done in the executor; Use `await hass.async_add_executor_job()` at custom_components/yunmi_water_heater/water_heater.py, line 217: res = requests.get(url, headers=headers)
async def asyncGet(url, headers):
async with aiohttp.ClientSession(headers=headers) as session:
async with session.get(url) as response:
_LOGGER.info('res: ' + str(response.status))
html = await response.text()
_LOGGER.info('html: ' + str(html))
return html