mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-08-02 17:12:16 +03:00
Enable mypy for DB and fix types (#19434)
* Install peewee type hints * Models now have proper types * Fix iterator type * Enable debug builds with dev reqs installed * Install as wheel * Fix cast type
This commit is contained in:
committed by
Blake Blackshear
parent
6ecc631486
commit
7c1681e344
@@ -3,7 +3,7 @@
|
||||
import datetime
|
||||
import json
|
||||
import logging
|
||||
from typing import Any, Callable, Optional
|
||||
from typing import Any, Callable, Optional, cast
|
||||
|
||||
from frigate.camera import PTZMetrics
|
||||
from frigate.camera.activity_manager import CameraActivityManager
|
||||
@@ -135,7 +135,7 @@ class Dispatcher:
|
||||
|
||||
def handle_update_event_description() -> None:
|
||||
event: Event = Event.get(Event.id == payload["id"])
|
||||
event.data["description"] = payload["description"]
|
||||
cast(dict, event.data)["description"] = payload["description"]
|
||||
event.save()
|
||||
self.publish(
|
||||
"tracked_object_update",
|
||||
|
||||
@@ -70,7 +70,7 @@ class WebPushClient(Communicator):
|
||||
# Pull keys from PEM or generate if they do not exist
|
||||
self.vapid = Vapid01.from_file(os.path.join(CONFIG_DIR, "notifications.pem"))
|
||||
|
||||
users: list[User] = (
|
||||
users: list[dict[str, Any]] = (
|
||||
User.select(User.username, User.notification_tokens).dicts().iterator()
|
||||
)
|
||||
for user in users:
|
||||
|
||||
Reference in New Issue
Block a user