From fe926fa79cd63c523452bc2dde65403dd88e38ed Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Wed, 28 Nov 2018 09:53:41 +0100 Subject: [PATCH] Update Python example (#152) --- docs/external_api_server_sent_events.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/external_api_server_sent_events.md b/docs/external_api_server_sent_events.md index 139e14d4..4e02f86e 100644 --- a/docs/external_api_server_sent_events.md +++ b/docs/external_api_server_sent_events.md @@ -53,8 +53,6 @@ The [home-assistant-sse](https://github.com/fabaff/home-assistant-sse) repositor ### Python -> Will no longer work with the new Authentication system. - If you want to test the server-sent events without creating a website, the Python module [`sseclient` ](https://pypi.python.org/pypi/sseclient/) can help. To install (assuming Python and pip3 are already installed): ```bash @@ -66,7 +64,9 @@ A simple script to consume SSE in Python looks like this: ```python from sseclient import SSEClient -messages = SSEClient('http://localhost:8123/api/stream?api_password=YOUR_PASSWORD') +auth = {'Authorization': 'Bearer ABCDEFGH'} +messages = SSEClient('http://localhost:8123/api/stream', headers=auth) + for msg in messages: print(msg) ```