From 8d2dc4826186dbcc68a136af6bc7022e839928b8 Mon Sep 17 00:00:00 2001 From: Robbie Trencheny Date: Mon, 9 May 2016 15:14:30 -0700 Subject: [PATCH 1/6] en_UK->en_GB. Closes #2019. --- homeassistant/components/sensor/fitbit.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/homeassistant/components/sensor/fitbit.py b/homeassistant/components/sensor/fitbit.py index f928b9a78e9..37281058e02 100644 --- a/homeassistant/components/sensor/fitbit.py +++ b/homeassistant/components/sensor/fitbit.py @@ -85,7 +85,7 @@ FITBIT_MEASUREMENTS = { "liquids": "fl. oz.", "blood glucose": "mg/dL", }, - "en_UK": { + "en_GB": { "duration": "milliseconds", "distance": "kilometers", "elevation": "meters", From faf5ffe610b347743ab23210b13f3785c06c7453 Mon Sep 17 00:00:00 2001 From: Robbie Trencheny Date: Mon, 9 May 2016 15:31:47 -0700 Subject: [PATCH 2/6] Minor Fitbit tweaks. Correct the copy, dont require auth on the routes, get the client_id/client_secret from fitbit.conf instead of the YAML --- homeassistant/components/sensor/fitbit.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/homeassistant/components/sensor/fitbit.py b/homeassistant/components/sensor/fitbit.py index 37281058e02..57e0ba093ab 100644 --- a/homeassistant/components/sensor/fitbit.py +++ b/homeassistant/components/sensor/fitbit.py @@ -153,7 +153,7 @@ def request_app_setup(hass, config, add_devices, config_path, else: setup_platform(hass, config, add_devices, discovery_info) - start_url = "{}{}".format(hass.config.api.base_url, FITBIT_AUTH_START) + start_url = "{}{}".format(hass.config.api.base_url, FITBIT_AUTH_CALLBACK_PATH) description = """Please create a Fitbit developer app at https://dev.fitbit.com/apps/new. @@ -222,8 +222,8 @@ def setup_platform(hass, config, add_devices, discovery_info=None): access_token = config_file.get("access_token") refresh_token = config_file.get("refresh_token") if None not in (access_token, refresh_token): - authd_client = fitbit.Fitbit(config.get("client_id"), - config.get("client_secret"), + authd_client = fitbit.Fitbit(config_file.get("client_id"), + config_file.get("client_secret"), access_token=access_token, refresh_token=refresh_token) @@ -239,8 +239,8 @@ def setup_platform(hass, config, add_devices, discovery_info=None): add_devices(dev) else: - oauth = fitbit.api.FitbitOauth2Client(config.get("client_id"), - config.get("client_secret")) + oauth = fitbit.api.FitbitOauth2Client(config_file.get("client_id"), + config_file.get("client_secret")) redirect_uri = "{}{}".format(hass.config.api.base_url, FITBIT_AUTH_CALLBACK_PATH) @@ -301,9 +301,9 @@ def setup_platform(hass, config, add_devices, discovery_info=None): setup_platform(hass, config, add_devices, discovery_info=None) - hass.http.register_path("GET", FITBIT_AUTH_START, _start_fitbit_auth) + hass.http.register_path("GET", FITBIT_AUTH_START, _start_fitbit_auth, require_auth=False) hass.http.register_path("GET", FITBIT_AUTH_CALLBACK_PATH, - _finish_fitbit_auth) + _finish_fitbit_auth, require_auth=False) request_oauth_completion(hass) From 39e7942dcea6d86eb2b26f38f8c22ecbcbba2543 Mon Sep 17 00:00:00 2001 From: Robbie Trencheny Date: Mon, 9 May 2016 15:33:04 -0700 Subject: [PATCH 3/6] Fitbit flake8 and pylint fixes. Forgot to do it before pushing :( --- homeassistant/components/sensor/fitbit.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/homeassistant/components/sensor/fitbit.py b/homeassistant/components/sensor/fitbit.py index 57e0ba093ab..7e53f986515 100644 --- a/homeassistant/components/sensor/fitbit.py +++ b/homeassistant/components/sensor/fitbit.py @@ -153,7 +153,8 @@ def request_app_setup(hass, config, add_devices, config_path, else: setup_platform(hass, config, add_devices, discovery_info) - start_url = "{}{}".format(hass.config.api.base_url, FITBIT_AUTH_CALLBACK_PATH) + start_url = "{}{}".format(hass.config.api.base_url, + FITBIT_AUTH_CALLBACK_PATH) description = """Please create a Fitbit developer app at https://dev.fitbit.com/apps/new. @@ -301,7 +302,8 @@ def setup_platform(hass, config, add_devices, discovery_info=None): setup_platform(hass, config, add_devices, discovery_info=None) - hass.http.register_path("GET", FITBIT_AUTH_START, _start_fitbit_auth, require_auth=False) + hass.http.register_path("GET", FITBIT_AUTH_START, _start_fitbit_auth, + require_auth=False) hass.http.register_path("GET", FITBIT_AUTH_CALLBACK_PATH, _finish_fitbit_auth, require_auth=False) From e77a7f43851c1f72efcdde131551e8261e4014d9 Mon Sep 17 00:00:00 2001 From: Landrash Date: Tue, 10 May 2016 08:48:48 +0200 Subject: [PATCH 4/6] Fixed minor miss-spelling (#2028) Changed millileters to milliliters. Changed case of mmol/l to mmol/L. --- homeassistant/components/sensor/fitbit.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/homeassistant/components/sensor/fitbit.py b/homeassistant/components/sensor/fitbit.py index 7e53f986515..7d122f857d7 100644 --- a/homeassistant/components/sensor/fitbit.py +++ b/homeassistant/components/sensor/fitbit.py @@ -92,8 +92,8 @@ FITBIT_MEASUREMENTS = { "height": "centimeters", "weight": "stone", "body": "centimeters", - "liquids": "millileters", - "blood glucose": "mmol/l" + "liquids": "milliliters", + "blood glucose": "mmol/L" }, "metric": { "duration": "milliseconds", @@ -102,8 +102,8 @@ FITBIT_MEASUREMENTS = { "height": "centimeters", "weight": "kilograms", "body": "centimeters", - "liquids": "millileters", - "blood glucose": "mmol/l" + "liquids": "milliliters", + "blood glucose": "mmol/L" } } From 0893ddcab74231a342880d964f59dcacd06d7ded Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Tue, 10 May 2016 13:36:03 -0700 Subject: [PATCH 5/6] Update README.rst --- README.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.rst b/README.rst index 5cea28f5dca..b63377dbaf0 100644 --- a/README.rst +++ b/README.rst @@ -1,5 +1,5 @@ Home Assistant |Build Status| |Coverage Status| |Join the chat at https://gitter.im/home-assistant/home-assistant| |Join the dev chat at https://gitter.im/home-assistant/home-assistant/devs| -================================================================================================================== +============================================================================================================================================================================================== Home Assistant is a home automation platform running on Python 3. The goal of Home Assistant is to be able to track and control all devices at From 01eb2d5c84e7a5a306b701006c6a06c2d7f4c37a Mon Sep 17 00:00:00 2001 From: Robbie Trencheny Date: Tue, 10 May 2016 13:42:23 -0700 Subject: [PATCH 6/6] Increment version --- homeassistant/const.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/homeassistant/const.py b/homeassistant/const.py index de7200bd9be..1808ffbada1 100644 --- a/homeassistant/const.py +++ b/homeassistant/const.py @@ -1,7 +1,7 @@ # coding: utf-8 """Constants used by Home Assistant components.""" -__version__ = "0.19.2" +__version__ = "0.19.3" REQUIRED_PYTHON_VER = (3, 4) PLATFORM_FORMAT = '{}.{}'