-
-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Code quality improvements based on core feedback #385
Conversation
update_interval = entry.options.get(CONF_UPDATE_INTERVAL, DEFAULT_UPDATE_INTERVAL) | ||
update_interval = timedelta( | ||
seconds=entry.options.get(CONF_UPDATE_INTERVAL, DEFAULT_UPDATE_INTERVAL) | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why change this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had to move the following debug from our init method in the Data Update Coordinator. Moving up the timedelta made it easier to reuse this variable for the DataUpdateCoordinator and debug logging.
_LOGGER.debug(
"Initialized DataUpdateCoordinator with %s interval.", str(update_interval)
)
default=self.options.get(CONF_UPDATE_INTERVAL), | ||
default=self.config_entry.options.get( | ||
CONF_UPDATE_INTERVAL, DEFAULT_UPDATE_INTERVAL | ||
), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What’s the difference?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fallback to DEFAULT_UPDATE_INTERVAL
, instead of setting that in the constructor.
No description provided.