forked from home-assistant/core
/
test_lennox_e30.py
41 lines (31 loc) · 1.5 KB
/
test_lennox_e30.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
"""
Regression tests for Aqara Gateway V3.
https://github.com/home-assistant/home-assistant/issues/20885
"""
from homeassistant.components.climate.const import (
SUPPORT_TARGET_TEMPERATURE, SUPPORT_OPERATION_MODE)
from tests.components.homekit_controller.common import (
setup_accessories_from_file, setup_test_accessories, Helper
)
async def test_lennox_e30_setup(hass):
"""Test that a Lennox E30 can be correctly setup in HA."""
accessories = await setup_accessories_from_file(hass, 'lennox_e30.json')
pairing = await setup_test_accessories(hass, accessories)
entity_registry = await hass.helpers.entity_registry.async_get_registry()
climate = entity_registry.async_get('climate.lennox')
assert climate.unique_id == 'homekit-XXXXXXXX-100'
climate_helper = Helper(hass, 'climate.lennox', pairing, accessories[0])
climate_state = await climate_helper.poll_and_get_state()
assert climate_state.attributes['friendly_name'] == 'Lennox'
assert climate_state.attributes['supported_features'] == (
SUPPORT_TARGET_TEMPERATURE | SUPPORT_OPERATION_MODE
)
device_registry = await hass.helpers.device_registry.async_get_registry()
device = device_registry.async_get(climate.device_id)
assert device.manufacturer == 'Lennox'
assert device.name == 'Lennox'
assert device.model == 'E30 2B'
assert device.sw_version == '3.40.XX'
# The fixture contains a single accessory - so its a single device
# and no bridge
assert device.via_device_id is None