adding clean_copy to snapshot config

This commit is contained in:
Blake Blackshear 2021-06-19 08:36:03 -05:00
parent f110a261b9
commit b134db48b3

View File

@ -634,6 +634,7 @@ CAMERAS_SCHEMA = vol.Schema(
}, },
vol.Optional("snapshots", default={}): { vol.Optional("snapshots", default={}): {
vol.Optional("enabled", default=False): bool, vol.Optional("enabled", default=False): bool,
vol.Optional("clean_copy", default=True): bool,
vol.Optional("timestamp", default=False): bool, vol.Optional("timestamp", default=False): bool,
vol.Optional("bounding_box", default=False): bool, vol.Optional("bounding_box", default=False): bool,
vol.Optional("crop", default=False): bool, vol.Optional("crop", default=False): bool,
@ -665,6 +666,7 @@ CAMERAS_SCHEMA = vol.Schema(
@dataclasses.dataclass @dataclasses.dataclass
class CameraSnapshotsConfig: class CameraSnapshotsConfig:
enabled: bool enabled: bool
clean_copy: bool
timestamp: bool timestamp: bool
bounding_box: bool bounding_box: bool
crop: bool crop: bool
@ -676,6 +678,7 @@ class CameraSnapshotsConfig:
def build(cls, config, global_config) -> CameraSnapshotsConfig: def build(cls, config, global_config) -> CameraSnapshotsConfig:
return CameraSnapshotsConfig( return CameraSnapshotsConfig(
enabled=config["enabled"], enabled=config["enabled"],
clean_copy=config["clean_copy"],
timestamp=config["timestamp"], timestamp=config["timestamp"],
bounding_box=config["bounding_box"], bounding_box=config["bounding_box"],
crop=config["crop"], crop=config["crop"],
@ -689,6 +692,7 @@ class CameraSnapshotsConfig:
def to_dict(self) -> Dict[str, Any]: def to_dict(self) -> Dict[str, Any]:
return { return {
"enabled": self.enabled, "enabled": self.enabled,
"clean_copy": self.clean_copy,
"timestamp": self.timestamp, "timestamp": self.timestamp,
"bounding_box": self.bounding_box, "bounding_box": self.bounding_box,
"crop": self.crop, "crop": self.crop,