Skip to content

Commit

Permalink
feat: add update_interval setting
Browse files Browse the repository at this point in the history
  • Loading branch information
alandtse committed Nov 11, 2019
1 parent 96f0bfe commit c85f30c
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion teslajsonpy/controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@


class Controller:
# pylint: disable=too-many-public-methods
"""Controller for connections to Tesla Motors API."""

def __init__(
Expand Down Expand Up @@ -51,7 +52,7 @@ def __init__(
websession, email, password, access_token, refresh_token
)
self.__components = []
self.update_interval = update_interval
self._update_interval: int = update_interval
self.__update = {}
self.__climate = {}
self.__charging = {}
Expand Down Expand Up @@ -594,3 +595,18 @@ def get_last_update_time(self, car_id=None):
if car_id is not None:
return self._last_update_time[car_id]
return self._last_update_time

@property
def update_interval(self) -> int:
"""Return update_interval.
Returns
int: The number of seconds between updates
"""
return self._update_interval

@update_interval.setter
def update_interval(self, value: int) -> None:
if value:
self._update_interval = int(value)

0 comments on commit c85f30c

Please sign in to comment.