Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add entity translations to Honeywell Lyric #98775

Merged
merged 1 commit into from
Aug 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions homeassistant/components/lyric/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,8 @@ async def async_unload_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
class LyricEntity(CoordinatorEntity[DataUpdateCoordinator[Lyric]]):
"""Defines a base Honeywell Lyric entity."""

_attr_has_entity_name = True

def __init__(
self,
coordinator: DataUpdateCoordinator[Lyric],
Expand Down
2 changes: 2 additions & 0 deletions homeassistant/components/lyric/climate.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,8 @@ class LyricClimate(LyricDeviceEntity, ClimateEntity):
coordinator: DataUpdateCoordinator[Lyric]
entity_description: ClimateEntityDescription

_attr_name = None

def __init__(
self,
coordinator: DataUpdateCoordinator[Lyric],
Expand Down
12 changes: 6 additions & 6 deletions homeassistant/components/lyric/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ def get_setpoint_status(status: str, time: str) -> str | None:
coordinator,
LyricSensorEntityDescription(
key=f"{device.macID}_indoor_temperature",
name="Indoor Temperature",
translation_key="indoor_temperature",
device_class=SensorDeviceClass.TEMPERATURE,
state_class=SensorStateClass.MEASUREMENT,
native_unit_of_measurement=native_temperature_unit,
Expand All @@ -102,7 +102,7 @@ def get_setpoint_status(status: str, time: str) -> str | None:
coordinator,
LyricSensorEntityDescription(
key=f"{device.macID}_indoor_humidity",
name="Indoor Humidity",
translation_key="indoor_humidity",
device_class=SensorDeviceClass.HUMIDITY,
state_class=SensorStateClass.MEASUREMENT,
native_unit_of_measurement=PERCENTAGE,
Expand All @@ -123,7 +123,7 @@ def get_setpoint_status(status: str, time: str) -> str | None:
coordinator,
LyricSensorEntityDescription(
key=f"{device.macID}_outdoor_temperature",
name="Outdoor Temperature",
translation_key="outdoor_temperature",
device_class=SensorDeviceClass.TEMPERATURE,
state_class=SensorStateClass.MEASUREMENT,
native_unit_of_measurement=native_temperature_unit,
Expand All @@ -139,7 +139,7 @@ def get_setpoint_status(status: str, time: str) -> str | None:
coordinator,
LyricSensorEntityDescription(
key=f"{device.macID}_outdoor_humidity",
name="Outdoor Humidity",
translation_key="outdoor_humidity",
device_class=SensorDeviceClass.HUMIDITY,
state_class=SensorStateClass.MEASUREMENT,
native_unit_of_measurement=PERCENTAGE,
Expand All @@ -156,7 +156,7 @@ def get_setpoint_status(status: str, time: str) -> str | None:
coordinator,
LyricSensorEntityDescription(
key=f"{device.macID}_next_period_time",
name="Next Period Time",
translation_key="next_period_time",
device_class=SensorDeviceClass.TIMESTAMP,
value=lambda device: get_datetime_from_future_time(
device.changeableValues.nextPeriodTime
Expand All @@ -172,7 +172,7 @@ def get_setpoint_status(status: str, time: str) -> str | None:
coordinator,
LyricSensorEntityDescription(
key=f"{device.macID}_setpoint_status",
name="Setpoint Status",
translation_key="setpoint_status",
icon="mdi:thermostat",
value=lambda device: get_setpoint_status(
device.changeableValues.thermostatSetpointStatus,
Expand Down
22 changes: 22 additions & 0 deletions homeassistant/components/lyric/strings.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,28 @@
"default": "[%key:common::config_flow::create_entry::authenticated%]"
}
},
"entity": {
"sensor": {
"indoor_temperature": {
"name": "Indoor temperature"
},
"indoor_humidity": {
"name": "Indoor humidity"
},
"outdoor_temperature": {
"name": "Outdoor temperature"
},
"outdoor_humidity": {
"name": "Outdoor humidity"
},
"next_period_time": {
"name": "Next period time"
},
"setpoint_status": {
"name": "Setpoint status"
}
}
},
"services": {
"set_hold_time": {
"name": "Set Hold Time",
Expand Down