-
-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support Cozytouch, Rexel and Connexoon RTS. (#332)
Co-authored-by: Vincent Le Bourlot <[email protected]>
- Loading branch information
Showing
9 changed files
with
68 additions
and
21 deletions.
There are no files selected for viewing
This file contains 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 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 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 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 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 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 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 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 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 |
---|---|---|
|
@@ -13,6 +13,7 @@ | |
|
||
TEST_EMAIL = "[email protected]" | ||
TEST_PASSWORD = "test-password" | ||
DEFAULT_HUB = "Somfy TaHoma" | ||
|
||
|
||
async def test_form(hass): | ||
|
@@ -30,14 +31,15 @@ async def test_form(hass): | |
"custom_components.tahoma.async_setup_entry", return_value=True | ||
) as mock_setup_entry: | ||
result2 = await hass.config_entries.flow.async_configure( | ||
result["flow_id"], {"username": TEST_EMAIL, "password": TEST_PASSWORD}, | ||
result["flow_id"], {"username": TEST_EMAIL, "password": TEST_PASSWORD, "hub": DEFAULT_HUB}, | ||
) | ||
|
||
assert result2["type"] == "create_entry" | ||
assert result2["title"] == TEST_EMAIL | ||
assert result2["data"] == { | ||
"username": TEST_EMAIL, | ||
"password": TEST_PASSWORD, | ||
"hub": DEFAULT_HUB | ||
} | ||
|
||
await hass.async_block_till_done() | ||
|
@@ -64,7 +66,7 @@ async def test_form_invalid(hass, side_effect, error): | |
|
||
with patch("pyhoma.client.TahomaClient.login", side_effect=side_effect): | ||
result2 = await hass.config_entries.flow.async_configure( | ||
result["flow_id"], {"username": TEST_EMAIL, "password": TEST_PASSWORD}, | ||
result["flow_id"], {"username": TEST_EMAIL, "password": TEST_PASSWORD, "hub": DEFAULT_HUB}, | ||
) | ||
|
||
assert result2["type"] == "form" | ||
|
@@ -76,7 +78,7 @@ async def test_abort_on_duplicate_entry(hass): | |
MockConfigEntry( | ||
domain=config_flow.DOMAIN, | ||
unique_id=TEST_EMAIL, | ||
data={"username": TEST_EMAIL, "password": TEST_PASSWORD}, | ||
data={"username": TEST_EMAIL, "password": TEST_PASSWORD, "hub": DEFAULT_HUB}, | ||
).add_to_hass(hass) | ||
|
||
result = await hass.config_entries.flow.async_init( | ||
|
@@ -89,7 +91,7 @@ async def test_abort_on_duplicate_entry(hass): | |
"custom_components.tahoma.async_setup_entry", return_value=True | ||
) as mock_setup_entry: | ||
result2 = await hass.config_entries.flow.async_configure( | ||
result["flow_id"], {"username": TEST_EMAIL, "password": TEST_PASSWORD}, | ||
result["flow_id"], {"username": TEST_EMAIL, "password": TEST_PASSWORD, "hub": DEFAULT_HUB}, | ||
) | ||
|
||
assert result2["type"] == "abort" | ||
|
@@ -101,7 +103,7 @@ async def test_allow_multiple_unique_entries(hass): | |
MockConfigEntry( | ||
domain=config_flow.DOMAIN, | ||
unique_id="[email protected]", | ||
data={"username": "[email protected]", "password": TEST_PASSWORD}, | ||
data={"username": "[email protected]", "password": TEST_PASSWORD, "hub": DEFAULT_HUB}, | ||
).add_to_hass(hass) | ||
|
||
result = await hass.config_entries.flow.async_init( | ||
|
@@ -114,14 +116,15 @@ async def test_allow_multiple_unique_entries(hass): | |
"custom_components.tahoma.async_setup_entry", return_value=True | ||
) as mock_setup_entry: | ||
result2 = await hass.config_entries.flow.async_configure( | ||
result["flow_id"], {"username": TEST_EMAIL, "password": TEST_PASSWORD}, | ||
result["flow_id"], {"username": TEST_EMAIL, "password": TEST_PASSWORD, "hub": DEFAULT_HUB}, | ||
) | ||
|
||
assert result2["type"] == "create_entry" | ||
assert result2["title"] == TEST_EMAIL | ||
assert result2["data"] == { | ||
"username": TEST_EMAIL, | ||
"password": TEST_PASSWORD, | ||
"hub": DEFAULT_HUB | ||
} | ||
|
||
|
||
|
@@ -135,13 +138,14 @@ async def test_import(hass): | |
result = await hass.config_entries.flow.async_init( | ||
config_flow.DOMAIN, | ||
context={"source": config_entries.SOURCE_IMPORT}, | ||
data={"username": TEST_EMAIL, "password": TEST_PASSWORD}, | ||
data={"username": TEST_EMAIL, "password": TEST_PASSWORD, "hub": DEFAULT_HUB}, | ||
) | ||
assert result["type"] == "create_entry" | ||
assert result["title"] == TEST_EMAIL | ||
assert result["data"] == { | ||
"username": TEST_EMAIL, | ||
"password": TEST_PASSWORD, | ||
"hub": DEFAULT_HUB | ||
} | ||
|
||
await hass.async_block_till_done() | ||
|
@@ -166,7 +170,7 @@ async def test_import_failing(hass, side_effect, error): | |
await hass.config_entries.flow.async_init( | ||
config_flow.DOMAIN, | ||
context={"source": config_entries.SOURCE_IMPORT}, | ||
data={"username": TEST_EMAIL, "password": TEST_PASSWORD}, | ||
data={"username": TEST_EMAIL, "password": TEST_PASSWORD, "hub": DEFAULT_HUB}, | ||
) | ||
|
||
# Should write Exception to the log | ||
|
@@ -178,7 +182,7 @@ async def test_options_flow(hass): | |
entry = MockConfigEntry( | ||
domain=config_flow.DOMAIN, | ||
unique_id=TEST_EMAIL, | ||
data={"username": TEST_EMAIL, "password": TEST_PASSWORD}, | ||
data={"username": TEST_EMAIL, "password": TEST_PASSWORD, "hub": DEFAULT_HUB}, | ||
) | ||
|
||
with patch("pyhoma.client.TahomaClient.login", return_value=True), patch( | ||
|
740f40f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello,
I tested with the rexel box, and it works
740f40f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great to hear, @hamzazzi! In case you encounter any issues or if you have a feature request, feel free to create an issue on GitHub. https://github.com/iMicknl/ha-tahoma/issues/new/choose