mirror of
https://github.com/home-assistant/core.git
synced 2025-04-22 16:27:56 +00:00
Add translation_domain
to lamarzocco exceptions (#126959)
This commit is contained in:
parent
f6ac5dab74
commit
8a266aac34
@ -13,6 +13,7 @@ from homeassistant.exceptions import HomeAssistantError
|
||||
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||
|
||||
from . import LaMarzoccoConfigEntry
|
||||
from .const import DOMAIN
|
||||
from .entity import LaMarzoccoEntity, LaMarzoccoEntityDescription
|
||||
|
||||
|
||||
@ -61,6 +62,7 @@ class LaMarzoccoButtonEntity(LaMarzoccoEntity, ButtonEntity):
|
||||
await self.entity_description.press_fn(self.coordinator.device)
|
||||
except RequestNotSuccessful as exc:
|
||||
raise HomeAssistantError(
|
||||
translation_domain=DOMAIN,
|
||||
translation_key="button_error",
|
||||
translation_placeholders={
|
||||
"key": self.entity_description.key,
|
||||
|
@ -32,6 +32,7 @@ from homeassistant.exceptions import HomeAssistantError
|
||||
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||
|
||||
from . import LaMarzoccoConfigEntry
|
||||
from .const import DOMAIN
|
||||
from .coordinator import LaMarzoccoUpdateCoordinator
|
||||
from .entity import LaMarzoccoEntity, LaMarzoccoEntityDescription
|
||||
|
||||
@ -228,6 +229,7 @@ class LaMarzoccoNumberEntity(LaMarzoccoEntity, NumberEntity):
|
||||
)
|
||||
except RequestNotSuccessful as exc:
|
||||
raise HomeAssistantError(
|
||||
translation_domain=DOMAIN,
|
||||
translation_key="number_exception",
|
||||
translation_placeholders={
|
||||
"key": self.entity_description.key,
|
||||
@ -277,6 +279,7 @@ class LaMarzoccoKeyNumberEntity(LaMarzoccoEntity, NumberEntity):
|
||||
)
|
||||
except RequestNotSuccessful as exc:
|
||||
raise HomeAssistantError(
|
||||
translation_domain=DOMAIN,
|
||||
translation_key="number_exception_key",
|
||||
translation_placeholders={
|
||||
"key": self.entity_description.key,
|
||||
|
@ -16,6 +16,7 @@ from homeassistant.exceptions import HomeAssistantError
|
||||
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||
|
||||
from . import LaMarzoccoConfigEntry
|
||||
from .const import DOMAIN
|
||||
from .entity import LaMarzoccoEntity, LaMarzoccoEntityDescription
|
||||
|
||||
STEAM_LEVEL_HA_TO_LM = {
|
||||
@ -121,6 +122,7 @@ class LaMarzoccoSelectEntity(LaMarzoccoEntity, SelectEntity):
|
||||
)
|
||||
except RequestNotSuccessful as exc:
|
||||
raise HomeAssistantError(
|
||||
translation_domain=DOMAIN,
|
||||
translation_key="select_option_error",
|
||||
translation_placeholders={
|
||||
"key": self.entity_description.key,
|
||||
|
@ -16,6 +16,7 @@ from homeassistant.exceptions import HomeAssistantError
|
||||
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||
|
||||
from . import LaMarzoccoConfigEntry
|
||||
from .const import DOMAIN
|
||||
from .coordinator import LaMarzoccoUpdateCoordinator
|
||||
from .entity import LaMarzoccoBaseEntity, LaMarzoccoEntity, LaMarzoccoEntityDescription
|
||||
|
||||
@ -83,6 +84,7 @@ class LaMarzoccoSwitchEntity(LaMarzoccoEntity, SwitchEntity):
|
||||
await self.entity_description.control_fn(self.coordinator.device, True)
|
||||
except RequestNotSuccessful as exc:
|
||||
raise HomeAssistantError(
|
||||
translation_domain=DOMAIN,
|
||||
translation_key="switch_on_error",
|
||||
translation_placeholders={"key": self.entity_description.key},
|
||||
) from exc
|
||||
@ -94,6 +96,7 @@ class LaMarzoccoSwitchEntity(LaMarzoccoEntity, SwitchEntity):
|
||||
await self.entity_description.control_fn(self.coordinator.device, False)
|
||||
except RequestNotSuccessful as exc:
|
||||
raise HomeAssistantError(
|
||||
translation_domain=DOMAIN,
|
||||
translation_key="switch_off_error",
|
||||
translation_placeholders={"name": self.entity_description.key},
|
||||
) from exc
|
||||
@ -132,6 +135,7 @@ class LaMarzoccoAutoOnOffSwitchEntity(LaMarzoccoBaseEntity, SwitchEntity):
|
||||
await self.coordinator.device.set_wake_up_sleep(wake_up_sleep_entry)
|
||||
except RequestNotSuccessful as exc:
|
||||
raise HomeAssistantError(
|
||||
translation_domain=DOMAIN,
|
||||
translation_key="auto_on_off_error",
|
||||
translation_placeholders={"id": self._identifier, "state": str(state)},
|
||||
) from exc
|
||||
|
@ -18,6 +18,7 @@ from homeassistant.exceptions import HomeAssistantError
|
||||
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||
|
||||
from . import LaMarzoccoConfigEntry
|
||||
from .const import DOMAIN
|
||||
from .entity import LaMarzoccoEntity, LaMarzoccoEntityDescription
|
||||
|
||||
|
||||
@ -101,6 +102,7 @@ class LaMarzoccoUpdateEntity(LaMarzoccoEntity, UpdateEntity):
|
||||
)
|
||||
except RequestNotSuccessful as exc:
|
||||
raise HomeAssistantError(
|
||||
translation_domain=DOMAIN,
|
||||
translation_key="update_failed",
|
||||
translation_placeholders={
|
||||
"key": self.entity_description.key,
|
||||
@ -108,6 +110,7 @@ class LaMarzoccoUpdateEntity(LaMarzoccoEntity, UpdateEntity):
|
||||
) from exc
|
||||
if not success:
|
||||
raise HomeAssistantError(
|
||||
translation_domain=DOMAIN,
|
||||
translation_key="update_failed",
|
||||
translation_placeholders={
|
||||
"key": self.entity_description.key,
|
||||
|
Loading…
x
Reference in New Issue
Block a user