diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 0000000..52689c2 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,22 @@ +// For format details, see https://aka.ms/devcontainer.json. For config options, see the +// README at: https://github.com/devcontainers/templates/tree/main/src/python +{ + "name": "Python 3", + // Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile + "image": "mcr.microsoft.com/devcontainers/python:1-3.11-bookworm", + + // Features to add to the dev container. More info: https://containers.dev/features. + // "features": {}, + + // Use 'forwardPorts' to make a list of ports inside the container available locally. + // "forwardPorts": [], + + // Use 'postCreateCommand' to run commands after the container is created. + "postCreateCommand": "pip3 install --user -r requirements.txt" + + // Configure tool-specific properties. + // "customizations": {}, + + // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. + // "remoteUser": "root" +} diff --git a/index.py b/index.py index 2269bb0..1cf1087 100644 --- a/index.py +++ b/index.py @@ -321,7 +321,8 @@ def get_snapshot(frigate_event_id, frigate_url, cropped): _LOGGER.debug(f"event URL: {snapshot_url}") # get snapshot - response = requests.get(snapshot_url, params={ "crop": cropped, "quality": 95 }) + parameters = {"crop": 1 if cropped else 0, "quality": 95} + response = requests.get(snapshot_url, params=parameters) # Check if the request was successful (HTTP status code 200) if response.status_code != 200: