-
-
Notifications
You must be signed in to change notification settings - Fork 37.4k
Add vera config entries support #29880
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
Merged
MartinHjelmare
merged 21 commits into
home-assistant:dev
from
vangorra:vangorra_vera_config_entries
Apr 3, 2020
Merged
Changes from all commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
15f28a1
Adding vera config entries support.
vangorra 94382a7
Fixing lint error.
vangorra 07ec5bf
Applying minimal changes necessary to get config entries working.
vangorra 6460f21
Addressing PR feedback by further reducing the scope of the change.
vangorra db0840a
Addressing PR feedback.
vangorra eb71881
Fixing pyvera import to make it easier to patch.
vangorra 251ba61
Updating code owners file.
vangorra d6e4784
Small fixes.
vangorra 30eb170
Adding a user config flow step.
vangorra 29aeab7
Adding optional configs for user config flow.
vangorra 232fb18
Updating strings to be more clear to the user.
vangorra d590c8d
Adding options flow.
vangorra c233a25
Better handling of options.
vangorra 6bb7f10
Using config registry to update config options.
vangorra 5797c6c
Better managing config from file or config from UI
vangorra 62a5667
Address PR feedback.
vangorra aa95209
Fixing test, merging with master.
vangorra 91140f6
Disabling all Vera UI for configs managed by configuration.yml.
vangorra bf8f5f9
Updating config based on unique_id.
vangorra db1010f
Rebasing off dev.
vangorra 3d12eee
Addressing PR feedback.
vangorra File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| """Common vera code.""" | ||
|
MartinHjelmare marked this conversation as resolved.
|
||
| import logging | ||
| from typing import DefaultDict, List, NamedTuple, Set | ||
|
|
||
| import pyvera as pv | ||
|
|
||
| from homeassistant.components.scene import DOMAIN as SCENE_DOMAIN | ||
|
|
||
| _LOGGER = logging.getLogger(__name__) | ||
|
|
||
|
|
||
| class ControllerData(NamedTuple): | ||
| """Controller data.""" | ||
|
|
||
| controller: pv.VeraController | ||
| devices: DefaultDict[str, List[pv.VeraDevice]] | ||
| scenes: List[pv.VeraScene] | ||
|
|
||
|
|
||
| def get_configured_platforms(controller_data: ControllerData) -> Set[str]: | ||
| """Get configured platforms for a controller.""" | ||
| platforms = [] | ||
| for platform in controller_data.devices: | ||
| platforms.append(platform) | ||
|
|
||
| if controller_data.scenes: | ||
| platforms.append(SCENE_DOMAIN) | ||
|
|
||
| return set(platforms) | ||
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.