mirror of
https://github.com/home-assistant/core.git
synced 2025-07-20 03:37:07 +00:00
Use shorthand attributes in Motion eye (#99596)
This commit is contained in:
parent
cab0bde37b
commit
f1bb7c25db
@ -143,6 +143,10 @@ async def async_setup_entry(
|
|||||||
class MotionEyeMjpegCamera(MotionEyeEntity, MjpegCamera):
|
class MotionEyeMjpegCamera(MotionEyeEntity, MjpegCamera):
|
||||||
"""motionEye mjpeg camera."""
|
"""motionEye mjpeg camera."""
|
||||||
|
|
||||||
|
_attr_brand = MOTIONEYE_MANUFACTURER
|
||||||
|
# motionEye cameras are always streaming or unavailable.
|
||||||
|
_attr_is_streaming = True
|
||||||
|
|
||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
config_entry_id: str,
|
config_entry_id: str,
|
||||||
@ -158,9 +162,6 @@ class MotionEyeMjpegCamera(MotionEyeEntity, MjpegCamera):
|
|||||||
self._surveillance_password = password
|
self._surveillance_password = password
|
||||||
self._motion_detection_enabled: bool = camera.get(KEY_MOTION_DETECTION, False)
|
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__(
|
MotionEyeEntity.__init__(
|
||||||
self,
|
self,
|
||||||
config_entry_id,
|
config_entry_id,
|
||||||
@ -249,11 +250,6 @@ class MotionEyeMjpegCamera(MotionEyeEntity, MjpegCamera):
|
|||||||
)
|
)
|
||||||
super()._handle_coordinator_update()
|
super()._handle_coordinator_update()
|
||||||
|
|
||||||
@property
|
|
||||||
def brand(self) -> str:
|
|
||||||
"""Return the camera brand."""
|
|
||||||
return MOTIONEYE_MANUFACTURER
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def motion_detection_enabled(self) -> bool:
|
def motion_detection_enabled(self) -> bool:
|
||||||
"""Return the camera motion detection status."""
|
"""Return the camera motion detection status."""
|
||||||
|
Loading…
x
Reference in New Issue
Block a user