Use entity class attributes for august (#52744)

This commit is contained in:
Robert Hillis 2021-07-13 15:56:34 -04:00 committed by GitHub
parent 12ac666459
commit d76607e945
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 52 additions and 177 deletions

View file

@ -35,11 +35,8 @@ class AugustCamera(AugustEntityMixin, Camera):
self._session = session
self._image_url = None
self._image_content = None
@property
def name(self):
"""Return the name of this device."""
return f"{self._device.device_name} Camera"
self._attr_name = f"{device.device_name} Camera"
self._attr_unique_id = f"{self._device_id:s}_camera"
@property
def is_recording(self):
@ -81,8 +78,3 @@ class AugustCamera(AugustEntityMixin, Camera):
self._session, timeout=self._timeout
)
return self._image_content
@property
def unique_id(self) -> str:
"""Get the unique id of the camera."""
return f"{self._device_id:s}_camera"