Using httpx, the .stream method does not raise an exception when the
device goes offline if the read timeout is disabled. To get around this,
introduce a new exception that will be thrown if a timeout is hit so it
can more easily be handled and the stream reconnected as needed. Add
handling logic to the async_event_stream so it behaves like the
non-async method by retrying while read errors are thrown.
Using httpx, the
.stream
method does not raise an exception when the device goes offline if the read timeout is disabled. To get around this, introduce a new exception that will be thrown if a timeout is hit so it can more easily be handled and the stream reconnected as needed. Add handling logic to the async_event_stream so it behaves like the non-async method by retrying while read errors are thrown.