Add entity translations to Nexia (#98803)
This commit is contained in:
parent
09efd1c972
commit
097c7fbfef
11 changed files with 90 additions and 45 deletions
|
@ -23,7 +23,7 @@ async def async_setup_entry(
|
||||||
thermostat = nexia_home.get_thermostat_by_id(thermostat_id)
|
thermostat = nexia_home.get_thermostat_by_id(thermostat_id)
|
||||||
entities.append(
|
entities.append(
|
||||||
NexiaBinarySensor(
|
NexiaBinarySensor(
|
||||||
coordinator, thermostat, "is_blower_active", "Blower Active"
|
coordinator, thermostat, "is_blower_active", "blower_active"
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
if thermostat.has_emergency_heat():
|
if thermostat.has_emergency_heat():
|
||||||
|
@ -32,7 +32,7 @@ async def async_setup_entry(
|
||||||
coordinator,
|
coordinator,
|
||||||
thermostat,
|
thermostat,
|
||||||
"is_emergency_heat_active",
|
"is_emergency_heat_active",
|
||||||
"Emergency Heat Active",
|
"emergency_heat_active",
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -42,16 +42,16 @@ async def async_setup_entry(
|
||||||
class NexiaBinarySensor(NexiaThermostatEntity, BinarySensorEntity):
|
class NexiaBinarySensor(NexiaThermostatEntity, BinarySensorEntity):
|
||||||
"""Provices Nexia BinarySensor support."""
|
"""Provices Nexia BinarySensor support."""
|
||||||
|
|
||||||
def __init__(self, coordinator, thermostat, sensor_call, sensor_name):
|
def __init__(self, coordinator, thermostat, sensor_call, translation_key):
|
||||||
"""Initialize the nexia sensor."""
|
"""Initialize the nexia sensor."""
|
||||||
super().__init__(
|
super().__init__(
|
||||||
coordinator,
|
coordinator,
|
||||||
thermostat,
|
thermostat,
|
||||||
name=f"{thermostat.get_name()} {sensor_name}",
|
|
||||||
unique_id=f"{thermostat.thermostat_id}_{sensor_call}",
|
unique_id=f"{thermostat.thermostat_id}_{sensor_call}",
|
||||||
)
|
)
|
||||||
self._call = sensor_call
|
self._call = sensor_call
|
||||||
self._state = None
|
self._state = None
|
||||||
|
self._attr_translation_key = translation_key
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def is_on(self):
|
def is_on(self):
|
||||||
|
|
|
@ -150,13 +150,13 @@ async def async_setup_entry(
|
||||||
class NexiaZone(NexiaThermostatZoneEntity, ClimateEntity):
|
class NexiaZone(NexiaThermostatZoneEntity, ClimateEntity):
|
||||||
"""Provides Nexia Climate support."""
|
"""Provides Nexia Climate support."""
|
||||||
|
|
||||||
|
_attr_name = None
|
||||||
|
|
||||||
def __init__(
|
def __init__(
|
||||||
self, coordinator: NexiaDataUpdateCoordinator, zone: NexiaThermostatZone
|
self, coordinator: NexiaDataUpdateCoordinator, zone: NexiaThermostatZone
|
||||||
) -> None:
|
) -> None:
|
||||||
"""Initialize the thermostat."""
|
"""Initialize the thermostat."""
|
||||||
super().__init__(
|
super().__init__(coordinator, zone, zone.zone_id)
|
||||||
coordinator, zone, name=zone.get_name(), unique_id=zone.zone_id
|
|
||||||
)
|
|
||||||
unit = self._thermostat.get_unit()
|
unit = self._thermostat.get_unit()
|
||||||
min_humidity, max_humidity = self._thermostat.get_humidity_setpoint_limits()
|
min_humidity, max_humidity = self._thermostat.get_humidity_setpoint_limits()
|
||||||
min_setpoint, max_setpoint = self._thermostat.get_setpoint_limits()
|
min_setpoint, max_setpoint = self._thermostat.get_setpoint_limits()
|
||||||
|
|
|
@ -31,21 +31,20 @@ class NexiaEntity(CoordinatorEntity[NexiaDataUpdateCoordinator]):
|
||||||
|
|
||||||
_attr_attribution = ATTRIBUTION
|
_attr_attribution = ATTRIBUTION
|
||||||
|
|
||||||
def __init__(
|
def __init__(self, coordinator: NexiaDataUpdateCoordinator, unique_id: str) -> None:
|
||||||
self, coordinator: NexiaDataUpdateCoordinator, name: str, unique_id: str
|
|
||||||
) -> None:
|
|
||||||
"""Initialize the entity."""
|
"""Initialize the entity."""
|
||||||
super().__init__(coordinator)
|
super().__init__(coordinator)
|
||||||
self._attr_unique_id = unique_id
|
self._attr_unique_id = unique_id
|
||||||
self._attr_name = name
|
|
||||||
|
|
||||||
|
|
||||||
class NexiaThermostatEntity(NexiaEntity):
|
class NexiaThermostatEntity(NexiaEntity):
|
||||||
"""Base class for nexia devices attached to a thermostat."""
|
"""Base class for nexia devices attached to a thermostat."""
|
||||||
|
|
||||||
def __init__(self, coordinator, thermostat, name, unique_id):
|
_attr_has_entity_name = True
|
||||||
|
|
||||||
|
def __init__(self, coordinator, thermostat, unique_id):
|
||||||
"""Initialize the entity."""
|
"""Initialize the entity."""
|
||||||
super().__init__(coordinator, name, unique_id)
|
super().__init__(coordinator, unique_id)
|
||||||
self._thermostat: NexiaThermostat = thermostat
|
self._thermostat: NexiaThermostat = thermostat
|
||||||
self._attr_device_info = DeviceInfo(
|
self._attr_device_info = DeviceInfo(
|
||||||
configuration_url=self.coordinator.nexia_home.root_url,
|
configuration_url=self.coordinator.nexia_home.root_url,
|
||||||
|
@ -89,9 +88,9 @@ class NexiaThermostatEntity(NexiaEntity):
|
||||||
class NexiaThermostatZoneEntity(NexiaThermostatEntity):
|
class NexiaThermostatZoneEntity(NexiaThermostatEntity):
|
||||||
"""Base class for nexia devices attached to a thermostat."""
|
"""Base class for nexia devices attached to a thermostat."""
|
||||||
|
|
||||||
def __init__(self, coordinator, zone, name, unique_id):
|
def __init__(self, coordinator, zone, unique_id):
|
||||||
"""Initialize the entity."""
|
"""Initialize the entity."""
|
||||||
super().__init__(coordinator, zone.thermostat, name, unique_id)
|
super().__init__(coordinator, zone.thermostat, unique_id)
|
||||||
self._zone: NexiaThermostatZone = zone
|
self._zone: NexiaThermostatZone = zone
|
||||||
zone_name = self._zone.get_name()
|
zone_name = self._zone.get_name()
|
||||||
self._attr_device_info |= {
|
self._attr_device_info |= {
|
||||||
|
|
|
@ -42,6 +42,7 @@ class NexiaFanSpeedEntity(NexiaThermostatEntity, NumberEntity):
|
||||||
|
|
||||||
_attr_native_unit_of_measurement = PERCENTAGE
|
_attr_native_unit_of_measurement = PERCENTAGE
|
||||||
_attr_icon = "mdi:fan"
|
_attr_icon = "mdi:fan"
|
||||||
|
_attr_translation_key = "fan_speed"
|
||||||
|
|
||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
|
@ -53,7 +54,6 @@ class NexiaFanSpeedEntity(NexiaThermostatEntity, NumberEntity):
|
||||||
super().__init__(
|
super().__init__(
|
||||||
coordinator,
|
coordinator,
|
||||||
thermostat,
|
thermostat,
|
||||||
name=f"{thermostat.get_name()} Fan speed",
|
|
||||||
unique_id=f"{thermostat.thermostat_id}_fan_speed_setpoint",
|
unique_id=f"{thermostat.thermostat_id}_fan_speed_setpoint",
|
||||||
)
|
)
|
||||||
min_value, max_value = valid_range
|
min_value, max_value = valid_range
|
||||||
|
|
|
@ -43,9 +43,9 @@ class NexiaAutomationScene(NexiaEntity, Scene):
|
||||||
"""Initialize the automation scene."""
|
"""Initialize the automation scene."""
|
||||||
super().__init__(
|
super().__init__(
|
||||||
coordinator,
|
coordinator,
|
||||||
name=automation.name,
|
automation.automation_id,
|
||||||
unique_id=automation.automation_id,
|
|
||||||
)
|
)
|
||||||
|
self._attr_name = automation.name
|
||||||
self._automation: NexiaAutomation = automation
|
self._automation: NexiaAutomation = automation
|
||||||
self._attr_extra_state_attributes = {ATTR_DESCRIPTION: automation.description}
|
self._attr_extra_state_attributes = {ATTR_DESCRIPTION: automation.description}
|
||||||
|
|
||||||
|
|
|
@ -40,7 +40,7 @@ async def async_setup_entry(
|
||||||
coordinator,
|
coordinator,
|
||||||
thermostat,
|
thermostat,
|
||||||
"get_system_status",
|
"get_system_status",
|
||||||
"System Status",
|
"system_status",
|
||||||
None,
|
None,
|
||||||
None,
|
None,
|
||||||
None,
|
None,
|
||||||
|
@ -52,7 +52,7 @@ async def async_setup_entry(
|
||||||
coordinator,
|
coordinator,
|
||||||
thermostat,
|
thermostat,
|
||||||
"get_air_cleaner_mode",
|
"get_air_cleaner_mode",
|
||||||
"Air Cleaner Mode",
|
"air_cleaner_mode",
|
||||||
None,
|
None,
|
||||||
None,
|
None,
|
||||||
None,
|
None,
|
||||||
|
@ -65,7 +65,7 @@ async def async_setup_entry(
|
||||||
coordinator,
|
coordinator,
|
||||||
thermostat,
|
thermostat,
|
||||||
"get_current_compressor_speed",
|
"get_current_compressor_speed",
|
||||||
"Current Compressor Speed",
|
"current_compressor_speed",
|
||||||
None,
|
None,
|
||||||
PERCENTAGE,
|
PERCENTAGE,
|
||||||
SensorStateClass.MEASUREMENT,
|
SensorStateClass.MEASUREMENT,
|
||||||
|
@ -77,7 +77,7 @@ async def async_setup_entry(
|
||||||
coordinator,
|
coordinator,
|
||||||
thermostat,
|
thermostat,
|
||||||
"get_requested_compressor_speed",
|
"get_requested_compressor_speed",
|
||||||
"Requested Compressor Speed",
|
"requested_compressor_speed",
|
||||||
None,
|
None,
|
||||||
PERCENTAGE,
|
PERCENTAGE,
|
||||||
SensorStateClass.MEASUREMENT,
|
SensorStateClass.MEASUREMENT,
|
||||||
|
@ -95,7 +95,7 @@ async def async_setup_entry(
|
||||||
coordinator,
|
coordinator,
|
||||||
thermostat,
|
thermostat,
|
||||||
"get_outdoor_temperature",
|
"get_outdoor_temperature",
|
||||||
"Outdoor Temperature",
|
"outdoor_temperature",
|
||||||
SensorDeviceClass.TEMPERATURE,
|
SensorDeviceClass.TEMPERATURE,
|
||||||
unit,
|
unit,
|
||||||
SensorStateClass.MEASUREMENT,
|
SensorStateClass.MEASUREMENT,
|
||||||
|
@ -108,7 +108,7 @@ async def async_setup_entry(
|
||||||
coordinator,
|
coordinator,
|
||||||
thermostat,
|
thermostat,
|
||||||
"get_relative_humidity",
|
"get_relative_humidity",
|
||||||
"Relative Humidity",
|
None,
|
||||||
SensorDeviceClass.HUMIDITY,
|
SensorDeviceClass.HUMIDITY,
|
||||||
PERCENTAGE,
|
PERCENTAGE,
|
||||||
SensorStateClass.MEASUREMENT,
|
SensorStateClass.MEASUREMENT,
|
||||||
|
@ -129,7 +129,7 @@ async def async_setup_entry(
|
||||||
coordinator,
|
coordinator,
|
||||||
zone,
|
zone,
|
||||||
"get_temperature",
|
"get_temperature",
|
||||||
"Temperature",
|
None,
|
||||||
SensorDeviceClass.TEMPERATURE,
|
SensorDeviceClass.TEMPERATURE,
|
||||||
unit,
|
unit,
|
||||||
SensorStateClass.MEASUREMENT,
|
SensorStateClass.MEASUREMENT,
|
||||||
|
@ -139,7 +139,7 @@ async def async_setup_entry(
|
||||||
# Zone Status
|
# Zone Status
|
||||||
entities.append(
|
entities.append(
|
||||||
NexiaThermostatZoneSensor(
|
NexiaThermostatZoneSensor(
|
||||||
coordinator, zone, "get_status", "Zone Status", None, None, None
|
coordinator, zone, "get_status", "zone_status", None, None, None
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
# Setpoint Status
|
# Setpoint Status
|
||||||
|
@ -148,7 +148,7 @@ async def async_setup_entry(
|
||||||
coordinator,
|
coordinator,
|
||||||
zone,
|
zone,
|
||||||
"get_setpoint_status",
|
"get_setpoint_status",
|
||||||
"Zone Setpoint Status",
|
"zone_setpoint_status",
|
||||||
None,
|
None,
|
||||||
None,
|
None,
|
||||||
None,
|
None,
|
||||||
|
@ -166,7 +166,7 @@ class NexiaThermostatSensor(NexiaThermostatEntity, SensorEntity):
|
||||||
coordinator,
|
coordinator,
|
||||||
thermostat,
|
thermostat,
|
||||||
sensor_call,
|
sensor_call,
|
||||||
sensor_name,
|
translation_key,
|
||||||
sensor_class,
|
sensor_class,
|
||||||
sensor_unit,
|
sensor_unit,
|
||||||
state_class,
|
state_class,
|
||||||
|
@ -176,7 +176,6 @@ class NexiaThermostatSensor(NexiaThermostatEntity, SensorEntity):
|
||||||
super().__init__(
|
super().__init__(
|
||||||
coordinator,
|
coordinator,
|
||||||
thermostat,
|
thermostat,
|
||||||
name=f"{thermostat.get_name()} {sensor_name}",
|
|
||||||
unique_id=f"{thermostat.thermostat_id}_{sensor_call}",
|
unique_id=f"{thermostat.thermostat_id}_{sensor_call}",
|
||||||
)
|
)
|
||||||
self._call = sensor_call
|
self._call = sensor_call
|
||||||
|
@ -184,6 +183,8 @@ class NexiaThermostatSensor(NexiaThermostatEntity, SensorEntity):
|
||||||
self._attr_device_class = sensor_class
|
self._attr_device_class = sensor_class
|
||||||
self._attr_native_unit_of_measurement = sensor_unit
|
self._attr_native_unit_of_measurement = sensor_unit
|
||||||
self._attr_state_class = state_class
|
self._attr_state_class = state_class
|
||||||
|
if translation_key is not None:
|
||||||
|
self._attr_translation_key = translation_key
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def native_value(self):
|
def native_value(self):
|
||||||
|
@ -204,7 +205,7 @@ class NexiaThermostatZoneSensor(NexiaThermostatZoneEntity, SensorEntity):
|
||||||
coordinator,
|
coordinator,
|
||||||
zone,
|
zone,
|
||||||
sensor_call,
|
sensor_call,
|
||||||
sensor_name,
|
translation_key,
|
||||||
sensor_class,
|
sensor_class,
|
||||||
sensor_unit,
|
sensor_unit,
|
||||||
state_class,
|
state_class,
|
||||||
|
@ -215,7 +216,6 @@ class NexiaThermostatZoneSensor(NexiaThermostatZoneEntity, SensorEntity):
|
||||||
super().__init__(
|
super().__init__(
|
||||||
coordinator,
|
coordinator,
|
||||||
zone,
|
zone,
|
||||||
name=f"{zone.get_name()} {sensor_name}",
|
|
||||||
unique_id=f"{zone.zone_id}_{sensor_call}",
|
unique_id=f"{zone.zone_id}_{sensor_call}",
|
||||||
)
|
)
|
||||||
self._call = sensor_call
|
self._call = sensor_call
|
||||||
|
@ -223,6 +223,8 @@ class NexiaThermostatZoneSensor(NexiaThermostatZoneEntity, SensorEntity):
|
||||||
self._attr_device_class = sensor_class
|
self._attr_device_class = sensor_class
|
||||||
self._attr_native_unit_of_measurement = sensor_unit
|
self._attr_native_unit_of_measurement = sensor_unit
|
||||||
self._attr_state_class = state_class
|
self._attr_state_class = state_class
|
||||||
|
if translation_key is not None:
|
||||||
|
self._attr_translation_key = translation_key
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def native_value(self):
|
def native_value(self):
|
||||||
|
|
|
@ -18,6 +18,49 @@
|
||||||
"already_configured": "[%key:common::config_flow::abort::already_configured_device%]"
|
"already_configured": "[%key:common::config_flow::abort::already_configured_device%]"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"entity": {
|
||||||
|
"binary_sensor": {
|
||||||
|
"blower_active": {
|
||||||
|
"name": "Blower active"
|
||||||
|
},
|
||||||
|
"emergency_heat_active": {
|
||||||
|
"name": "Emergency heat active"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"number": {
|
||||||
|
"fan_speed": {
|
||||||
|
"name": "Fan speed"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"sensor": {
|
||||||
|
"system_status": {
|
||||||
|
"name": "System status"
|
||||||
|
},
|
||||||
|
"air_cleaner_mode": {
|
||||||
|
"name": "Air cleaner mode"
|
||||||
|
},
|
||||||
|
"current_compressor_speed": {
|
||||||
|
"name": "Current compressor speed"
|
||||||
|
},
|
||||||
|
"requested_compressor_speed": {
|
||||||
|
"name": "Requested compressor speed"
|
||||||
|
},
|
||||||
|
"outdoor_temperature": {
|
||||||
|
"name": "Outdoor temperature"
|
||||||
|
},
|
||||||
|
"zone_status": {
|
||||||
|
"name": "Zone status"
|
||||||
|
},
|
||||||
|
"zone_setpoint_status": {
|
||||||
|
"name": "Zone setpoint status"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"switch": {
|
||||||
|
"hold": {
|
||||||
|
"name": "Hold"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"services": {
|
"services": {
|
||||||
"set_aircleaner_mode": {
|
"set_aircleaner_mode": {
|
||||||
"name": "Set air cleaner mode",
|
"name": "Set air cleaner mode",
|
||||||
|
|
|
@ -39,13 +39,14 @@ async def async_setup_entry(
|
||||||
class NexiaHoldSwitch(NexiaThermostatZoneEntity, SwitchEntity):
|
class NexiaHoldSwitch(NexiaThermostatZoneEntity, SwitchEntity):
|
||||||
"""Provides Nexia hold switch support."""
|
"""Provides Nexia hold switch support."""
|
||||||
|
|
||||||
|
_attr_translation_key = "hold"
|
||||||
|
|
||||||
def __init__(
|
def __init__(
|
||||||
self, coordinator: NexiaDataUpdateCoordinator, zone: NexiaThermostatZone
|
self, coordinator: NexiaDataUpdateCoordinator, zone: NexiaThermostatZone
|
||||||
) -> None:
|
) -> None:
|
||||||
"""Initialize the hold mode switch."""
|
"""Initialize the hold mode switch."""
|
||||||
switch_name = f"{zone.get_name()} Hold"
|
|
||||||
zone_id = zone.zone_id
|
zone_id = zone.zone_id
|
||||||
super().__init__(coordinator, zone, name=switch_name, unique_id=zone_id)
|
super().__init__(coordinator, zone, zone_id)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def is_on(self) -> bool:
|
def is_on(self) -> bool:
|
||||||
|
|
|
@ -14,7 +14,7 @@ async def test_create_binary_sensors(hass: HomeAssistant) -> None:
|
||||||
assert state.state == STATE_ON
|
assert state.state == STATE_ON
|
||||||
expected_attributes = {
|
expected_attributes = {
|
||||||
"attribution": "Data provided by Trane Technologies",
|
"attribution": "Data provided by Trane Technologies",
|
||||||
"friendly_name": "Master Suite Blower Active",
|
"friendly_name": "Master Suite Blower active",
|
||||||
}
|
}
|
||||||
# Only test for a subset of attributes in case
|
# Only test for a subset of attributes in case
|
||||||
# HA changes the implementation and a new one appears
|
# HA changes the implementation and a new one appears
|
||||||
|
@ -26,7 +26,7 @@ async def test_create_binary_sensors(hass: HomeAssistant) -> None:
|
||||||
assert state.state == STATE_OFF
|
assert state.state == STATE_OFF
|
||||||
expected_attributes = {
|
expected_attributes = {
|
||||||
"attribution": "Data provided by Trane Technologies",
|
"attribution": "Data provided by Trane Technologies",
|
||||||
"friendly_name": "Downstairs East Wing Blower Active",
|
"friendly_name": "Downstairs East Wing Blower active",
|
||||||
}
|
}
|
||||||
# Only test for a subset of attributes in case
|
# Only test for a subset of attributes in case
|
||||||
# HA changes the implementation and a new one appears
|
# HA changes the implementation and a new one appears
|
||||||
|
|
|
@ -53,7 +53,7 @@ async def test_device_remove_devices(
|
||||||
is False
|
is False
|
||||||
)
|
)
|
||||||
|
|
||||||
entity = registry.entities["sensor.master_suite_relative_humidity"]
|
entity = registry.entities["sensor.master_suite_humidity"]
|
||||||
live_thermostat_device_entry = device_registry.async_get(entity.device_id)
|
live_thermostat_device_entry = device_registry.async_get(entity.device_id)
|
||||||
assert (
|
assert (
|
||||||
await remove_device(
|
await remove_device(
|
||||||
|
|
|
@ -29,7 +29,7 @@ async def test_create_sensors(hass: HomeAssistant) -> None:
|
||||||
assert state.state == "Permanent Hold"
|
assert state.state == "Permanent Hold"
|
||||||
expected_attributes = {
|
expected_attributes = {
|
||||||
"attribution": "Data provided by Trane Technologies",
|
"attribution": "Data provided by Trane Technologies",
|
||||||
"friendly_name": "Nick Office Zone Setpoint Status",
|
"friendly_name": "Nick Office Zone setpoint status",
|
||||||
}
|
}
|
||||||
# Only test for a subset of attributes in case
|
# Only test for a subset of attributes in case
|
||||||
# HA changes the implementation and a new one appears
|
# HA changes the implementation and a new one appears
|
||||||
|
@ -42,7 +42,7 @@ async def test_create_sensors(hass: HomeAssistant) -> None:
|
||||||
|
|
||||||
expected_attributes = {
|
expected_attributes = {
|
||||||
"attribution": "Data provided by Trane Technologies",
|
"attribution": "Data provided by Trane Technologies",
|
||||||
"friendly_name": "Nick Office Zone Status",
|
"friendly_name": "Nick Office Zone status",
|
||||||
}
|
}
|
||||||
# Only test for a subset of attributes in case
|
# Only test for a subset of attributes in case
|
||||||
# HA changes the implementation and a new one appears
|
# HA changes the implementation and a new one appears
|
||||||
|
@ -55,7 +55,7 @@ async def test_create_sensors(hass: HomeAssistant) -> None:
|
||||||
|
|
||||||
expected_attributes = {
|
expected_attributes = {
|
||||||
"attribution": "Data provided by Trane Technologies",
|
"attribution": "Data provided by Trane Technologies",
|
||||||
"friendly_name": "Master Suite Air Cleaner Mode",
|
"friendly_name": "Master Suite Air cleaner mode",
|
||||||
}
|
}
|
||||||
# Only test for a subset of attributes in case
|
# Only test for a subset of attributes in case
|
||||||
# HA changes the implementation and a new one appears
|
# HA changes the implementation and a new one appears
|
||||||
|
@ -68,7 +68,7 @@ async def test_create_sensors(hass: HomeAssistant) -> None:
|
||||||
|
|
||||||
expected_attributes = {
|
expected_attributes = {
|
||||||
"attribution": "Data provided by Trane Technologies",
|
"attribution": "Data provided by Trane Technologies",
|
||||||
"friendly_name": "Master Suite Current Compressor Speed",
|
"friendly_name": "Master Suite Current compressor speed",
|
||||||
"unit_of_measurement": PERCENTAGE,
|
"unit_of_measurement": PERCENTAGE,
|
||||||
}
|
}
|
||||||
# Only test for a subset of attributes in case
|
# Only test for a subset of attributes in case
|
||||||
|
@ -83,7 +83,7 @@ async def test_create_sensors(hass: HomeAssistant) -> None:
|
||||||
expected_attributes = {
|
expected_attributes = {
|
||||||
"attribution": "Data provided by Trane Technologies",
|
"attribution": "Data provided by Trane Technologies",
|
||||||
"device_class": "temperature",
|
"device_class": "temperature",
|
||||||
"friendly_name": "Master Suite Outdoor Temperature",
|
"friendly_name": "Master Suite Outdoor temperature",
|
||||||
"unit_of_measurement": UnitOfTemperature.CELSIUS,
|
"unit_of_measurement": UnitOfTemperature.CELSIUS,
|
||||||
}
|
}
|
||||||
# Only test for a subset of attributes in case
|
# Only test for a subset of attributes in case
|
||||||
|
@ -92,13 +92,13 @@ async def test_create_sensors(hass: HomeAssistant) -> None:
|
||||||
state.attributes[key] == expected_attributes[key] for key in expected_attributes
|
state.attributes[key] == expected_attributes[key] for key in expected_attributes
|
||||||
)
|
)
|
||||||
|
|
||||||
state = hass.states.get("sensor.master_suite_relative_humidity")
|
state = hass.states.get("sensor.master_suite_humidity")
|
||||||
assert state.state == "52.0"
|
assert state.state == "52.0"
|
||||||
|
|
||||||
expected_attributes = {
|
expected_attributes = {
|
||||||
"attribution": "Data provided by Trane Technologies",
|
"attribution": "Data provided by Trane Technologies",
|
||||||
"device_class": "humidity",
|
"device_class": "humidity",
|
||||||
"friendly_name": "Master Suite Relative Humidity",
|
"friendly_name": "Master Suite Humidity",
|
||||||
"unit_of_measurement": PERCENTAGE,
|
"unit_of_measurement": PERCENTAGE,
|
||||||
}
|
}
|
||||||
# Only test for a subset of attributes in case
|
# Only test for a subset of attributes in case
|
||||||
|
@ -112,7 +112,7 @@ async def test_create_sensors(hass: HomeAssistant) -> None:
|
||||||
|
|
||||||
expected_attributes = {
|
expected_attributes = {
|
||||||
"attribution": "Data provided by Trane Technologies",
|
"attribution": "Data provided by Trane Technologies",
|
||||||
"friendly_name": "Master Suite Requested Compressor Speed",
|
"friendly_name": "Master Suite Requested compressor speed",
|
||||||
"unit_of_measurement": PERCENTAGE,
|
"unit_of_measurement": PERCENTAGE,
|
||||||
}
|
}
|
||||||
# Only test for a subset of attributes in case
|
# Only test for a subset of attributes in case
|
||||||
|
@ -126,7 +126,7 @@ async def test_create_sensors(hass: HomeAssistant) -> None:
|
||||||
|
|
||||||
expected_attributes = {
|
expected_attributes = {
|
||||||
"attribution": "Data provided by Trane Technologies",
|
"attribution": "Data provided by Trane Technologies",
|
||||||
"friendly_name": "Master Suite System Status",
|
"friendly_name": "Master Suite System status",
|
||||||
}
|
}
|
||||||
# Only test for a subset of attributes in case
|
# Only test for a subset of attributes in case
|
||||||
# HA changes the implementation and a new one appears
|
# HA changes the implementation and a new one appears
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue