Skip to content

Commit 551932b

Browse files
committed
Fix button test
* tests/test_init.py:
1 parent d79da44 commit 551932b

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

tests/test_init.py

+5-2
Original file line numberDiff line numberDiff line change
@@ -1232,6 +1232,7 @@ async def test_gas(
12321232
assert hass.states.get("climate.my_living_room_room_temperature").attributes["temperature"] == 25
12331233

12341234

1235+
@responses.activate
12351236
async def test_button(
12361237
hass: HomeAssistant,
12371238
config_entry: MockConfigEntry,
@@ -1246,13 +1247,15 @@ async def test_button(
12461247
"custom_components.daikin_onecta.DaikinApi.async_get_access_token",
12471248
return_value="XXXXXX",
12481249
):
1250+
responses.get(DAIKIN_API_URL + "/v1/gateway-devices", status=200, json=load_fixture_json("dry"))
1251+
12491252
# Call button service
12501253
await hass.services.async_call(
12511254
BUTTON_DOMAIN,
12521255
SERVICE_PRESS,
1253-
{ATTR_ENTITY_ID: "button.altherma_refresh"},
1256+
{ATTR_ENTITY_ID: "button.lounge_refresh"},
12541257
blocking=True,
12551258
)
12561259
await hass.async_block_till_done()
12571260

1258-
assert len(responses.calls) == 0
1261+
assert len(responses.calls) == 1

0 commit comments

Comments
 (0)