Use shorthand attributes in Neato (#99605)

Co-authored-by: Robert Resch <robert@resch.dev>
This commit is contained in:
Joost Lekkerkerker 2023-09-05 16:33:46 +02:00 committed by GitHub
parent 5afba6327c
commit 2c45d43e7b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 27 additions and 75 deletions

View file

@ -17,11 +17,7 @@ class NeatoEntity(Entity):
def __init__(self, robot: Robot) -> None:
"""Initialize Neato entity."""
self.robot = robot
@property
def device_info(self) -> DeviceInfo:
"""Return device info."""
return DeviceInfo(
self._attr_device_info: DeviceInfo = DeviceInfo(
identifiers={(NEATO_DOMAIN, self.robot.serial)},
name=self.robot.name,
)