-
-
Notifications
You must be signed in to change notification settings - Fork 37.8k
Add DSMR config options for EasyMeter/Q3D #63669
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 3 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
27bddda
Adding DSMR config options for EasyMeter/Q3D
Aeroid 332cfbc
Testing dsmr Q3D telegram
Aeroid 42de101
Failing tests for Q3D code coverage
Aeroid 8be1f1b
Update tests/components/dsmr/conftest.py
Aeroid 7f017f5
Update tests/components/dsmr/test_config_flow.py
Aeroid f749b92
working tests for Q3D and 5L
Aeroid 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
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -99,6 +99,43 @@ async def test_setup_serial(com_mock, hass, dsmr_connection_send_validate_fixtur | |||||||||||||||||||||
| assert result["data"] == {**entry_data, **SERIAL_DATA} | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
|
|
||||||||||||||||||||||
| @patch("serial.tools.list_ports.comports", return_value=[com_port()]) | ||||||||||||||||||||||
| async def test_setup_Q3D(com_mock, hass, dsmr_connection_send_validate_fixture): | ||||||||||||||||||||||
| """Test we can setup serial.""" | ||||||||||||||||||||||
| port = com_port() | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| result = await hass.config_entries.flow.async_init( | ||||||||||||||||||||||
| DOMAIN, context={"source": config_entries.SOURCE_USER} | ||||||||||||||||||||||
| ) | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| assert result["type"] == "form" | ||||||||||||||||||||||
| assert result["step_id"] == "user" | ||||||||||||||||||||||
| assert result["errors"] is None | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| result = await hass.config_entries.flow.async_configure( | ||||||||||||||||||||||
| result["flow_id"], | ||||||||||||||||||||||
| {"type": "Serial"}, | ||||||||||||||||||||||
| ) | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| assert result["type"] == "form" | ||||||||||||||||||||||
| assert result["step_id"] == "setup_serial" | ||||||||||||||||||||||
| assert result["errors"] == {} | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| with patch("homeassistant.components.dsmr.async_setup_entry", return_value=True): | ||||||||||||||||||||||
| result = await hass.config_entries.flow.async_configure( | ||||||||||||||||||||||
| result["flow_id"], {"port": port.device, "dsmr_version": "Q3D"} | ||||||||||||||||||||||
| ) | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| entry_data = { | ||||||||||||||||||||||
| "port": port.device, | ||||||||||||||||||||||
| "dsmr_version": "Q3D", | ||||||||||||||||||||||
| } | ||||||||||||||||||||||
|
Comment on lines
+129
to
+173
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||||||||||
|
|
||||||||||||||||||||||
| assert result["type"] == "create_entry" | ||||||||||||||||||||||
| assert result["title"] == port.device | ||||||||||||||||||||||
| assert result["data"] == {**entry_data, **SERIAL_DATA} | ||||||||||||||||||||||
|
Aeroid marked this conversation as resolved.
Outdated
|
||||||||||||||||||||||
|
|
||||||||||||||||||||||
|
|
||||||||||||||||||||||
| @patch("serial.tools.list_ports.comports", return_value=[com_port()]) | ||||||||||||||||||||||
| async def test_setup_serial_manual( | ||||||||||||||||||||||
| com_mock, hass, dsmr_connection_send_validate_fixture | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
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.