mirror of
https://github.com/home-assistant/core.git
synced 2025-07-24 13:47:35 +00:00
Add entity translations to mutesync (#96741)
This commit is contained in:
parent
56bc708b28
commit
5a951c390b
@ -9,10 +9,10 @@ from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||
|
||||
from .const import DOMAIN
|
||||
|
||||
SENSORS = {
|
||||
"in_meeting": "In Meeting",
|
||||
"muted": "Muted",
|
||||
}
|
||||
SENSORS = (
|
||||
"in_meeting",
|
||||
"muted",
|
||||
)
|
||||
|
||||
|
||||
async def async_setup_entry(
|
||||
@ -30,15 +30,13 @@ async def async_setup_entry(
|
||||
class MuteStatus(update_coordinator.CoordinatorEntity, BinarySensorEntity):
|
||||
"""Mütesync binary sensors."""
|
||||
|
||||
_attr_has_entity_name = True
|
||||
|
||||
def __init__(self, coordinator, sensor_type):
|
||||
"""Initialize our sensor."""
|
||||
super().__init__(coordinator)
|
||||
self._sensor_type = sensor_type
|
||||
|
||||
@property
|
||||
def name(self):
|
||||
"""Return the name of the sensor."""
|
||||
return SENSORS[self._sensor_type]
|
||||
self._attr_translation_key = sensor_type
|
||||
|
||||
@property
|
||||
def unique_id(self):
|
||||
|
@ -12,5 +12,15 @@
|
||||
"invalid_auth": "Enable authentication in mütesync Preferences > Authentication",
|
||||
"unknown": "[%key:common::config_flow::error::unknown%]"
|
||||
}
|
||||
},
|
||||
"entity": {
|
||||
"binary_sensor": {
|
||||
"in_meeting": {
|
||||
"name": "In meeting"
|
||||
},
|
||||
"muted": {
|
||||
"name": "Muted"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user