From 120e50075f82418f031e72f82bf0c00da6973b70 Mon Sep 17 00:00:00 2001 From: rikroe Date: Mon, 16 Aug 2021 20:43:19 +0200 Subject: [PATCH] Mention @TA2k's work, increase remote service timeout & error message --- README.rst | 1 + bimmer_connected/remote_services.py | 9 ++++++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/README.rst b/README.rst index 307b5c93..10f35abe 100644 --- a/README.rst +++ b/README.rst @@ -117,6 +117,7 @@ to be used in Home Assistant and is available on pypi. * https://github.com/edent/BMW-i-Remote * https://github.com/jupe76/bmwcdapi * https://github.com/frankjoke/iobroker.bmw +* https://github.com/TA2k/ioBroker.bmw Thank you for your great software! diff --git a/bimmer_connected/remote_services.py b/bimmer_connected/remote_services.py index fcc3a17a..d0395536 100644 --- a/bimmer_connected/remote_services.py +++ b/bimmer_connected/remote_services.py @@ -26,7 +26,7 @@ _POLLING_CYCLE = 3 #: maximum number of seconds to wait for the server to return a positive answer -_POLLING_TIMEOUT = 120 +_POLLING_TIMEOUT = 240 #: time in seconds to wait before updating the vehicle state from the server _UPDATE_AFTER_REMOTE_SERVICE_DELAY = 10 @@ -245,8 +245,11 @@ def _block_until_done(self, service: _Services = None, event_id: str = None) -> if status.state not in [ExecutionState.UNKNOWN, ExecutionState.PENDING, ExecutionState.DELIVERED]: return status if datetime.datetime.now() > fail_after: - raise IOError( - 'Timeout on getting final answer from server. Current state: {}'.format(status.state.value)) + raise TimeoutError( + 'Did not receive remote service result in {} seconds. Current state: {}'.format( + _POLLING_TIMEOUT, + status.state.value + )) time.sleep(_POLLING_CYCLE) def _get_remote_service_status(self, service: _Services = None, event_id: str = None) -> RemoteServiceStatus: