{"action":"created","issue":{"url":"https://api.github.com/repos/home-assistant/home-assistant/issues/2612","repository_url":"https://api.github.com/repos/home-assistant/home-assistant","labels_url":"https://api.github.com/repos/home-assistant/home-assistant/issues/2612/labels{/name}","comments_url":"https://api.github.com/repos/home-assistant/home-assistant/issues/2612/comments","events_url":"https://api.github.com/repos/home-assistant/home-assistant/issues/2612/events","html_url":"https://github.com/home-assistant/home-assistant/pull/2612","id":167239234,"number":2612,"title":"Issue 2611: Timeout with homeassistant.remote.call_service","user":{"login":"n8henrie","id":1234956,"avatar_url":"https://avatars.githubusercontent.com/u/1234956?v=3","gravatar_id":"","url":"https://api.github.com/users/n8henrie","html_url":"https://github.com/n8henrie","followers_url":"https://api.github.com/users/n8henrie/followers","following_url":"https://api.github.com/users/n8henrie/following{/other_user}","gists_url":"https://api.github.com/users/n8henrie/gists{/gist_id}","starred_url":"https://api.github.com/users/n8henrie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/n8henrie/subscriptions","organizations_url":"https://api.github.com/users/n8henrie/orgs","repos_url":"https://api.github.com/users/n8henrie/repos","events_url":"https://api.github.com/users/n8henrie/events{/privacy}","received_events_url":"https://api.github.com/users/n8henrie/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-07-24T15:40:59Z","updated_at":"2016-07-24T19:19:53Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/home-assistant/home-assistant/pulls/2612","html_url":"https://github.com/home-assistant/home-assistant/pull/2612","diff_url":"https://github.com/home-assistant/home-assistant/pull/2612.diff","patch_url":"https://github.com/home-assistant/home-assistant/pull/2612.patch"},"body":"**Description:**\r\n\r\n`homeassistant.remote.call_service` has a fixed timeout of 5 seconds, which results in an exception if the Python API is used to call a long running service (longer than 5 seconds). This adds a `timeout` kwarg to `call_service` (and necessarily `homeassistant.remote.API.__call__()`) with a default value of 5 seconds, maintaining current functionality but allowing users to specify a longer timeout as needed.\r\n\r\n**Related issue (if applicable):** fixes #2611\r\n\r\n**Pull request in [home-assistant.io](https://github.com/home-assistant/home-assistant.io) with documentation (if applicable):** home-assistant/home-assistant.io#673\r\n\r\n**Checklist:**\r\n\r\nIf user exposed functionality or configuration variables are added/changed:\r\n  - [x] Documentation added/updated in [home-assistant.io](https://github.com/home-assistant/home-assistant.io)\r\n\r\nIf the code does not interact with devices:\r\n  - [x] Local tests with `tox` run successfully. **Your PR cannot be merged unless tests pass**\r\n  - [ ] Tests have been added to verify that the new code works.\r\n"},"comment":{"url":"https://api.github.com/repos/home-assistant/home-assistant/issues/comments/234796423","html_url":"https://github.com/home-assistant/home-assistant/pull/2612#issuecomment-234796423","issue_url":"https://api.github.com/repos/home-assistant/home-assistant/issues/2612","id":234796423,"user":{"login":"balloob","id":1444314,"avatar_url":"https://avatars.githubusercontent.com/u/1444314?v=3","gravatar_id":"","url":"https://api.github.com/users/balloob","html_url":"https://github.com/balloob","followers_url":"https://api.github.com/users/balloob/followers","following_url":"https://api.github.com/users/balloob/following{/other_user}","gists_url":"https://api.github.com/users/balloob/gists{/gist_id}","starred_url":"https://api.github.com/users/balloob/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/balloob/subscriptions","organizations_url":"https://api.github.com/users/balloob/orgs","repos_url":"https://api.github.com/users/balloob/repos","events_url":"https://api.github.com/users/balloob/events{/privacy}","received_events_url":"https://api.github.com/users/balloob/received_events","type":"User","site_admin":false},"created_at":"2016-07-24T19:19:53Z","updated_at":"2016-07-24T19:19:53Z","body":"When a service is called via API or from a component with `blocking=True`,  Home Assistant [waits up to 10 seconds](https://github.com/home-assistant/home-assistant/blob/dev/homeassistant/core.py#L623-L631) till the service is done, then returns.\r\n\r\nSo we should default the `timeout` to [`SERVICE_CALL_LIMIT`](https://github.com/home-assistant/home-assistant/blob/dev/homeassistant/core.py#L41-L42) + some time for the connection\r\n\r\n"}}
{"actor":{"display_login":"balloob"}}