1
mirror of https://github.com/home-assistant/core synced 2024-08-02 23:40:32 +02:00
Commit Graph

25 Commits

Author SHA1 Message Date
Hmmbob
c8351387d7
Print client error in rest_command (#67900) 2022-03-11 20:34:06 -08:00
epenet
95537166e8
Add init type hints [r] (#63192)
Co-authored-by: epenet <epenet@users.noreply.github.com>
2022-01-02 16:36:24 +01:00
epenet
a19c95e4bd
Ensure service calls are typed [o-r] (#62920)
Co-authored-by: epenet <epenet@users.noreply.github.com>
2021-12-28 13:10:17 +01:00
Ville Skyttä
5626cc4524
Use http.HTTPStatus in components/r* (#58288) 2021-10-23 20:53:39 +02:00
Franck Nijhof
055cdc64c0
Add support for IoT class in manifest (#46935) 2021-04-15 10:21:38 +02:00
Franck Nijhof
0e98bc5ea2
Skip template result parsing in several places (#42408)
* 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
Hmmbob
788cb0d1ce
Remove excessive logging (#41120) 2020-10-03 14:13:42 +02:00
Hmmbob
60c7a91794
Add payload to debug output of rest_command (#39190) 2020-09-04 12:39:26 +02:00
Alejandro Rivera
937b951727
Fix rest_command UnboundLocalError in exception handling (#38656)
```
2020-08-07 22:38:10 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection.3903193064] local variable 'response' referenced before assignment
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/rest_command/__init__.py", line 115, in async_service_handler
    async with getattr(websession, method)(
  File "/usr/local/lib/python3.8/site-packages/aiohttp/client.py", line 1012, in __aenter__
    self._resp = await self._coro
  File "/usr/local/lib/python3.8/site-packages/aiohttp/client.py", line 582, in _request
    break
  File "/usr/local/lib/python3.8/site-packages/aiohttp/helpers.py", line 586, in __exit__
    raise asyncio.TimeoutError from None
asyncio.exceptions.TimeoutError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 125, in handle_call_service
    await hass.services.async_call(
  File "/usr/src/homeassistant/homeassistant/core.py", line 1281, in async_call
    task.result()
  File "/usr/src/homeassistant/homeassistant/core.py", line 1316, in _execute_service
    await handler.func(service_call)
  File "/usr/src/homeassistant/homeassistant/components/rest_command/__init__.py", line 137, in async_service_handler
    _LOGGER.warning("Timeout call %s", response.url, exc_info=1)
UnboundLocalError: local variable 'response' referenced before assignment
```
2020-08-08 10:56:39 +02:00
Franck Nijhof
53545c984b
Log lines do not end with a full stop (#37527) 2020-07-05 23:04:19 +02:00
springstan
4c38e6cfa5
Use HTTP_BAD_REQUEST constant (#33797) 2020-04-09 21:43:42 +02:00
Paulus Schoutsen
f1d3c0d19b
Remove unused manifest fields (#33595) 2020-04-03 12:58:19 -07:00
Paulus Schoutsen
e9e44dbd97
Fix callback and async (#31281)
* Fix callback and async

* Fix a return

* Fix test

* Fix mqtt tests

* Fix some more callbacks
2020-01-29 13:59:45 -08:00
Franck Nijhof
22760a0bee Correct names in manifests (Q-S) (#30543) 2020-01-07 08:19:44 -05:00
Pedro Lamas
db0008e62c Allow templates in rest_command headers (#26099) 2019-11-25 19:39:56 -08:00
Tomasz
23737e0225 Rename rest_command request to response, add exc_info for exceptions (#28521)
* rename request to response, isort and black fixes

* Log exception details

* Add status code to success log, reformat log

* new syntax for response

* changed info to debug
2019-11-23 11:02:52 +01:00
Matthew Turney
6c48abcaa5 rest_command component should support PATCH method (#27989)
Without PATCH the rest_command component lacks full RESTful API
support.
2019-10-21 11:20:18 +02:00
Franck Nijhof
c7da781efc Update documentation link URL for integrations in all manifests (#27114) 2019-10-02 09:25:44 -07:00
Sebastian Kügler
c527e0f164 Fix rest_command when server is unreachable (#26948)
* fix rest_command when server is unreachable

When a server doesn't exist, the connection fails immediately, rather
than waiting for a timeout. This means that the async handler is never
reached, and the request variable never filled, yet it's used in the
client error exception handler, so this one bugs out.

By using the command_config, we avoid using the potentially unassigned
request variable, avoiding this problem.

This patch makes scripts work that have a rest_command in them which
fails due to a server being offline.

* render template_url

instead of printing the template object

* fix formatting

* fix format using black

* only render url once

* blacken...
2019-09-30 09:06:10 +02:00
Paulus Schoutsen
4de97abc3a Black 2019-07-31 12:25:30 -07:00
Paulus Schoutsen
f995ab9d54
Don't pass in loop (#23984)
* Don't pass in loop

* Revert some changes

* Lint + Axis revert

* reinstate loop

* Fix a test

* Set loop

* Update camera.py

* Lint
2019-05-22 21:09:59 -07:00
Paulus Schoutsen
a52f96b23a
Add stub services.yaml and make validation mandatory (#23213) 2019-04-18 15:13:35 -07:00
Paulus Schoutsen
cfe4cf30ad
Add manifests (#22699)
* Add manifests

* Update auto name

* Update codeowners

* Add requirements from platforms

* Minor cleanup

* Incorporate changes from awarecan PR
2019-04-03 21:14:45 -07:00
Fabian Affolter
127c55e0c1
Update file header (#21023)
* Update file header

* Update file header

* Update file header

* Update file header

* Update file header

* Fix lint issues
2019-02-13 21:21:14 +01:00
Paulus Schoutsen
b8cc547fa3
Move components to folders (#20774)
* Move all components into folders

* Move component tests into folders

* Fix init moving

* Move tests

* Lint

* Update coverage

* Fix service descriptions

* Update CODEOWNERS
2019-02-05 19:31:15 -08:00