mirror of
https://github.com/home-assistant/core.git
synced 2025-12-24 21:06:19 +00:00
Add support for Stretch product to Plugwise integration (#40108)
* Initial switch-group/stretch with failing wk_lisa_battery test * Adding switch tests, but TypeErrors, needs more investigation * Fixes and tests aligned * Review updates * Use const * Comments * Add stretch hostname for testing part * Remove unused consts * Revert guardings in line with -beta * Catchup with dev (mostly with ourselves from #41201) * Update docstring * Remove debug logging * Fix for #42725 (incorrect entity namingi) * Fix naming for gas interval * Add missing CONF_USERNAME and use of it * Change "dummy" to "class" * Don't use "class" * Fix CONF_USERNAME default, dummy and other consts Co-authored-by: Bouwe Westerdijk <11290930+bouwew@users.noreply.github.com>
This commit is contained in:
@@ -48,3 +48,49 @@ async def test_adam_climate_switch_changes(hass, mock_smile_adam):
|
||||
)
|
||||
state = hass.states.get("switch.fibaro_hc2")
|
||||
assert str(state.state) == "on"
|
||||
|
||||
|
||||
async def test_stretch_switch_entities(hass, mock_stretch):
|
||||
"""Test creation of climate related switch entities."""
|
||||
entry = await async_init_integration(hass, mock_stretch)
|
||||
assert entry.state == ENTRY_STATE_LOADED
|
||||
|
||||
state = hass.states.get("switch.koelkast_92c4a")
|
||||
assert str(state.state) == "on"
|
||||
|
||||
state = hass.states.get("switch.droger_52559")
|
||||
assert str(state.state) == "on"
|
||||
|
||||
|
||||
async def test_stretch_switch_changes(hass, mock_stretch):
|
||||
"""Test changing of power related switch entities."""
|
||||
entry = await async_init_integration(hass, mock_stretch)
|
||||
assert entry.state == ENTRY_STATE_LOADED
|
||||
|
||||
await hass.services.async_call(
|
||||
"switch",
|
||||
"turn_off",
|
||||
{"entity_id": "switch.koelkast_92c4a"},
|
||||
blocking=True,
|
||||
)
|
||||
|
||||
state = hass.states.get("switch.koelkast_92c4a")
|
||||
assert str(state.state) == "off"
|
||||
|
||||
await hass.services.async_call(
|
||||
"switch",
|
||||
"toggle",
|
||||
{"entity_id": "switch.droger_52559"},
|
||||
blocking=True,
|
||||
)
|
||||
state = hass.states.get("switch.droger_52559")
|
||||
assert str(state.state) == "off"
|
||||
|
||||
await hass.services.async_call(
|
||||
"switch",
|
||||
"toggle",
|
||||
{"entity_id": "switch.droger_52559"},
|
||||
blocking=True,
|
||||
)
|
||||
state = hass.states.get("switch.droger_52559")
|
||||
assert str(state.state) == "on"
|
||||
|
||||
Reference in New Issue
Block a user