Use EntityFeature enum in components (a**) (#69333)
This commit is contained in:
parent
8b2948f030
commit
246f4e081a
20 changed files with 169 additions and 237 deletions
|
@ -4,7 +4,7 @@ import logging
|
|||
|
||||
from agent import AgentError
|
||||
|
||||
from homeassistant.components.camera import SUPPORT_ON_OFF
|
||||
from homeassistant.components.camera import CameraEntityFeature
|
||||
from homeassistant.components.mjpeg import MjpegCamera, filter_urllib3_logging
|
||||
from homeassistant.const import ATTR_ATTRIBUTION
|
||||
from homeassistant.helpers import entity_platform
|
||||
|
@ -63,6 +63,8 @@ async def async_setup_entry(
|
|||
class AgentCamera(MjpegCamera):
|
||||
"""Representation of an Agent Device Stream."""
|
||||
|
||||
_attr_supported_features = CameraEntityFeature.ON_OFF
|
||||
|
||||
def __init__(self, device):
|
||||
"""Initialize as a subclass of MjpegCamera."""
|
||||
self.device = device
|
||||
|
@ -134,11 +136,6 @@ class AgentCamera(MjpegCamera):
|
|||
"""Return True if entity is connected."""
|
||||
return self.device.connected
|
||||
|
||||
@property
|
||||
def supported_features(self) -> int:
|
||||
"""Return supported features."""
|
||||
return SUPPORT_ON_OFF
|
||||
|
||||
@property
|
||||
def is_on(self) -> bool:
|
||||
"""Return true if on."""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue