Commit graph

72 commits

Author SHA1 Message Date
epenet
64e7e62aa0
Add setup type hints [r] ()
Co-authored-by: epenet <epenet@users.noreply.github.com>
2022-01-05 16:37:47 +01:00
epenet
822ac203c3
Add sensor setup type hints [r] ()
Co-authored-by: epenet <epenet@users.noreply.github.com>
2022-01-03 19:08:34 +01:00
epenet
545b10a711
Add binary_sensor setup type hints [o-r] ()
Co-authored-by: epenet <epenet@users.noreply.github.com>
2022-01-03 11:35:02 +01:00
Sebastian Lövdahl
53f4a3d8bc
Use Platform constants all over the place 3/3 () 2021-12-28 21:24:27 +01:00
epenet
a19c95e4bd
Ensure service calls are typed [o-r] ()
Co-authored-by: epenet <epenet@users.noreply.github.com>
2021-12-28 13:10:17 +01:00
Kristján Bjarni
38723b277e
Added XML RSS as Content-Type () 2021-12-27 10:49:38 +01:00
Erik Montnemery
aa36dde148
Correct rest sensor configured to generate timestamps () 2021-12-10 09:59:27 -08:00
Paulus Schoutsen
17cf53677c
Rest fixes () 2021-12-08 14:35:50 -08:00
J. Nick Koston
aca2c3a27a
Restore rest integration ability to follow http redirects () 2021-12-08 22:03:07 +01:00
Paulus Schoutsen
3223332c1e
Use correct template parameter in Rest template rendering () 2021-12-08 12:19:22 -08:00
Jan Bouwhuis
17a542689f
Fix pvoutput template use and REST integer parsing ()
* Fix pvoutput template use and REST integer parsing

* revert accepting templates as input
2021-12-08 19:32:25 +01:00
J. Nick Koston
10d6247fee
Bump to aiohttp 3.8.0 () 2021-11-04 10:07:50 -05:00
Marc Mueller
a48ddcadd4
Use assignment expressions 31 () 2021-10-30 16:29:07 +02:00
Chris Browet
b1b782419b
Add REST sensor/binary_sensor/switch templated headers & params () 2021-10-29 16:36:47 -05:00
Ville Skyttä
5626cc4524
Use http.HTTPStatus in components/r* () 2021-10-23 20:53:39 +02:00
Chris Browet
1867d24b18
Add state_class support to Rest () 2021-10-22 13:48:13 -07:00
Marc Mueller
69e413ac1e
Update pylint to 2.10.1 ()
* Update pylint to 2.10.0

* useless-suppression

* Consider-using-tuple

* Apply suggestions from code review

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>

* Use dict.items()

* Add pylint disable

* Use pylint 2.10.1

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2021-08-21 10:41:23 +02:00
Ville Skyttä
939fde0a50
ConfigType and async_setup/setup type hint improvements () 2021-08-18 13:22:05 +02:00
Erik Montnemery
e558b3463e
Move temperature conversions to sensor base class (6/8) ()
* Move temperature conversions to entity base class (6/8)

* Fix tests
2021-08-12 17:40:55 +02:00
tkdrob
2d5f5bfa9f
Add targets and selectors for services (P-R) () 2021-05-14 22:07:17 -07:00
Franck Nijhof
055cdc64c0
Add support for IoT class in manifest () 2021-04-15 10:21:38 +02:00
J. Nick Koston
30382c3dbe
Limit log spam from rest and include reason in platform retry ()
- Each retry was logging the error again
- Now we set the cause of the PlatformNotReady to allow Home Assistant to log as needed
2021-04-04 20:26:18 -07:00
Erik Montnemery
64bc9a8196
Migrate integrations r-s to extend SensorEntity () 2021-03-22 19:54:14 +01:00
J. Nick Koston
fea0e39fa0
Reduce rest setup code ()
- Switch to storing each platform config/rest data in a list
2021-03-18 09:55:38 +01:00
J. Nick Koston
dd56cc8010
Fix rest sensor data misalignment with multiple sensors ()
If there were multiple rest data sources, the index needed
to be incremented by type instead of by data source/type
2021-03-17 22:47:42 +01:00
Erik Montnemery
14ff6d4d1f
Update integrations p-s to override extra_state_attributes() () 2021-03-11 21:23:20 +01:00
Ville Skyttä
dc880118a4
Lint suppression cleanups ()
* Unused pylint suppression cleanups

* Remove outdated pylint bug references

* Add flake8-noqa config and note to run it every now and then

* Add codes to noqa's

* Unused noqa cleanups
2021-03-02 09:02:04 +01:00
J. Nick Koston
2f3c2f5f4d
Add support for using a single endpoint for rest data () 2021-02-19 21:44:15 -08:00
Franck Nijhof
a80921ab65
Minor service definition tweaks () 2021-02-18 17:14:36 +01:00
Aleksander Żarczyński
bc3610c8e1
Add patch method to rest switch component () 2021-01-29 16:03:00 +01:00
J. Nick Koston
661eb0338a
Fix templates for rest notify () 2021-01-01 19:28:20 +01:00
J. Nick Koston
681f76b99d
Fix rest notify GET without params configured () 2021-01-01 12:40:08 +01:00
emufan
61c57d4d56
Add another xml content type for JSON conversion in RESTful sensor ()
* Update sensor.py

Some xml-result is passed via "application/xhtml+xml" instead of text/xml or application/xml. And then the xml structure is not parsed to json as expected. I changed it locally, but suggest to add thise here as well.

* Update homeassistant/components/rest/sensor.py

Fine for me as well, as it is working this way as well. But I would not see any disadvantage to convert everything, what is possible - a better scrape sensor this way. ;)

Co-authored-by: J. Nick Koston <nick@koston.org>

Co-authored-by: J. Nick Koston <nick@koston.org>
2020-12-18 14:27:12 -06:00
J. Nick Koston
dd0afc3b66
Create httpx helper to wrap a shared httpx.AsyncClient ()
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2020-12-09 17:18:57 +01:00
Moritz Schmitz von Hülst
434d39a5ea
Add initial rest query params ()
* add initial rest query params

* of course I didn't run black

* fix tests

* fix tests

* add test

* reformat

* add binary sensor test

* fix tests

* add one more test and fix switch

* should not have touched that

* if you don't pay attention once
2020-11-11 09:03:55 -10:00
J. Nick Koston
9e0043fb17
Fix rest sensors with resource templates () 2020-11-04 08:52:47 +01:00
Franck Nijhof
0e98bc5ea2
Skip template result parsing in several places ()
* Skip template result parsing in several places

* Adjust alert integration

* Adjust Alexa integration

* Adjust apns integration

* Adjust arest integration

* Adjust dialogflow integration

* Adjust generic camera integration

* Adjust imap email content  integration

* Adjust InfluxDB integration

* Adjust intent integration

* Adjust logbook integration

* Adjust HP ILO integration

* Adjust manual alarm control panel integration

* Adjust manual mqtt alarm control panel integration

* Adjust minio integration

* Adjust mqtt integration

* Adjust notify integration

* Adjust persistent notification integration

* Adjust rest integration

* Adjust rss feed template integration

* Adjust slack integration

* Adjust Xiaomi integration

* Adjust TCP integration

* Adjust Telegram Bot integration

* Bump CI cache version

* Revert "Bump CI cache version"

This reverts commit 875efe58cf.

* Adjust demo tests
2020-10-26 19:29:10 +01:00
Paulus Schoutsen
8949eb2442
Add httpx as a core dep () 2020-10-19 10:18:47 +02:00
J. Nick Koston
5580b21260
Decouple RestData from rest.sensor () 2020-10-17 04:56:45 +02:00
Philip Allgaier
dde6305549
Cleanup unused loggers (components N-Z + tests) () 2020-10-16 21:24:08 -05:00
J. Nick Koston
ad6ce5fa83
Convert rest sensors to async using httpx () 2020-10-16 19:21:13 -05:00
jjlawren
f01a0f9151
Allow separate URL for REST switch state () 2020-09-04 16:58:40 +02:00
J. Nick Koston
661b593db3
Support reloading the rest notify platform ()
* Support reloading the rest notify platform

* update services.yaml

* fix conflict
2020-09-02 18:25:43 -05:00
J. Nick Koston
5018e53b33
Add the ability to reload the rest platforms from yaml ()
* Add the ability to reload rest platforms from yaml

* Revert changes to notify as these will be done in another pass
2020-08-25 19:05:29 -05:00
Franck Nijhof
53545c984b
Log lines do not end with a full stop () 2020-07-05 23:04:19 +02:00
Franck Nijhof
02adcc532f
Fix rest to use BinarySensorEntity () 2020-06-24 14:53:17 +02:00
Hedgehog57
fd1edf1bb6
Add resource_template to rest binary_sensor () 2020-06-23 15:08:55 -07:00
Erik Montnemery
066e921a8b
Rename SwitchDevice to SwitchEntity () 2020-04-26 18:50:37 +02:00
Erik Montnemery
b022e08db9
Rename BinarySensorDevice to BinarySensorEntity ()
* Rename BinarySensorDevice to BinarySensorEntity

* Tweak

* Move deprecation warning to __new__, add test

* Move deprecation warning back to __init__

* Move deprecation warning to __init_subclass
2020-04-23 21:57:07 +02:00
springstan
4c38e6cfa5
Use HTTP_BAD_REQUEST constant () 2020-04-09 21:43:42 +02:00