KoljaWindeler / ics

Integration that displays the next event of an ics link (support reoccuring events)
51 stars 12 forks source link

Invalid URL? #26

Closed serenewaffles closed 3 years ago

serenewaffles commented 3 years ago

When trying to load a valid URL (it works in firefox), the ics integration tells me that it is an invalid URL and no data was received. The Home Assistant logs contain the following. I have previously used this integration with the same calendar, so I know there's a way to get this working. Previously I was running Home Assistant OS on a Raspberry Pi, and am now running Home Assistant Container on an x86_64 architecture.

2021-04-13 10:58:14 WARNING (MainThread) [homeassistant.util.async_] Detected I/O inside the event loop. This is causing stability issues. Please report issue to the custom component author for ics doing I/O at custom_components/ics/const.py, line 228: return requests.get(url, headers={'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/35.0.1916.47 Safari/537.36'}, allow_redirects=True).content,
2021-04-13 10:58:14 ERROR (MainThread) [custom_components.ics.const] Traceback (most recent call last):,
  File "/config/custom_components/ics/const.py", line 151, in check_data,
    cal_string = load_data(user_input[CONF_ICS_URL]),
    return requests.get(url, headers={'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/35.0.1916.47 Safari/537.36'}, allow_redirects=True).content,
  File "/config/custom_components/ics/const.py", line 228, in load_data,
  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,
  File "/usr/local/lib/python3.8/site-packages/requests/sessions.py", line 542, in request,
    return session.request(method=method, url=url, **kwargs),
    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/ics/const.py, line 228: return requests.get(url, headers={'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/35.0.1916.47 Safari/537.36'}, allow_redirects=True).content
KoljaWindeler commented 3 years ago

damn .. ok I see that this is an issue .. I haven't really spend much time updating the integration .. I guess that's needed now .. If anyone would volunteer to update it .. please send a pull request .. support is welcome!