Skip to content

Commit

Permalink
Merge pull request #1524 from dermotduffy/dev
Browse files Browse the repository at this point in the history
Merge `dev` back to `main` in advance of release
  • Loading branch information
dermotduffy authored Sep 14, 2024
2 parents 50a5d4f + c7c134b commit f6523bb
Show file tree
Hide file tree
Showing 562 changed files with 68,342 additions and 21,879 deletions.
2 changes: 2 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,5 @@ ARG HOME="/home/vscode"
ENV VOLTA_HOME="${HOME}/.volta"
ENV PATH="${VOLTA_HOME}/bin:${PATH}"
RUN bash -c "$(curl -fsSL https://get.volta.sh)" -- --skip-setup

CMD ["sleep", "infinity"]
14 changes: 8 additions & 6 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
// See https://aka.ms/vscode-remote/devcontainer.json for format details.
{
"dockerComposeFile": "../docker-compose.yml",
"service": "dev",
"service": "devcontainer",
"features": {
"ghcr.io/devcontainers/features/docker-outside-of-docker:1": {
"moby": false,
"dockerDashComposeVersion": "v2"
"moby": false
}
},
"updateRemoteUserUID": true,
"workspaceFolder": "${localWorkspaceFolder}",
"shutdownAction": "stopCompose",
"initializeCommand": [".devcontainer/initialize.sh"],
"postCreateCommand": ["yarn", "install"],
"forwardPorts": [10001, "hass:8123", "frigate:5000"],
"portsAttributes": {
"10001": {
Expand All @@ -25,8 +26,6 @@
"onAutoForward": "silent"
}
},
"initializeCommand": ".devcontainer/initialize.sh",
"postCreateCommand": "yarn install",
"customizations": {
"vscode": {
"extensions": [
Expand All @@ -39,9 +38,12 @@
"davidanson.vscode-markdownlint",
"redhat.vscode-yaml",
"lokalise.i18n-ally",
"vitest.explorer",
"inlang.vs-code-extension",
"ms-azuretools.vscode-docker"
],
"settings": {
"task.allowAutomaticTasks": "on",
"files.eol": "\n",
"editor.tabSize": 2,
"editor.formatOnPaste": false,
Expand Down
2 changes: 1 addition & 1 deletion .devcontainer/frigate-hass-integration
Submodule frigate-hass-integration updated 56 files
+1 −10 .devcontainer/Dockerfile
+1 −9 .devcontainer/config/configuration.yaml
+50 −42 .devcontainer/devcontainer.json
+9 −12 .devcontainer/frigate.yml
+15 −0 .devcontainer/preconfig/.storage/core.config_entries
+13 −0 .devcontainer/preconfig/.storage/lovelace.frigate
+18 −0 .devcontainer/preconfig/.storage/lovelace_dashboards
+7 −7 .github/workflows/build.yaml
+2 −2 .github/workflows/labeler.yml
+1 −1 .github/workflows/release-drafter.yml
+32 −0 .github/workflows/stale.yml
+1 −1 README.md
+49 −11 custom_components/frigate/__init__.py
+32 −0 custom_components/frigate/api.py
+92 −1 custom_components/frigate/binary_sensor.py
+109 −102 custom_components/frigate/camera.py
+11 −2 custom_components/frigate/config_flow.py
+20 −5 custom_components/frigate/const.py
+5 −3 custom_components/frigate/diagnostics.py
+10 −0 custom_components/frigate/icons.py
+123 −0 custom_components/frigate/image.py
+2 −2 custom_components/frigate/manifest.json
+24 −37 custom_components/frigate/media_source.py
+112 −10 custom_components/frigate/sensor.py
+71 −0 custom_components/frigate/services.yaml
+34 −2 custom_components/frigate/switch.py
+36 −0 custom_components/frigate/translations/ca.json
+35 −0 custom_components/frigate/translations/de.json
+31 −30 custom_components/frigate/translations/en.json
+36 −0 custom_components/frigate/translations/fr.json
+30 −28 custom_components/frigate/translations/pt-BR.json
+30 −28 custom_components/frigate/translations/pt_br.json
+36 −0 custom_components/frigate/translations/ru.json
+1 −1 custom_components/frigate/update.py
+8 −0 custom_components/frigate/views.py
+108 −2 custom_components/frigate/ws_api.py
+95 −0 custom_components/frigate/ws_event_proxy.py
+2 −5 docker-compose.yml
+14 −0 project.inlang.json
+3 −4 pyproject.toml
+1 −1 requirements.txt
+3 −3 requirements_dev.txt
+37 −11 tests/__init__.py
+150 −50 tests/fixtures/events_front_door.json
+65 −2 tests/test_api.py
+33 −0 tests/test_binary_sensor.py
+200 −42 tests/test_camera.py
+3 −0 tests/test_config_flow.py
+1 −0 tests/test_icons.py
+86 −0 tests/test_image.py
+62 −2 tests/test_init.py
+10 −9 tests/test_media_source.py
+54 −6 tests/test_sensor.py
+26 −0 tests/test_switch.py
+30 −0 tests/test_views.py
+252 −0 tests/test_ws_api.py
27 changes: 14 additions & 13 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
module.exports = {
parser: "@typescript-eslint/parser", // Specifies the ESLint parser
parserOptions: {
ecmaVersion: 2020, // Allows for the parsing of modern ECMAScript features
sourceType: "module" // Allows for the use of imports
},
extends: [
"plugin:@typescript-eslint/recommended" // Uses the recommended rules from the @typescript-eslint/eslint-plugin
],
rules: {
// Place to specify ESLint rules. Can be used to overwrite rules specified from the extended configs
// e.g. "@typescript-eslint/explicit-function-return-type": "off",
}
};
parser: '@typescript-eslint/parser', // Specifies the ESLint parser
parserOptions: {
ecmaVersion: 2020, // Allows for the parsing of modern ECMAScript features
sourceType: 'module', // Allows for the use of imports
},
extends: [
'plugin:@typescript-eslint/recommended', // Uses the recommended rules from the @typescript-eslint/eslint-plugin
'prettier', // Uses eslint-config-prettier to disable ESLint rules from @typescript-eslint/eslint-plugin that would conflict with prettier
],
rules: {
// Place to specify ESLint rules. Can be used to overwrite rules specified from the extended configs
// e.g. "@typescript-eslint/explicit-function-return-type": "off",
},
};
16 changes: 8 additions & 8 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
version: 2

updates:
- package-ecosystem: github-actions
directory: /
schedule:
interval: daily
target-branch: "dev"
version: 2

updates:
- package-ecosystem: github-actions
directory: /
schedule:
interval: daily
target-branch: 'dev'
46 changes: 23 additions & 23 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
---
categories:
- title: ":boom: Breaking Changes"
label: "breaking"
- title: ":rocket: Features"
label: "enhancement"
- title: ":fire: Removals and Deprecations"
label: "removal"
- title: ":bug: Fixes"
label: "bug"
- title: ":racehorse: Performance"
label: "performance"
- title: ":rotating_light: Testing"
label: "testing"
- title: ":construction_worker: Continuous Integration"
label: "ci"
- title: ":books: Documentation"
label: "documentation"
- title: ":hammer: Refactoring"
label: "refactoring"
- title: ":lipstick: Style"
label: "style"
- title: ":package: Dependencies"
- title: ':boom: Breaking Changes'
label: 'breaking'
- title: ':rocket: Features'
label: 'enhancement'
- title: ':fire: Removals and Deprecations'
label: 'removal'
- title: ':bug: Fixes'
label: 'bug'
- title: ':racehorse: Performance'
label: 'performance'
- title: ':rotating_light: Testing'
label: 'testing'
- title: ':construction_worker: Continuous Integration'
label: 'ci'
- title: ':books: Documentation'
label: 'documentation'
- title: ':hammer: Refactoring'
label: 'refactoring'
- title: ':lipstick: Style'
label: 'style'
- title: ':package: Dependencies'
labels:
- "dependencies"
- "build"
- 'dependencies'
- 'build'
template: |
## Changes
Expand Down
37 changes: 27 additions & 10 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
- dev
pull_request:
schedule:
- cron: "17 6 * * *"
- cron: '17 6 * * *'
workflow_dispatch:

jobs:
Expand All @@ -17,31 +17,48 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup Node and Yarn
uses: volta-cli/action@v4

- name: Install dependencies
run: yarn install --immutable

- name: Lint
run: yarn run lint

- name: Check formatting
run: yarn run format-check

- name: Test & Coverage
run: yarn run coverage

- name: Build
run: yarn run build

- name: Test
run: yarn run test

- name: HACS build validation
uses: "hacs/[email protected]"
uses: 'hacs/[email protected]'
with:
category: "plugin"
category: 'plugin'

# Don't attempt to load into HACS (as it loads the release, not the
# build).
ignore: "hacs"
ignore: 'hacs'

- name: Verify docs links
run: yarn run docs-check-links

- name: Upload artifact
uses: actions/upload-artifact@v3
- name: Upload javascript
uses: actions/upload-artifact@v4
with:
name: frigate-hass-card
path: dist/*.js

# When this issue is fixed, it would be useful to upload visualizations:
# https://github.com/actions/upload-artifact/issues/14
# - name: Upload visualizations
# uses: actions/upload-artifact@v4
# with:
# name: frigate-hass-card
# path: visualizations/*.html
4 changes: 2 additions & 2 deletions .github/workflows/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Check out the repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Run Labeler
uses: crazy-max/ghaction-github-labeler@v4.1.0
uses: crazy-max/ghaction-github-labeler@v5.0.0
with:
skip-delete: true
2 changes: 1 addition & 1 deletion .github/workflows/release-drafter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Run release-drafter
uses: release-drafter/release-drafter@v5.23.0
uses: release-drafter/release-drafter@v6.0.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
8 changes: 4 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup Node and Yarn
uses: volta-cli/action@v4
Expand All @@ -24,14 +24,14 @@ jobs:
run: yarn run build

- name: Zip the files
uses: thedoctor0/[email protected].1
uses: thedoctor0/[email protected].6
with:
type: zip
path: dist
filename: frigate-hass-card.zip

- name: Upload JS files to release
uses: svenstaro/upload-release-action@2.6.1
uses: svenstaro/upload-release-action@2.9.0

with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -41,7 +41,7 @@ jobs:
overwrite: true

- name: Upload Zip file to release
uses: svenstaro/upload-release-action@2.6.1
uses: svenstaro/upload-release-action@2.9.0

with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ package-lock.json
.env
.envrc

stats.html
/visualizations/
/coverage/

# https://yarnpkg.com/getting-started/qa#which-files-should-be-gitignored
Expand Down
2 changes: 2 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
docs/js/
.devcontainer/
8 changes: 0 additions & 8 deletions .prettierrc.cjs

This file was deleted.

6 changes: 3 additions & 3 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
"runem.lit-plugin",
"davidanson.vscode-markdownlint",
"redhat.vscode-yaml",
// "lokalise.i18n-ally",
"zixuanchen.vitest-explorer",
"inlang.vs-code-extension" // improved i18n DX
"lokalise.i18n-ally",
"vitest.explorer",
"inlang.vs-code-extension"
]
}
2 changes: 0 additions & 2 deletions .vscode/i18n-ally-custom-framework.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,12 @@ usageMatchRegex:
# you can ignore it and use your own matching rules as well
- "[^\\w\\d]localize\\(['\"`]({key})['\"`]"


# An array of strings containing refactor templates.
# The "$1" will be replaced by the keypath specified.
# Optional: uncomment the following two lines to use

# refactorTemplates:
# - i18n.get("$1")


# If set to true, only enables this custom framework (will disable all built-in frameworks)
monopoly: true
3 changes: 1 addition & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,5 @@
"i18n-ally.sortKeys": true,
"i18n-ally.keepFulfilled": true,
"i18n-ally.editor.preferEditor": true,
"i18n-ally.translate.saveAsCandidates": true,
"vitest.commandLine": "npx vitest --root ."
"i18n-ally.translate.saveAsCandidates": true
}
5 changes: 4 additions & 1 deletion .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,10 @@
"endsPattern": "^created"
}
},
"isBackground": true
"isBackground": true,
"runOptions": {
"runOn": "folderOpen"
}
}
]
}
7 changes: 7 additions & 0 deletions .yarn/patches/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Patches

## `sass`

`sass` is patched to avoid printing out a noisy deprecation notice on every
build. `sass` is imported by `rollup-plugin-styler`, in a way that triggers this
message. The patch simply prevents this console spam.
13 changes: 13 additions & 0 deletions .yarn/patches/sass-npm-1.77.4-13b6910aea.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/sass.node.mjs b/sass.node.mjs
index f59a3d8987162a3cbc9787c34f67186fb0f09186..b154f46118ccc03989b9a1c11309954c85515539 100644
--- a/sass.node.mjs
+++ b/sass.node.mjs
@@ -40,7 +40,7 @@ export const NodePackageImporter = cjs.NodePackageImporter;
export const deprecations = cjs.deprecations;
export const Version = cjs.Version;

-let printedDefaultExportDeprecation = false;
+let printedDefaultExportDeprecation = true;
function defaultExportDeprecation() {
if (printedDefaultExportDeprecation) return;
printedDefaultExportDeprecation = true;
Loading

0 comments on commit f6523bb

Please sign in to comment.