mirror of
https://github.com/home-assistant/core.git
synced 2025-11-13 13:00:11 +00:00
Add current_humidity state attribute to Google Nest climate entity (#134426)
This commit is contained in:
@@ -13,6 +13,7 @@ import aiohttp
|
||||
import pytest
|
||||
|
||||
from homeassistant.components.climate import (
|
||||
ATTR_CURRENT_HUMIDITY,
|
||||
ATTR_CURRENT_TEMPERATURE,
|
||||
ATTR_FAN_MODE,
|
||||
ATTR_FAN_MODES,
|
||||
@@ -122,6 +123,9 @@ async def test_thermostat_off(
|
||||
"sdm.devices.traits.Temperature": {
|
||||
"ambientTemperatureCelsius": 16.2,
|
||||
},
|
||||
"sdm.devices.traits.Humidity": {
|
||||
"ambientHumidityPercent": 40.6,
|
||||
},
|
||||
},
|
||||
)
|
||||
await setup_platform()
|
||||
@@ -131,6 +135,7 @@ async def test_thermostat_off(
|
||||
assert thermostat is not None
|
||||
assert thermostat.state == HVACMode.OFF
|
||||
assert thermostat.attributes[ATTR_HVAC_ACTION] == HVACAction.OFF
|
||||
assert thermostat.attributes[ATTR_CURRENT_HUMIDITY] == 40.6
|
||||
assert thermostat.attributes[ATTR_CURRENT_TEMPERATURE] == 16.2
|
||||
assert set(thermostat.attributes[ATTR_HVAC_MODES]) == {
|
||||
HVACMode.HEAT,
|
||||
@@ -163,6 +168,9 @@ async def test_thermostat_heat(
|
||||
"sdm.devices.traits.Temperature": {
|
||||
"ambientTemperatureCelsius": 16.2,
|
||||
},
|
||||
"sdm.devices.traits.Humidity": {
|
||||
"ambientHumidityPercent": 40.6,
|
||||
},
|
||||
"sdm.devices.traits.ThermostatTemperatureSetpoint": {
|
||||
"heatCelsius": 22.0,
|
||||
},
|
||||
@@ -175,6 +183,7 @@ async def test_thermostat_heat(
|
||||
assert thermostat is not None
|
||||
assert thermostat.state == HVACMode.HEAT
|
||||
assert thermostat.attributes[ATTR_HVAC_ACTION] == HVACAction.HEATING
|
||||
assert thermostat.attributes[ATTR_CURRENT_HUMIDITY] == 40.6
|
||||
assert thermostat.attributes[ATTR_CURRENT_TEMPERATURE] == 16.2
|
||||
assert set(thermostat.attributes[ATTR_HVAC_MODES]) == {
|
||||
HVACMode.HEAT,
|
||||
@@ -883,6 +892,9 @@ async def test_thermostat_fan_off(
|
||||
"sdm.devices.traits.Temperature": {
|
||||
"ambientTemperatureCelsius": 16.2,
|
||||
},
|
||||
"sdm.devices.traits.Humidity": {
|
||||
"ambientHumidityPercent": 40.6,
|
||||
},
|
||||
}
|
||||
)
|
||||
await setup_platform()
|
||||
@@ -892,6 +904,7 @@ async def test_thermostat_fan_off(
|
||||
assert thermostat is not None
|
||||
assert thermostat.state == HVACMode.COOL
|
||||
assert thermostat.attributes[ATTR_HVAC_ACTION] == HVACAction.IDLE
|
||||
assert thermostat.attributes[ATTR_CURRENT_HUMIDITY] == 40.6
|
||||
assert thermostat.attributes[ATTR_CURRENT_TEMPERATURE] == 16.2
|
||||
assert set(thermostat.attributes[ATTR_HVAC_MODES]) == {
|
||||
HVACMode.HEAT,
|
||||
@@ -932,6 +945,9 @@ async def test_thermostat_fan_on(
|
||||
"sdm.devices.traits.Temperature": {
|
||||
"ambientTemperatureCelsius": 16.2,
|
||||
},
|
||||
"sdm.devices.traits.Humidity": {
|
||||
"ambientHumidityPercent": 40.6,
|
||||
},
|
||||
}
|
||||
)
|
||||
await setup_platform()
|
||||
@@ -941,6 +957,7 @@ async def test_thermostat_fan_on(
|
||||
assert thermostat is not None
|
||||
assert thermostat.state == HVACMode.COOL
|
||||
assert thermostat.attributes[ATTR_HVAC_ACTION] == HVACAction.IDLE
|
||||
assert thermostat.attributes[ATTR_CURRENT_HUMIDITY] == 40.6
|
||||
assert thermostat.attributes[ATTR_CURRENT_TEMPERATURE] == 16.2
|
||||
assert set(thermostat.attributes[ATTR_HVAC_MODES]) == {
|
||||
HVACMode.HEAT,
|
||||
@@ -1128,6 +1145,9 @@ async def test_thermostat_fan_empty(
|
||||
"sdm.devices.traits.Temperature": {
|
||||
"ambientTemperatureCelsius": 16.2,
|
||||
},
|
||||
"sdm.devices.traits.Humidity": {
|
||||
"ambientHumidityPercent": 40.6,
|
||||
},
|
||||
}
|
||||
)
|
||||
await setup_platform()
|
||||
@@ -1137,6 +1157,7 @@ async def test_thermostat_fan_empty(
|
||||
assert thermostat is not None
|
||||
assert thermostat.state == HVACMode.OFF
|
||||
assert thermostat.attributes[ATTR_HVAC_ACTION] == HVACAction.OFF
|
||||
assert thermostat.attributes[ATTR_CURRENT_HUMIDITY] == 40.6
|
||||
assert thermostat.attributes[ATTR_CURRENT_TEMPERATURE] == 16.2
|
||||
assert set(thermostat.attributes[ATTR_HVAC_MODES]) == {
|
||||
HVACMode.HEAT,
|
||||
@@ -1181,6 +1202,9 @@ async def test_thermostat_invalid_fan_mode(
|
||||
"sdm.devices.traits.Temperature": {
|
||||
"ambientTemperatureCelsius": 16.2,
|
||||
},
|
||||
"sdm.devices.traits.Humidity": {
|
||||
"ambientHumidityPercent": 40.6,
|
||||
},
|
||||
}
|
||||
)
|
||||
await setup_platform()
|
||||
@@ -1190,6 +1214,7 @@ async def test_thermostat_invalid_fan_mode(
|
||||
assert thermostat is not None
|
||||
assert thermostat.state == HVACMode.COOL
|
||||
assert thermostat.attributes[ATTR_HVAC_ACTION] == HVACAction.IDLE
|
||||
assert thermostat.attributes[ATTR_CURRENT_HUMIDITY] == 40.6
|
||||
assert thermostat.attributes[ATTR_CURRENT_TEMPERATURE] == 16.2
|
||||
assert set(thermostat.attributes[ATTR_HVAC_MODES]) == {
|
||||
HVACMode.HEAT,
|
||||
|
||||
Reference in New Issue
Block a user