From a874895a819e59c0417c354c175737c3f2b1e0a4 Mon Sep 17 00:00:00 2001 From: Bouwe Westerdijk <11290930+bouwew@users.noreply.github.com> Date: Tue, 16 Jan 2024 14:35:09 +0100 Subject: [PATCH] Add gateway_mode Select to Plugwise (#108019) --- homeassistant/components/plugwise/const.py | 2 ++ homeassistant/components/plugwise/select.py | 8 ++++++++ homeassistant/components/plugwise/strings.json | 8 ++++++++ tests/components/plugwise/test_select.py | 3 +++ 4 files changed, 21 insertions(+) diff --git a/homeassistant/components/plugwise/const.py b/homeassistant/components/plugwise/const.py index f5677c0b4a9..cad891f16f2 100644 --- a/homeassistant/components/plugwise/const.py +++ b/homeassistant/components/plugwise/const.py @@ -44,11 +44,13 @@ NumberType = Literal[ SelectType = Literal[ "select_dhw_mode", + "select_gateway_mode", "select_regulation_mode", "select_schedule", ] SelectOptionsType = Literal[ "dhw_modes", + "gateway_modes", "regulation_modes", "available_schedules", ] diff --git a/homeassistant/components/plugwise/select.py b/homeassistant/components/plugwise/select.py index 4be21fe9026..abb36bd5743 100644 --- a/homeassistant/components/plugwise/select.py +++ b/homeassistant/components/plugwise/select.py @@ -50,6 +50,14 @@ SELECT_TYPES = ( command=lambda api, loc, opt: api.set_dhw_mode(opt), options_key="dhw_modes", ), + PlugwiseSelectEntityDescription( + key="select_gateway_mode", + translation_key="gateway_mode", + icon="mdi:cog-outline", + entity_category=EntityCategory.CONFIG, + command=lambda api, loc, opt: api.set_gateway_mode(opt), + options_key="gateway_modes", + ), ) diff --git a/homeassistant/components/plugwise/strings.json b/homeassistant/components/plugwise/strings.json index addd1ceadb1..7d26f5a624c 100644 --- a/homeassistant/components/plugwise/strings.json +++ b/homeassistant/components/plugwise/strings.json @@ -97,6 +97,14 @@ "comfort": "[%key:component::climate::entity_component::_::state_attributes::preset_mode::state::comfort%]" } }, + "gateway_mode": { + "name": "Gateway mode", + "state": { + "away": "Pause", + "full": "Normal", + "vacation": "Vacation" + } + }, "regulation_mode": { "name": "Regulation mode", "state": { diff --git a/tests/components/plugwise/test_select.py b/tests/components/plugwise/test_select.py index f1220a07a2b..86b21af9e8b 100644 --- a/tests/components/plugwise/test_select.py +++ b/tests/components/plugwise/test_select.py @@ -54,6 +54,9 @@ async def test_adam_select_regulation_mode( Also tests a change in climate _previous mode. """ + state = hass.states.get("select.adam_gateway_mode") + assert state + assert state.state == "full" state = hass.states.get("select.adam_regulation_mode") assert state assert state.state == "cooling"