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)

This commit is contained in:
Marcelo Moreira de Mello 2016-08-08 00:58:16 -04:00 committed by Paulus Schoutsen
parent b9b1d95514
commit 0383da7af1

View file

@ -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",