功能:area_id 全链路支持 + 截图处理器独立 Redis 连接
- CameraInfo 模型添加 area_id 字段 - SQLite 表增加 area_id 列及迁移 - config_sync 同步 area_id 到本地 - 告警 ext_data 携带 area_id - 截图处理器使用独立 Redis 连接,避免与配置同步阻塞冲突 - get_all_camera_configs 使用 cursor.description 动态获取列名 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -49,7 +49,8 @@ class CameraInfo:
|
||||
enabled: bool = True
|
||||
location: Optional[str] = None
|
||||
extra_params: Optional[Dict[str, Any]] = None
|
||||
|
||||
area_id: Optional[int] = None
|
||||
|
||||
def to_dict(self) -> Dict[str, Any]:
|
||||
"""转换为字典"""
|
||||
return {
|
||||
@@ -60,8 +61,9 @@ class CameraInfo:
|
||||
"enabled": self.enabled,
|
||||
"location": self.location,
|
||||
"extra_params": self.extra_params,
|
||||
"area_id": self.area_id,
|
||||
}
|
||||
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls, data: Dict[str, Any]) -> 'CameraInfo':
|
||||
"""从字典创建实例"""
|
||||
@@ -73,6 +75,7 @@ class CameraInfo:
|
||||
enabled=data.get("enabled", True),
|
||||
location=data.get("location"),
|
||||
extra_params=data.get("extra_params"),
|
||||
area_id=data.get("area_id"),
|
||||
)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user