mirror of
https://github.com/home-assistant/core.git
synced 2025-07-09 22:37:11 +00:00
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
@ -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…
x
Reference in New Issue
Block a user