-
-
Notifications
You must be signed in to change notification settings - Fork 37.4k
Move totalconnect from platform to component config #24427
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
Merged
Changes from all commits
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
54dbdd6
Merge pull request #1 from home-assistant/dev
austinmroczek 90483d2
Merge branch 'dev' of https://github.com/home-assistant/home-assistan…
austinmroczek 51aa773
Bump skybellpy to 0.4.0
austinmroczek e18b4d2
Bump skybellpy to 0.4.0 in requirements_all.txt
austinmroczek d74156a
Added extra states for STATE_ALARM_TRIGGERED to allow users to know if
austinmroczek ad1cdb3
Merge branch 'dev' of https://github.com/austinmroczek/home-assistant…
austinmroczek 5c5c052
Merge pull request #2 from home-assistant/dev
austinmroczek abcc85a
Fix const import
austinmroczek d303091
Fix const import
austinmroczek 73f38eb
Fix const imports
austinmroczek 5bec7e4
Bump total-connect-client to 0.26.
austinmroczek 4862ff5
Catch details of alarm trigger in state attributes.
austinmroczek 5068345
Merge branch 'dev' of
austinmroczek e7a13d4
Change state_attributes() to device_state_attributes()
austinmroczek 53f20fb
Merge remote-tracking branch 'upstream/dev' into dev
austinmroczek 4bee662
Merge branch 'dev' of https://github.com/austinmroczek/home-assistant…
austinmroczek 6a50e80
Move totalconnect component toward being a multi-platform integration…
austinmroczek 37c34cf
Merge pull request #4 from home-assistant/dev
austinmroczek ad4c4c9
add missing total-connect alarm state mappings
austinmroczek e589317
Made recommended changes of MartinHjelmare at
austinmroczek aa22440
Update __init__.py
austinmroczek 5cbfc98
Updates per MartinHjelmare comments
austinmroczek eb440cc
flake8/pydocstyle fixes
austinmroczek 69425d7
Merge branch 'dev' of https://github.com/austinmroczek/home-assistant…
austinmroczek 117ed1b
removed . at end of log message
austinmroczek 14d3e2e
added blank line between logging and voluptuous
austinmroczek cd2b563
more fixes
austinmroczek 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1,54 @@ | ||
| """The totalconnect component.""" | ||
| import logging | ||
|
|
||
| import voluptuous as vol | ||
| from total_connect_client import TotalConnectClient | ||
|
|
||
| import homeassistant.helpers.config_validation as cv | ||
| from homeassistant.helpers import discovery | ||
| from homeassistant.const import (CONF_PASSWORD, CONF_USERNAME) | ||
|
|
||
|
|
||
| _LOGGER = logging.getLogger(__name__) | ||
|
|
||
| DOMAIN = 'totalconnect' | ||
|
|
||
| CONFIG_SCHEMA = vol.Schema({ | ||
| DOMAIN: vol.Schema({ | ||
| vol.Required(CONF_USERNAME): cv.string, | ||
| vol.Required(CONF_PASSWORD): cv.string, | ||
| }), | ||
| }, extra=vol.ALLOW_EXTRA) | ||
|
|
||
| TOTALCONNECT_PLATFORMS = ['alarm_control_panel'] | ||
|
|
||
|
|
||
| def setup(hass, config): | ||
| """Set up TotalConnect component.""" | ||
| conf = config[DOMAIN] | ||
|
|
||
| username = conf[CONF_USERNAME] | ||
| password = conf[CONF_PASSWORD] | ||
|
|
||
| client = TotalConnectClient.TotalConnectClient(username, password) | ||
|
|
||
| if client.token is False: | ||
| _LOGGER.error("TotalConnect authentication failed") | ||
| return False | ||
|
austinmroczek marked this conversation as resolved.
|
||
|
|
||
| hass.data[DOMAIN] = TotalConnectSystem(username, password, client) | ||
|
|
||
| for platform in TOTALCONNECT_PLATFORMS: | ||
| discovery.load_platform(hass, platform, DOMAIN, {}, config) | ||
|
|
||
| return True | ||
|
|
||
|
|
||
| class TotalConnectSystem: | ||
| """TotalConnect System class.""" | ||
|
|
||
| def __init__(self, username, password, client): | ||
| """Initialize the TotalConnect system.""" | ||
| self._username = username | ||
| self._password = password | ||
| self.client = client | ||
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
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.