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:
parent
b9b1d95514
commit
0383da7af1
1 changed files with 5 additions and 0 deletions
|
@ -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",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue