1
0
mirror of https://github.com/home-assistant/core.git synced 2026-04-17 15:44:52 +01:00

Use common preset names in Touchline (#166390)

This commit is contained in:
Joost Lekkerkerker
2026-03-24 21:52:24 +01:00
committed by GitHub
parent 9274bd7867
commit 31ff44f1a6
4 changed files with 56 additions and 20 deletions

View File

@@ -9,6 +9,9 @@ import voluptuous as vol
from homeassistant.components.climate import (
PLATFORM_SCHEMA as CLIMATE_PLATFORM_SCHEMA,
PRESET_AWAY,
PRESET_NONE,
PRESET_SLEEP,
ClimateEntity,
ClimateEntityFeature,
HVACMode,
@@ -38,12 +41,12 @@ class PresetMode(NamedTuple):
PRESET_MODES = {
"Normal": PresetMode(mode=0, program=0),
"Night": PresetMode(mode=1, program=0),
"Holiday": PresetMode(mode=2, program=0),
"Pro 1": PresetMode(mode=0, program=1),
"Pro 2": PresetMode(mode=0, program=2),
"Pro 3": PresetMode(mode=0, program=3),
PRESET_NONE: PresetMode(mode=0, program=0),
PRESET_SLEEP: PresetMode(mode=1, program=0),
PRESET_AWAY: PresetMode(mode=2, program=0),
"program_1": PresetMode(mode=0, program=1),
"program_2": PresetMode(mode=0, program=2),
"program_3": PresetMode(mode=0, program=3),
}
TOUCHLINE_HA_PRESETS = {
@@ -140,6 +143,7 @@ class Touchline(ClimateEntity):
ClimateEntityFeature.TARGET_TEMPERATURE | ClimateEntityFeature.PRESET_MODE
)
_attr_temperature_unit = UnitOfTemperature.CELSIUS
_attr_translation_key = "climate"
def __init__(self, touchline_thermostat):
"""Initialize the Touchline device."""

View File

@@ -0,0 +1,17 @@
{
"entity": {
"climate": {
"climate": {
"state_attributes": {
"preset_mode": {
"state": {
"program_1": "mdi:numeric-1",
"program_2": "mdi:numeric-2",
"program_3": "mdi:numeric-3"
}
}
}
}
}
}
}

View File

@@ -18,6 +18,21 @@
}
}
},
"entity": {
"climate": {
"climate": {
"state_attributes": {
"preset_mode": {
"state": {
"program_1": "Program 1",
"program_2": "Program 2",
"program_3": "Program 3"
}
}
}
}
}
},
"issues": {
"deprecated_yaml_import_issue_cannot_connect": {
"description": "Home Assistant could not connect to the Roth Touchline controller while importing your YAML configuration. Remove the YAML configuration for Roth Touchline from configuration.yaml and set up the integration again from the Home Assistant UI.",

View File

@@ -12,12 +12,12 @@
'max_temp': 35,
'min_temp': 7,
'preset_modes': list([
'Normal',
'Night',
'Holiday',
'Pro 1',
'Pro 2',
'Pro 3',
'none',
'sleep',
'away',
'program_1',
'program_2',
'program_3',
]),
}),
'config_entry_id': <ANY>,
@@ -45,7 +45,7 @@
'previous_unique_id': None,
'suggested_object_id': None,
'supported_features': <ClimateEntityFeature: 17>,
'translation_key': None,
'translation_key': 'climate',
'unique_id': 'controller-1_0',
'unit_of_measurement': None,
})
@@ -60,14 +60,14 @@
]),
'max_temp': 35,
'min_temp': 7,
'preset_mode': 'Normal',
'preset_mode': 'none',
'preset_modes': list([
'Normal',
'Night',
'Holiday',
'Pro 1',
'Pro 2',
'Pro 3',
'none',
'sleep',
'away',
'program_1',
'program_2',
'program_3',
]),
'supported_features': <ClimateEntityFeature: 17>,
'temperature': 22.0,