Added update_interval to maxcube#14143
Merged
syssi merged 3 commits intohome-assistant:devfrom Apr 29, 2018
dingusdk:maxcube
Merged
Added update_interval to maxcube#14143syssi merged 3 commits intohome-assistant:devfrom dingusdk:maxcube
syssi merged 3 commits intohome-assistant:devfrom
dingusdk:maxcube
Conversation
OttoWinter
reviewed
Apr 28, 2018
| CONFIG_GATEWAY = vol.Schema({ | ||
| vol.Required(CONF_HOST): cv.string, | ||
| vol.Optional(CONF_PORT, default=DEFAULT_PORT): cv.port, | ||
| vol.Optional(CONF_UPDATE_INTERVAL, default=300): cv.positive_int, |
Member
There was a problem hiding this comment.
This should be a cv.time_period and preferably also cv.positive_timedelta.
vol.All(cv.time_period, cv.positive_timedelta)
Contributor
Author
There was a problem hiding this comment.
I have changed it to cv.time_period, and convert to total seconds (I did not make the original max cube code, and wanted to make as few changes as possible, and the original code has the update interval in seconds - hard coded to 60 seconds)
| NOTIFICATION_TITLE = 'Max!Cube gateway setup' | ||
|
|
||
| CONF_GATEWAYS = 'gateways' | ||
| CONF_UPDATE_INTERVAL = 'update_interval' |
Member
There was a problem hiding this comment.
I'm not sure about this configuration key name. Most platforms use scan_interval for an update/scan interval.
IMO update_interval makes more sense, but scan_interval would be much more consistent.
Contributor
Author
There was a problem hiding this comment.
I have changed it to scan_interval to be more consistent
syssi
approved these changes
Apr 29, 2018
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description:
Fixes the "reset to factory issue" with maxcube. (see this forum post:
https://community.home-assistant.io/t/maxcube-loosing-configuration/46663/11)
I have added an "update_interval" configuration parameter. Having a longer update interval fixes the issue
Pull request in home-assistant.github.io with documentation (if applicable): home-assistant/home-assistant.io#5265
Example entry for
configuration.yaml(if applicable):Checklist:
tox. Your PR cannot be merged unless tests passIf user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
REQUIREMENTSvariable (example).requirements_all.txtby runningscript/gen_requirements_all.py..coveragerc.If the code does not interact with devices: