-
-
Notifications
You must be signed in to change notification settings - Fork 38k
Add Risco communication delay #101349
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 14 commits into
home-assistant:dev
from
FredericMa:add_communication_delay
Nov 13, 2023
Merged
Add Risco communication delay #101349
Changes from 13 commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
e122fd5
Add optional communication delay in case a panel responds slow.
FredericMa 430f3d2
Add migration test
FredericMa 646bee1
Connect by increasing the communication delay
FredericMa 0558fe4
Update init to use option instead of config
FredericMa c6e5fc2
Updated strings
FredericMa 8e772e6
Fix migration and tests
FredericMa b300b26
Review changes
FredericMa 30786a9
Update connect strategy
FredericMa 388e822
Update tests
FredericMa 459a7c3
Changes after review
FredericMa 839760f
Change typing from object to Any.
FredericMa a334c9e
Add test to validate communication delay update.
FredericMa caf1347
Move test to separate file
FredericMa 5976e12
Change filename.
FredericMa 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
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,21 @@ | ||
| """Tests for the Risco connect logic.""" | ||
|
FredericMa marked this conversation as resolved.
Outdated
|
||
| import pytest | ||
|
|
||
| from homeassistant.components.risco import CannotConnectError | ||
| from homeassistant.components.risco.const import CONF_COMMUNICATION_DELAY | ||
| from homeassistant.core import HomeAssistant | ||
|
|
||
|
|
||
| @pytest.mark.parametrize("exception", [CannotConnectError]) | ||
| async def test_single_error_on_connect( | ||
| hass: HomeAssistant, connect_with_single_error, local_config_entry | ||
| ) -> None: | ||
| """Test single error on connect to validate communication delay update from 0 (default) to 1.""" | ||
| expected_data = { | ||
| **local_config_entry.data, | ||
| **{"type": "local", CONF_COMMUNICATION_DELAY: 1}, | ||
| } | ||
|
|
||
| await hass.config_entries.async_setup(local_config_entry.entry_id) | ||
| await hass.async_block_till_done() | ||
| assert local_config_entry.data == expected_data | ||
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.