mirror of
https://github.com/home-assistant/core.git
synced 2025-04-23 08:47:57 +00:00
Add entity translations to Keymitt ble (#98236)
This commit is contained in:
parent
fb66ceb302
commit
a2cf08a1ea
@ -16,11 +16,12 @@ from .coordinator import MicroBotDataUpdateCoordinator
|
||||
class MicroBotEntity(PassiveBluetoothCoordinatorEntity[MicroBotDataUpdateCoordinator]):
|
||||
"""Generic entity for all MicroBots."""
|
||||
|
||||
_attr_has_entity_name = True
|
||||
|
||||
def __init__(self, coordinator, config_entry):
|
||||
"""Initialise the entity."""
|
||||
super().__init__(coordinator)
|
||||
self._address = self.coordinator.ble_device.address
|
||||
self._attr_name = "Push"
|
||||
self._attr_unique_id = self._address
|
||||
self._attr_device_info = DeviceInfo(
|
||||
connections={(dr.CONNECTION_BLUETOOTH, self._address)},
|
||||
|
@ -24,6 +24,13 @@
|
||||
"cannot_connect": "[%key:common::config_flow::error::cannot_connect%]"
|
||||
}
|
||||
},
|
||||
"entity": {
|
||||
"switch": {
|
||||
"push": {
|
||||
"name": "Push"
|
||||
}
|
||||
}
|
||||
},
|
||||
"services": {
|
||||
"calibrate": {
|
||||
"name": "Calibrate",
|
||||
|
@ -43,7 +43,7 @@ async def async_setup_entry(
|
||||
class MicroBotBinarySwitch(MicroBotEntity, SwitchEntity):
|
||||
"""MicroBot switch class."""
|
||||
|
||||
_attr_has_entity_name = True
|
||||
_attr_translation_key = "push"
|
||||
|
||||
async def async_turn_on(self, **kwargs: Any) -> None:
|
||||
"""Turn on the switch."""
|
||||
|
Loading…
x
Reference in New Issue
Block a user