Skip to content

Commit

Permalink
fix: use default if scan_interval settings missing
Browse files Browse the repository at this point in the history
closes #214
  • Loading branch information
alandtse committed May 7, 2022
1 parent 3f3680e commit 0d3d4ce
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion custom_components/tesla_custom/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,9 @@ async def update_listener(hass, config_entry):
"""Update when config_entry options update."""
controller = hass.data[DOMAIN][config_entry.entry_id]["coordinator"].controller
old_update_interval = controller.update_interval
controller.update_interval = config_entry.options.get(CONF_SCAN_INTERVAL)
controller.update_interval = config_entry.options.get(
CONF_SCAN_INTERVAL, DEFAULT_SCAN_INTERVAL
)
if old_update_interval != controller.update_interval:
_LOGGER.debug(
"Changing scan_interval from %s to %s",
Expand Down

0 comments on commit 0d3d4ce

Please sign in to comment.