Fix min/max temp and humidity for homekit_controller climate (#23421)
* Fix min/max temp and humidity for homekit_controller climate. * Fix typo
This commit is contained in:
parent
b0843f4a38
commit
1c4367e5a9
4 changed files with 59 additions and 1 deletions
|
@ -180,6 +180,12 @@ async def setup_accessories_from_file(hass, path):
|
|||
char.description = char_data['description']
|
||||
if 'value' in char_data:
|
||||
char.value = char_data['value']
|
||||
if 'minValue' in char_data:
|
||||
char.minValue = char_data['minValue']
|
||||
if 'maxValue' in char_data:
|
||||
char.maxValue = char_data['maxValue']
|
||||
if 'valid-values' in char_data:
|
||||
char.valid_values = char_data['valid-values']
|
||||
service.characteristics.append(char)
|
||||
|
||||
accessory.services.append(service)
|
||||
|
|
|
@ -10,6 +10,7 @@ from homekit import AccessoryDisconnectedError
|
|||
|
||||
from homeassistant.components.climate.const import (
|
||||
SUPPORT_TARGET_TEMPERATURE, SUPPORT_TARGET_HUMIDITY,
|
||||
SUPPORT_TARGET_HUMIDITY_HIGH, SUPPORT_TARGET_HUMIDITY_LOW,
|
||||
SUPPORT_OPERATION_MODE)
|
||||
from tests.components.homekit_controller.common import (
|
||||
FakePairing, device_config_changed, setup_accessories_from_file,
|
||||
|
@ -32,9 +33,15 @@ async def test_ecobee3_setup(hass):
|
|||
assert climate_state.attributes['friendly_name'] == 'HomeW'
|
||||
assert climate_state.attributes['supported_features'] == (
|
||||
SUPPORT_TARGET_TEMPERATURE | SUPPORT_TARGET_HUMIDITY |
|
||||
SUPPORT_TARGET_HUMIDITY_HIGH | SUPPORT_TARGET_HUMIDITY_LOW |
|
||||
SUPPORT_OPERATION_MODE
|
||||
)
|
||||
|
||||
assert climate_state.attributes['min_temp'] == 7.2
|
||||
assert climate_state.attributes['max_temp'] == 33.3
|
||||
assert climate_state.attributes['min_humidity'] == 20
|
||||
assert climate_state.attributes['max_humidity'] == 50
|
||||
|
||||
occ1 = entity_registry.async_get('binary_sensor.kitchen')
|
||||
assert occ1.unique_id == 'homekit-AB1C-56'
|
||||
|
||||
|
|
|
@ -138,6 +138,8 @@ async def test_climate_read_thermostat_state(hass, utcnow):
|
|||
assert state.state == 'heat'
|
||||
assert state.attributes['current_temperature'] == 19
|
||||
assert state.attributes['current_humidity'] == 50
|
||||
assert state.attributes['min_temp'] == 7
|
||||
assert state.attributes['max_temp'] == 35
|
||||
|
||||
# Simulate that cooling is on
|
||||
helper.characteristics[TEMPERATURE_CURRENT].value = 21
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue