Add current_humidity to Ecobee humidifier (#114753)

* Ecobee: add current_humidity to humidifier

* Ecobee: Add test for current_humidity property

* Update current_humidity handling in climate and
humidifier entity to support the ecobee API
not returning actualHumidity, which is an optional
value.
Also updated tests to add a thermostat which
covers a non-populated humidity. In passing,
set up the new test thermostat to cover a missing
condition where the code doens't recognize the
ecobee model number. This gets ecobee humidifier
test coverage to 100%
This commit is contained in:
Brent Petit 2024-04-05 14:54:40 -05:00 committed by GitHub
parent 0214511b38
commit c9ce848b4b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 90 additions and 1 deletions

View file

@ -7,6 +7,7 @@ import pytest
from homeassistant.components.ecobee.humidifier import MODE_MANUAL, MODE_OFF
from homeassistant.components.humidifier import (
ATTR_AVAILABLE_MODES,
ATTR_CURRENT_HUMIDITY,
ATTR_HUMIDITY,
ATTR_MAX_HUMIDITY,
ATTR_MIN_HUMIDITY,
@ -43,6 +44,8 @@ async def test_attributes(hass: HomeAssistant) -> None:
state = hass.states.get(DEVICE_ID)
assert state.state == STATE_ON
if state.attributes.get(ATTR_CURRENT_HUMIDITY):
assert state.attributes.get(ATTR_CURRENT_HUMIDITY) == 15
assert state.attributes.get(ATTR_MIN_HUMIDITY) == DEFAULT_MIN_HUMIDITY
assert state.attributes.get(ATTR_MAX_HUMIDITY) == DEFAULT_MAX_HUMIDITY
assert state.attributes.get(ATTR_HUMIDITY) == 40