mirror of
https://github.com/home-assistant/core.git
synced 2025-07-20 11:47:06 +00:00
remove break
This commit is contained in:
parent
85e0db6ade
commit
9acb341b96
@ -132,7 +132,9 @@ def setup(hass, config):
|
|||||||
while True:
|
while True:
|
||||||
|
|
||||||
img_bytes = camera.camera_image()
|
img_bytes = camera.camera_image()
|
||||||
if img_bytes is not None:
|
if img_bytes is None:
|
||||||
|
continue
|
||||||
|
else:
|
||||||
headers_str = '\r\n'.join((
|
headers_str = '\r\n'.join((
|
||||||
'Content-length: {}'.format(len(img_bytes)),
|
'Content-length: {}'.format(len(img_bytes)),
|
||||||
'Content-type: image/jpeg',
|
'Content-type: image/jpeg',
|
||||||
@ -145,8 +147,7 @@ def setup(hass, config):
|
|||||||
|
|
||||||
handler.request.sendall(
|
handler.request.sendall(
|
||||||
bytes('--jpgboundary\r\n', 'utf-8'))
|
bytes('--jpgboundary\r\n', 'utf-8'))
|
||||||
else:
|
|
||||||
break
|
|
||||||
except (requests.RequestException, IOError):
|
except (requests.RequestException, IOError):
|
||||||
camera.is_streaming = False
|
camera.is_streaming = False
|
||||||
camera.update_ha_state()
|
camera.update_ha_state()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user