Skip to content

Commit

Permalink
Do default param setup via None -> getDefaultHub.
Browse files Browse the repository at this point in the history
If not doing it this way, on import getDefaultHub will get run and
that's not exactly what we want.
  • Loading branch information
jinnatar committed Dec 16, 2017
1 parent 8fca097 commit 7b4e1ac
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion cozify/hub.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ def _hub(host=None, remoteToken=None, hubToken=None):
else:
raise APIError(response.status_code, response.text)

def tz(hub_id=getDefaultHub()):
def tz(hub_id=None):
"""Get timezone of given hub or default hub if no id is specified.
Args:
Expand All @@ -219,6 +219,10 @@ def tz(hub_id=getDefaultHub()):
Returns:
str: Timezone of the hub, for example: 'Europe/Helsinki'
"""

if not hub_id:
hub_id = getDefaultHub()

ip = host(hub_id)
hub_token = token(hub_id)
cloud_token = None
Expand Down

0 comments on commit 7b4e1ac

Please sign in to comment.