diff --git a/custom_components/nissan_connect/config_flow.py b/custom_components/nissan_connect/config_flow.py index 006c9c5..f5897c7 100644 --- a/custom_components/nissan_connect/config_flow.py +++ b/custom_components/nissan_connect/config_flow.py @@ -121,7 +121,8 @@ async def async_step_init(self, options): vol.Required( "interval_statistics", default=self._config_entry.data.get("interval_statistics", DEFAULT_INTERVAL_STATISTICS) ): int, - vol.Required( - "imperial_distance", default=self._config_entry.data.get("imperial_distance", False)): bool + # Excluded from config flow under #61 + # vol.Required( + # "imperial_distance", default=self._config_entry.data.get("imperial_distance", False)): bool }), errors=errors ) diff --git a/custom_components/nissan_connect/coordinator.py b/custom_components/nissan_connect/coordinator.py index aabaa0c..2afc36e 100644 --- a/custom_components/nissan_connect/coordinator.py +++ b/custom_components/nissan_connect/coordinator.py @@ -77,6 +77,9 @@ def set_next_interval(self): if interval != (self.update_interval.seconds / 60): _LOGGER.debug(f"Changing next update interval to {interval} minutes") self.update_interval = timedelta(minutes=interval) + self._async_unsub_refresh() + if self._listeners: + self._schedule_refresh() async def _async_update_data(self): """Fetch data from API.""" diff --git a/custom_components/nissan_connect/translations/en.json b/custom_components/nissan_connect/translations/en.json index 5ab62a1..6c7f2c6 100644 --- a/custom_components/nissan_connect/translations/en.json +++ b/custom_components/nissan_connect/translations/en.json @@ -12,7 +12,7 @@ "interval_statistics": "Update interval for daily/monthly statistics (minutes)", "interval_fetch": "Update interval (minutes)", "region": "Region (EU, US)", - "imperial_distance": "Use imperial distance units" + "imperial_distance": "Use imperial distance units (miles)" }, "data_description": { "interval_charging": "The car will be woken up and new data requested at every polling interval.", @@ -37,7 +37,7 @@ "interval_charging": "Polling interval while charging (minutes)", "interval_statistics": "Update interval for daily/monthly statistics (minutes)", "interval_fetch": "Update interval (minutes)", - "imperial_distance": "Use imperial distance units" + "imperial_distance": "Use imperial distance units (miles)" }, "data_description": { "password": "If you are not changing your credentials, leave the password field empty.",