mirror of
https://github.com/home-assistant/core.git
synced 2025-07-16 09:47:13 +00:00
Add missing humidity feature flag to Whirlpool climate
Both the service action and attribute were implemented already.
This commit is contained in:
parent
91e6c0b53f
commit
edb6da3efa
@ -78,6 +78,7 @@ class AirConEntity(WhirlpoolEntity, ClimateEntity):
|
|||||||
_attr_should_poll = False
|
_attr_should_poll = False
|
||||||
_attr_supported_features = (
|
_attr_supported_features = (
|
||||||
ClimateEntityFeature.TARGET_TEMPERATURE
|
ClimateEntityFeature.TARGET_TEMPERATURE
|
||||||
|
| ClimateEntityFeature.TARGET_HUMIDITY
|
||||||
| ClimateEntityFeature.FAN_MODE
|
| ClimateEntityFeature.FAN_MODE
|
||||||
| ClimateEntityFeature.SWING_MODE
|
| ClimateEntityFeature.SWING_MODE
|
||||||
| ClimateEntityFeature.TURN_OFF
|
| ClimateEntityFeature.TURN_OFF
|
||||||
|
@ -18,7 +18,9 @@
|
|||||||
<HVACMode.FAN_ONLY: 'fan_only'>,
|
<HVACMode.FAN_ONLY: 'fan_only'>,
|
||||||
<HVACMode.OFF: 'off'>,
|
<HVACMode.OFF: 'off'>,
|
||||||
]),
|
]),
|
||||||
|
'max_humidity': 99,
|
||||||
'max_temp': 30,
|
'max_temp': 30,
|
||||||
|
'min_humidity': 30,
|
||||||
'min_temp': 16,
|
'min_temp': 16,
|
||||||
'swing_modes': list([
|
'swing_modes': list([
|
||||||
'horizontal',
|
'horizontal',
|
||||||
@ -48,7 +50,7 @@
|
|||||||
'original_name': None,
|
'original_name': None,
|
||||||
'platform': 'whirlpool',
|
'platform': 'whirlpool',
|
||||||
'previous_unique_id': None,
|
'previous_unique_id': None,
|
||||||
'supported_features': <ClimateEntityFeature: 425>,
|
'supported_features': <ClimateEntityFeature: 429>,
|
||||||
'translation_key': None,
|
'translation_key': None,
|
||||||
'unique_id': 'said1',
|
'unique_id': 'said1',
|
||||||
'unit_of_measurement': None,
|
'unit_of_measurement': None,
|
||||||
@ -68,15 +70,18 @@
|
|||||||
'off',
|
'off',
|
||||||
]),
|
]),
|
||||||
'friendly_name': 'Aircon said1',
|
'friendly_name': 'Aircon said1',
|
||||||
|
'humidity': 50,
|
||||||
'hvac_modes': list([
|
'hvac_modes': list([
|
||||||
<HVACMode.COOL: 'cool'>,
|
<HVACMode.COOL: 'cool'>,
|
||||||
<HVACMode.HEAT: 'heat'>,
|
<HVACMode.HEAT: 'heat'>,
|
||||||
<HVACMode.FAN_ONLY: 'fan_only'>,
|
<HVACMode.FAN_ONLY: 'fan_only'>,
|
||||||
<HVACMode.OFF: 'off'>,
|
<HVACMode.OFF: 'off'>,
|
||||||
]),
|
]),
|
||||||
|
'max_humidity': 99,
|
||||||
'max_temp': 30,
|
'max_temp': 30,
|
||||||
|
'min_humidity': 30,
|
||||||
'min_temp': 16,
|
'min_temp': 16,
|
||||||
'supported_features': <ClimateEntityFeature: 425>,
|
'supported_features': <ClimateEntityFeature: 429>,
|
||||||
'swing_mode': 'horizontal',
|
'swing_mode': 'horizontal',
|
||||||
'swing_modes': list([
|
'swing_modes': list([
|
||||||
'horizontal',
|
'horizontal',
|
||||||
@ -112,7 +117,9 @@
|
|||||||
<HVACMode.FAN_ONLY: 'fan_only'>,
|
<HVACMode.FAN_ONLY: 'fan_only'>,
|
||||||
<HVACMode.OFF: 'off'>,
|
<HVACMode.OFF: 'off'>,
|
||||||
]),
|
]),
|
||||||
|
'max_humidity': 99,
|
||||||
'max_temp': 30,
|
'max_temp': 30,
|
||||||
|
'min_humidity': 30,
|
||||||
'min_temp': 16,
|
'min_temp': 16,
|
||||||
'swing_modes': list([
|
'swing_modes': list([
|
||||||
'horizontal',
|
'horizontal',
|
||||||
@ -142,7 +149,7 @@
|
|||||||
'original_name': None,
|
'original_name': None,
|
||||||
'platform': 'whirlpool',
|
'platform': 'whirlpool',
|
||||||
'previous_unique_id': None,
|
'previous_unique_id': None,
|
||||||
'supported_features': <ClimateEntityFeature: 425>,
|
'supported_features': <ClimateEntityFeature: 429>,
|
||||||
'translation_key': None,
|
'translation_key': None,
|
||||||
'unique_id': 'said2',
|
'unique_id': 'said2',
|
||||||
'unit_of_measurement': None,
|
'unit_of_measurement': None,
|
||||||
@ -162,15 +169,18 @@
|
|||||||
'off',
|
'off',
|
||||||
]),
|
]),
|
||||||
'friendly_name': 'Aircon said2',
|
'friendly_name': 'Aircon said2',
|
||||||
|
'humidity': 50,
|
||||||
'hvac_modes': list([
|
'hvac_modes': list([
|
||||||
<HVACMode.COOL: 'cool'>,
|
<HVACMode.COOL: 'cool'>,
|
||||||
<HVACMode.HEAT: 'heat'>,
|
<HVACMode.HEAT: 'heat'>,
|
||||||
<HVACMode.FAN_ONLY: 'fan_only'>,
|
<HVACMode.FAN_ONLY: 'fan_only'>,
|
||||||
<HVACMode.OFF: 'off'>,
|
<HVACMode.OFF: 'off'>,
|
||||||
]),
|
]),
|
||||||
|
'max_humidity': 99,
|
||||||
'max_temp': 30,
|
'max_temp': 30,
|
||||||
|
'min_humidity': 30,
|
||||||
'min_temp': 16,
|
'min_temp': 16,
|
||||||
'supported_features': <ClimateEntityFeature: 425>,
|
'supported_features': <ClimateEntityFeature: 429>,
|
||||||
'swing_mode': 'horizontal',
|
'swing_mode': 'horizontal',
|
||||||
'swing_modes': list([
|
'swing_modes': list([
|
||||||
'horizontal',
|
'horizontal',
|
||||||
|
@ -10,6 +10,7 @@ from homeassistant.components.climate import (
|
|||||||
ATTR_CURRENT_HUMIDITY,
|
ATTR_CURRENT_HUMIDITY,
|
||||||
ATTR_CURRENT_TEMPERATURE,
|
ATTR_CURRENT_TEMPERATURE,
|
||||||
ATTR_FAN_MODE,
|
ATTR_FAN_MODE,
|
||||||
|
ATTR_HUMIDITY,
|
||||||
ATTR_HVAC_MODE,
|
ATTR_HVAC_MODE,
|
||||||
ATTR_SWING_MODE,
|
ATTR_SWING_MODE,
|
||||||
DOMAIN as CLIMATE_DOMAIN,
|
DOMAIN as CLIMATE_DOMAIN,
|
||||||
@ -20,6 +21,7 @@ from homeassistant.components.climate import (
|
|||||||
FAN_MIDDLE,
|
FAN_MIDDLE,
|
||||||
FAN_OFF,
|
FAN_OFF,
|
||||||
SERVICE_SET_FAN_MODE,
|
SERVICE_SET_FAN_MODE,
|
||||||
|
SERVICE_SET_HUMIDITY,
|
||||||
SERVICE_SET_HVAC_MODE,
|
SERVICE_SET_HVAC_MODE,
|
||||||
SERVICE_SET_SWING_MODE,
|
SERVICE_SET_SWING_MODE,
|
||||||
SERVICE_SET_TEMPERATURE,
|
SERVICE_SET_TEMPERATURE,
|
||||||
@ -136,21 +138,25 @@ async def test_dynamic_attributes(
|
|||||||
mock_instance.get_current_temp.return_value = 15
|
mock_instance.get_current_temp.return_value = 15
|
||||||
mock_instance.get_temp.return_value = 20
|
mock_instance.get_temp.return_value = 20
|
||||||
mock_instance.get_current_humidity.return_value = 80
|
mock_instance.get_current_humidity.return_value = 80
|
||||||
|
mock_instance.get_humidity.return_value = 30
|
||||||
mock_instance.get_h_louver_swing.return_value = True
|
mock_instance.get_h_louver_swing.return_value = True
|
||||||
attributes = (await update_ac_state(hass, entity_id, mock_instance)).attributes
|
attributes = (await update_ac_state(hass, entity_id, mock_instance)).attributes
|
||||||
assert attributes[ATTR_CURRENT_TEMPERATURE] == 15
|
assert attributes[ATTR_CURRENT_TEMPERATURE] == 15
|
||||||
assert attributes[ATTR_TEMPERATURE] == 20
|
assert attributes[ATTR_TEMPERATURE] == 20
|
||||||
assert attributes[ATTR_CURRENT_HUMIDITY] == 80
|
assert attributes[ATTR_CURRENT_HUMIDITY] == 80
|
||||||
|
assert attributes[ATTR_HUMIDITY] == 30
|
||||||
assert attributes[ATTR_SWING_MODE] == SWING_HORIZONTAL
|
assert attributes[ATTR_SWING_MODE] == SWING_HORIZONTAL
|
||||||
|
|
||||||
mock_instance.get_current_temp.return_value = 16
|
mock_instance.get_current_temp.return_value = 16
|
||||||
mock_instance.get_temp.return_value = 21
|
mock_instance.get_temp.return_value = 21
|
||||||
mock_instance.get_current_humidity.return_value = 70
|
mock_instance.get_current_humidity.return_value = 70
|
||||||
|
mock_instance.get_humidity.return_value = 40
|
||||||
mock_instance.get_h_louver_swing.return_value = False
|
mock_instance.get_h_louver_swing.return_value = False
|
||||||
attributes = (await update_ac_state(hass, entity_id, mock_instance)).attributes
|
attributes = (await update_ac_state(hass, entity_id, mock_instance)).attributes
|
||||||
assert attributes[ATTR_CURRENT_TEMPERATURE] == 16
|
assert attributes[ATTR_CURRENT_TEMPERATURE] == 16
|
||||||
assert attributes[ATTR_TEMPERATURE] == 21
|
assert attributes[ATTR_TEMPERATURE] == 21
|
||||||
assert attributes[ATTR_CURRENT_HUMIDITY] == 70
|
assert attributes[ATTR_CURRENT_HUMIDITY] == 70
|
||||||
|
assert attributes[ATTR_HUMIDITY] == 40
|
||||||
assert attributes[ATTR_SWING_MODE] == SWING_OFF
|
assert attributes[ATTR_SWING_MODE] == SWING_OFF
|
||||||
|
|
||||||
|
|
||||||
@ -184,6 +190,7 @@ async def test_dynamic_attributes(
|
|||||||
[False],
|
[False],
|
||||||
),
|
),
|
||||||
(SERVICE_SET_TEMPERATURE, {ATTR_TEMPERATURE: 20}, "set_temp", [20]),
|
(SERVICE_SET_TEMPERATURE, {ATTR_TEMPERATURE: 20}, "set_temp", [20]),
|
||||||
|
(SERVICE_SET_HUMIDITY, {ATTR_HUMIDITY: 30}, "set_humidity", [30]),
|
||||||
(
|
(
|
||||||
SERVICE_SET_FAN_MODE,
|
SERVICE_SET_FAN_MODE,
|
||||||
{ATTR_FAN_MODE: FAN_AUTO},
|
{ATTR_FAN_MODE: FAN_AUTO},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user