From 0383da7af1da4c2df2956a27fc20ccbfff37c215 Mon Sep 17 00:00:00 2001 From: Marcelo Moreira de Mello Date: Mon, 8 Aug 2016 00:58:16 -0400 Subject: [PATCH] This patch makes use of the unit_system global configuration parameter to determine the mesurement system between 'metric' or 'imperial' for Fibit component. It also supports the fitbit accept-language when en_GB measurement is desired. (#2745) --- homeassistant/components/sensor/fitbit.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/homeassistant/components/sensor/fitbit.py b/homeassistant/components/sensor/fitbit.py index 01c067a19f2..eb87527a546 100644 --- a/homeassistant/components/sensor/fitbit.py +++ b/homeassistant/components/sensor/fitbit.py @@ -232,6 +232,11 @@ def setup_platform(hass, config, add_devices, discovery_info=None): authd_client.client.refresh_token() authd_client.system = authd_client.user_profile_get()["user"]["locale"] + if authd_client.system != 'en_GB': + if hass.config.units.is_metric: + authd_client.system = "metric" + else: + authd_client.system = "en_US" dev = [] for resource in config.get("monitored_resources",