Use shorthand attributes in Motion eye (#99596)

pull/99604/head
Joost Lekkerkerker 2023-09-04 15:18:22 +02:00 committed by GitHub
parent cab0bde37b
commit f1bb7c25db
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 8 deletions

View File

@ -143,6 +143,10 @@ async def async_setup_entry(
class MotionEyeMjpegCamera(MotionEyeEntity, MjpegCamera):
"""motionEye mjpeg camera."""
_attr_brand = MOTIONEYE_MANUFACTURER
# motionEye cameras are always streaming or unavailable.
_attr_is_streaming = True
def __init__(
self,
config_entry_id: str,
@ -158,9 +162,6 @@ class MotionEyeMjpegCamera(MotionEyeEntity, MjpegCamera):
self._surveillance_password = password
self._motion_detection_enabled: bool = camera.get(KEY_MOTION_DETECTION, False)
# motionEye cameras are always streaming or unavailable.
self._attr_is_streaming = True
MotionEyeEntity.__init__(
self,
config_entry_id,
@ -249,11 +250,6 @@ class MotionEyeMjpegCamera(MotionEyeEntity, MjpegCamera):
)
super()._handle_coordinator_update()
@property
def brand(self) -> str:
"""Return the camera brand."""
return MOTIONEYE_MANUFACTURER
@property
def motion_detection_enabled(self) -> bool:
"""Return the camera motion detection status."""