mirror of
https://github.com/home-assistant/home-assistant.io.git
synced 2025-07-21 00:06:51 +00:00
Update server_sent_events.markdown
This commit is contained in:
parent
edf76a05b2
commit
b1ca30f30e
@ -62,11 +62,7 @@ If you want to test the server-sent events without creating a website, the Pytho
|
|||||||
$ pip3 install sseclient
|
$ pip3 install sseclient
|
||||||
```
|
```
|
||||||
|
|
||||||
<<<<<<< HEAD
|
A simple script to consume SSE in Python looks like this:
|
||||||
The simplest script to consume the SSE looks like the following snippet.
|
|
||||||
=======
|
|
||||||
The simplest script to consume the SSE in Python looks like this:
|
|
||||||
>>>>>>> current
|
|
||||||
|
|
||||||
```python
|
```python
|
||||||
from sseclient import SSEClient
|
from sseclient import SSEClient
|
||||||
@ -75,4 +71,3 @@ messages = SSEClient('http://localhost:8123/api/stream?api_password=YOUR_PASSWOR
|
|||||||
for msg in messages:
|
for msg in messages:
|
||||||
print(msg)
|
print(msg)
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user