mirror of
https://github.com/home-assistant/core.git
synced 2025-07-25 22:27:07 +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
|
from .const import DOMAIN
|
||||||
|
|
||||||
SENSORS = {
|
SENSORS = (
|
||||||
"in_meeting": "In Meeting",
|
"in_meeting",
|
||||||
"muted": "Muted",
|
"muted",
|
||||||
}
|
)
|
||||||
|
|
||||||
|
|
||||||
async def async_setup_entry(
|
async def async_setup_entry(
|
||||||
@ -30,15 +30,13 @@ async def async_setup_entry(
|
|||||||
class MuteStatus(update_coordinator.CoordinatorEntity, BinarySensorEntity):
|
class MuteStatus(update_coordinator.CoordinatorEntity, BinarySensorEntity):
|
||||||
"""Mütesync binary sensors."""
|
"""Mütesync binary sensors."""
|
||||||
|
|
||||||
|
_attr_has_entity_name = True
|
||||||
|
|
||||||
def __init__(self, coordinator, sensor_type):
|
def __init__(self, coordinator, sensor_type):
|
||||||
"""Initialize our sensor."""
|
"""Initialize our sensor."""
|
||||||
super().__init__(coordinator)
|
super().__init__(coordinator)
|
||||||
self._sensor_type = sensor_type
|
self._sensor_type = sensor_type
|
||||||
|
self._attr_translation_key = sensor_type
|
||||||
@property
|
|
||||||
def name(self):
|
|
||||||
"""Return the name of the sensor."""
|
|
||||||
return SENSORS[self._sensor_type]
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def unique_id(self):
|
def unique_id(self):
|
||||||
|
@ -12,5 +12,15 @@
|
|||||||
"invalid_auth": "Enable authentication in mütesync Preferences > Authentication",
|
"invalid_auth": "Enable authentication in mütesync Preferences > Authentication",
|
||||||
"unknown": "[%key:common::config_flow::error::unknown%]"
|
"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