From aed19864c3629205c3e64ee044cc97aa64ea1224 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Sat, 20 May 2023 20:53:32 -0500 Subject: [PATCH] move legacy to bottom of the page --- source/_integrations/http.markdown | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/source/_integrations/http.markdown b/source/_integrations/http.markdown index ecfe93fbd68..e215da9ed93 100644 --- a/source/_integrations/http.markdown +++ b/source/_integrations/http.markdown @@ -189,7 +189,14 @@ If you want to use Home Assistant to host or serve static files then create a di -## Binary Sensor +## States API + +There is currently support for the following device types within Home Assistant: + +- [Binary Sensor](#binary-sensor) +- [Sensor](#sensor) + +### Binary Sensor The HTTP binary sensor is dynamically created with the first request that is made to its URL. You don't have to define it in the configuration first. @@ -237,11 +244,11 @@ $ curl -X GET -H "Authorization: Bearer LONG_LIVED_ACCESS_TOKEN" \ } ``` -### Examples +#### Examples In this section you'll find some real-life examples of how to use this sensor, besides `curl`, which was shown earlier. -#### Using Python request module +##### Using Python request module As already shown on the [API](/developers/rest_api/) page, it's very simple to use Python and the [Requests](https://requests.kennethreitz.org/en/latest/) module for the interaction with Home Assistant. @@ -257,7 +264,7 @@ response = requests.post( print(response.text) ``` -#### Using `httpie` +##### Using `httpie` [`httpie`](https://github.com/httpie/httpie) is a user-friendly CLI HTTP client. @@ -267,7 +274,7 @@ $ http -v POST http://localhost:8123/api/states/binary_sensor.radio \ attributes:='{"friendly_name": "Radio"}' ``` -## Sensor +### Sensor The HTTP sensor is dynamically created with the first request that is made to its URL. You don't have to define it in the configuration first.