10000 Map SmartThings auto mode correctly by joostlek · Pull Request #145061 · home-assistant/core · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Map SmartThings auto mode correctly #145061

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 1 commit into from
May 16, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions homeassistant/components/smartthings/climate.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

ATTR_OPERATION_STATE = "operation_state"
MODE_TO_STATE = {
"auto": HVACMode.HEAT_COOL,
"auto": HVACMode.AUTO,
"cool": HVACMode.COOL,
"eco": HVACMode.AUTO,
"rush hour": HVACMode.AUTO,
Expand All @@ -40,7 +40,7 @@
"off": HVACMode.OFF,
}
STATE_TO_MODE = {
HVACMode.HEAT_COOL: "auto",
HVACMode.AUTO: "auto",
HVACMode.COOL: "cool",
HVACMode.HEAT: "heat",
HVACMode.OFF: "off",
Expand All @@ -58,7 +58,7 @@
}

AC_MODE_TO_STATE = {
"auto": HVACMode.HEAT_COOL,
"auto": HVACMode.AUTO,
"cool": HVACMode.COOL,
"dry": HVACMode.DRY,
"coolClean": HVACMode.COOL,
Expand All @@ -69,7 +69,7 @@
"wind": HVACMode.FAN_ONLY,
}
STATE_TO_AC_MODE = {
HVACMode.HEAT_COOL: "auto",
HVACMode.AUTO: "auto",
HVACMode.COOL: "cool",
HVACMode.DRY: "dry",
HVACMode.HEAT: "heat",
Expand Down
20 changes: 10 additions & 10 deletions tests/components/smartthings/snapshots/test_climate.ambr
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@
<HVACMode.COOL: 'cool'>,
<HVACMode.DRY: 'dry'>,
<HVACMode.FAN_ONLY: 'fan_only'>,
<HVACMode.HEAT_COOL: 'heat_cool'>,
<HVACMode.AUTO: 'auto'>,
<HVACMode.HEAT: 'heat'>,
]),
'max_temp': 35,
Expand Down Expand Up @@ -206,7 +206,7 @@
<HVACMode.COOL: 'cool'>,
<HVACMode.DRY: 'dry'>,
<HVACMode.FAN_ONLY: 'fan_only'>,
<HVACMode.HEAT_COOL: 'heat_cool'>,
<HVACMode.AUTO: 'auto'>,
<HVACMode.HEAT: 'heat'>,
]),
'max_temp': 35,
Expand Down Expand Up @@ -246,7 +246,7 @@
<HVACMode.COOL: 'cool'>,
<HVACMode.DRY: 'dry'>,
<HVACMode.FAN_ONLY: 'fan_only'>,
<HVACMode.HEAT_COOL: 'heat_cool'>,
<HVACMode.AUTO: 'auto'>,
]),
'max_temp': 35,
'min_temp': 7,
Expand Down Expand Up @@ -308,7 +308,7 @@
<HVACMode.COOL: 'cool'>,
<HVACMode.DRY: 'dry'>,
<HVACMode.FAN_ONLY: 'fan_only'>,
<HVACMode.HEAT_COOL: 'heat_cool'>,
<HVACMode.AUTO: 'auto'>,
]),
'max_temp': 35,
'min_temp': 7,
Expand Down Expand Up @@ -349,7 +349,7 @@
]),
'hvac_modes': list([
<HVACMode.OFF: 'off'>,
<HVACMode.HEAT_COOL: 'heat_cool'>,
<HVACMode.AUTO: 'auto'>,
<HVACMode.COOL: 'cool'>,
<HVACMode.DRY: 'dry'>,
<HVACMode.FAN_ONLY: 'fan_only'>,
Expand Down Expand Up @@ -414,7 +414,7 @@
'friendly_name': 'Aire Dormitorio Principal',
'hvac_modes': list([
<HVACMode.OFF: 'off'>,
<HVACMode.HEAT_COOL: 'heat_cool'>,
<HVACMode.AUTO: 'auto'>,
<HVACMode.COOL: 'cool'>,
<HVACMode.DRY: 'dry'>,
<HVACMode.FAN_ONLY: 'fan_only'>,
Expand Down Expand Up @@ -462,7 +462,7 @@
<HVACMode.COOL: 'cool'>,
<HVACMode.DRY: 'dry'>,
<HVACMode.FAN_ONLY: 'fan_only'>,
<HVACMode.HEAT_COOL: 'heat_cool'>,
<HVACMode.AUTO: 'auto'>,
]),
'max_temp': 35,
'min_temp': 7,
Expand Down Expand Up @@ -513,7 +513,7 @@
<HVACMode.COOL: 'cool'>,
<HVACMode.DRY: 'dry'>,
<HVACMode.FAN_ONLY: 'fan_only'>,
<HVACMode.HEAT_COOL: 'heat_cool'>,
<HVACMode.AUTO: 'auto'>,
]),
'max_temp': 35,
'min_temp': 7,
Expand Down Expand Up @@ -541,7 +541,7 @@
'hvac_modes': list([
<HVACMode.OFF: 'off'>,
<HVACMode.COOL: 'cool'>,
<HVACMode.HEAT_COOL: 'heat_cool'>,
<HVACMode.AUTO: 'auto'>,
]),
'max_temp': 35.0,
'min_temp': 7.0,
Expand Down Expand Up @@ -589,7 +589,7 @@
'hvac_modes': list([
<HVACMode.OFF: 'off'>,
<HVACMode.COOL: 'cool'>,
<HVACMode.HEAT_COOL: 'heat_cool'>,
<HVACMode.AUTO: 'auto'>,
]),
'max_temp': 35.0,
'min_temp': 7.0,
Expand Down
10 changes: 5 additions & 5 deletions tests/components/smartthings/test_climate.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ async def test_ac_set_hvac_mode_off(
@pytest.mark.parametrize(
("hvac_mode", "argument"),
[
(HVACMode.HEAT_COOL, "auto"),
(HVACMode.AUTO, "auto"),
(HVACMode.COOL, "cool"),
(HVACMode.DRY, "dry"),
(HVACMode.HEAT, "heat"),
Expand Down Expand Up @@ -174,7 +174,7 @@ async def test_ac_set_hvac_mode_turns_on(
SERVICE_SET_HVAC_MODE,
{
ATTR_ENTITY_ID: "climate.ac_office_granit",
ATTR_HVAC_MODE: HVACMode.HEAT_COOL,
ATTR_HVAC_MODE: HVACMode.AUTO,
},
blocking=True,
)
Expand Down Expand Up @@ -266,7 +266,7 @@ async def test_ac_set_temperature_and_hvac_mode_while_off(
{
ATTR_ENTITY_ID: "climate.ac_office_granit",
ATTR_TEMPERATURE: 23,
ATTR_HVAC_MODE: HVACMode.HEAT_COOL,
ATTR_HVAC_MODE: HVACMode.AUTO,
},
blocking=True,
)
Expand Down Expand Up @@ -316,7 +316,7 @@ async def test_ac_set_temperature_and_hvac_mode(
{
ATTR_ENTITY_ID: "climate.ac_office_granit",
ATTR_TEMPERATURE: 23,
ATTR_HVAC_MODE: HVACMode.HEAT_COOL,
ATTR_HVAC_MODE: HVACMode.AUTO,
},
blocking=True,
)
Expand Down Expand Up @@ -623,7 +623,7 @@ async def test_thermostat_set_hvac_mode(
await hass.services.async_call(
CLIMATE_DOMAIN,
SERVICE_SET_HVAC_MODE,
{ATTR_ENTITY_ID: "climate.asd", ATTR_HVAC_MODE: HVACMode.HEAT_COOL},
{ATTR_ENTITY_ID: "climate.asd", ATTR_HVAC_MODE: HVACMode.AUTO},
blocking=True,
)
devices.execute_device_command.assert_called_once_with(
Expand Down
0