Use _attr_should_poll in camera entities (#77173)
This commit is contained in:
parent
03ed552ca9
commit
df5f6bdfc1
7 changed files with 8 additions and 38 deletions
|
@ -36,6 +36,8 @@ def setup_platform(
|
|||
class ZoneMinderCamera(MjpegCamera):
|
||||
"""Representation of a ZoneMinder Monitor Stream."""
|
||||
|
||||
_attr_should_poll = True # Cameras default to False
|
||||
|
||||
def __init__(self, monitor, verify_ssl):
|
||||
"""Initialize as a subclass of MjpegCamera."""
|
||||
super().__init__(
|
||||
|
@ -48,11 +50,6 @@ class ZoneMinderCamera(MjpegCamera):
|
|||
self._is_available = None
|
||||
self._monitor = monitor
|
||||
|
||||
@property
|
||||
def should_poll(self):
|
||||
"""Update the recording state periodically."""
|
||||
return True
|
||||
|
||||
def update(self):
|
||||
"""Update our recording state from the ZM API."""
|
||||
_LOGGER.debug("Updating camera state for monitor %i", self._monitor.id)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue