2024-12-17 20:15:42 +00:00
|
|
|
"""Implementation of lens mask privacy module."""
|
|
|
|
|
|
|
|
from __future__ import annotations
|
|
|
|
|
|
|
|
import logging
|
|
|
|
|
|
|
|
from ..smartcammodule import SmartCamModule
|
|
|
|
|
|
|
|
_LOGGER = logging.getLogger(__name__)
|
|
|
|
|
|
|
|
|
|
|
|
class LensMask(SmartCamModule):
|
|
|
|
"""Implementation of lens mask module."""
|
|
|
|
|
2024-12-19 13:52:25 +00:00
|
|
|
REQUIRED_COMPONENT = "lensMask"
|
|
|
|
|
2024-12-17 20:15:42 +00:00
|
|
|
QUERY_GETTER_NAME = "getLensMaskConfig"
|
|
|
|
QUERY_MODULE_NAME = "lens_mask"
|
|
|
|
QUERY_SECTION_NAMES = "lens_mask_info"
|
|
|
|
|
|
|
|
@property
|
2024-12-19 13:52:25 +00:00
|
|
|
def enabled(self) -> bool:
|
2024-12-17 20:15:42 +00:00
|
|
|
"""Return the lens mask state."""
|
2024-12-19 13:52:25 +00:00
|
|
|
return self.data["lens_mask_info"]["enabled"] == "on"
|
2024-12-17 20:15:42 +00:00
|
|
|
|
2024-12-19 13:52:25 +00:00
|
|
|
async def set_enabled(self, enable: bool) -> dict:
|
2024-12-17 20:15:42 +00:00
|
|
|
"""Set the lens mask state."""
|
2024-12-19 13:52:25 +00:00
|
|
|
params = {"enabled": "on" if enable else "off"}
|
2024-12-17 20:15:42 +00:00
|
|
|
return await self._device._query_setter_helper(
|
|
|
|
"setLensMaskConfig", self.QUERY_MODULE_NAME, "lens_mask_info", params
|
|
|
|
)
|