Add entity translations for Acmeda (#94170)
This commit is contained in:
parent
04dc85b754
commit
8987e023a0
3 changed files with 5 additions and 12 deletions
|
@ -14,6 +14,7 @@ class AcmedaBase(entity.Entity):
|
|||
"""Base representation of an Acmeda roller."""
|
||||
|
||||
_attr_should_poll = False
|
||||
_attr_has_entity_name = True
|
||||
|
||||
def __init__(self, roller: aiopulse.Roller) -> None:
|
||||
"""Initialize the roller."""
|
||||
|
@ -72,11 +73,6 @@ class AcmedaBase(entity.Entity):
|
|||
"""Return the ID of this roller."""
|
||||
return self.roller.id
|
||||
|
||||
@property
|
||||
def name(self) -> str | None:
|
||||
"""Return the name of roller."""
|
||||
return self.roller.name
|
||||
|
||||
@property
|
||||
def device_info(self) -> entity.DeviceInfo:
|
||||
"""Return the device info."""
|
||||
|
|
|
@ -45,7 +45,9 @@ async def async_setup_entry(
|
|||
|
||||
|
||||
class AcmedaCover(AcmedaBase, CoverEntity):
|
||||
"""Representation of a Acmeda cover device."""
|
||||
"""Representation of an Acmeda cover device."""
|
||||
|
||||
_attr_name = None
|
||||
|
||||
@property
|
||||
def current_cover_position(self) -> int | None:
|
||||
|
|
|
@ -40,16 +40,11 @@ async def async_setup_entry(
|
|||
|
||||
|
||||
class AcmedaBattery(AcmedaBase, SensorEntity):
|
||||
"""Representation of a Acmeda cover device."""
|
||||
"""Representation of an Acmeda cover sensor."""
|
||||
|
||||
_attr_device_class = SensorDeviceClass.BATTERY
|
||||
_attr_native_unit_of_measurement = PERCENTAGE
|
||||
|
||||
@property
|
||||
def name(self) -> str:
|
||||
"""Return the name of roller."""
|
||||
return f"{super().name} Battery"
|
||||
|
||||
@property
|
||||
def native_value(self) -> float | int | None:
|
||||
"""Return the state of the device."""
|
||||
|
|
Loading…
Add table
Reference in a new issue