Skip to content

Commit 453df2b

Browse files
Add device cleanup as a new feature (#754)
* Initial * Bump @types/node from 22.2.0 to 22.6.2 (#716) Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 22.2.0 to 22.6.2. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node) --- updated-dependencies: - dependency-name: "@types/node" dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump nodemon from 3.1.4 to 3.1.7 (#713) Bumps [nodemon](https://github.com/remy/nodemon) from 3.1.4 to 3.1.7. - [Release notes](https://github.com/remy/nodemon/releases) - [Commits](remy/nodemon@v3.1.4...v3.1.7) --- updated-dependencies: - dependency-name: nodemon dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump @types/jest from 29.5.12 to 29.5.13 (#707) Bumps [@types/jest](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/jest) from 29.5.12 to 29.5.13. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/jest) --- updated-dependencies: - dependency-name: "@types/jest" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump typescript from 5.5.3 to 5.6.2 (#705) Bumps [typescript](https://github.com/microsoft/TypeScript) from 5.5.3 to 5.6.2. - [Release notes](https://github.com/microsoft/TypeScript/releases) - [Changelog](https://github.com/microsoft/TypeScript/blob/main/azure-pipelines.release.yml) - [Commits](microsoft/TypeScript@v5.5.3...v5.6.2) --- updated-dependencies: - dependency-name: typescript dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump debug from 4.3.5 to 4.3.7 (#704) Bumps [debug](https://github.com/debug-js/debug) from 4.3.5 to 4.3.7. - [Release notes](https://github.com/debug-js/debug/releases) - [Commits](debug-js/debug@4.3.5...4.3.7) --- updated-dependencies: - dependency-name: debug dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump ts-jest from 29.2.2 to 29.2.5 (#698) Bumps [ts-jest](https://github.com/kulshekhar/ts-jest) from 29.2.2 to 29.2.5. - [Release notes](https://github.com/kulshekhar/ts-jest/releases) - [Changelog](https://github.com/kulshekhar/ts-jest/blob/main/CHANGELOG.md) - [Commits](kulshekhar/ts-jest@v29.2.2...v29.2.5) --- updated-dependencies: - dependency-name: ts-jest dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump semver from 7.6.2 to 7.6.3 (#677) Bumps [semver](https://github.com/npm/node-semver) from 7.6.2 to 7.6.3. - [Release notes](https://github.com/npm/node-semver/releases) - [Changelog](https://github.com/npm/node-semver/blob/main/CHANGELOG.md) - [Commits](npm/node-semver@v7.6.2...v7.6.3) --- updated-dependencies: - dependency-name: semver dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Dependencies * Initial build * WIP * Restructure and add lint * Trial * Working * Fix latency issue * Changelog * WIP * WIP * Routines * deviceCleanup --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
1 parent 79fb995 commit 453df2b

38 files changed

+7737
-13479
lines changed

.gitignore

+6-1
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,9 @@ alexaDiscovery.json
1212
tools/after.json
1313
tools/output.txt
1414

15-
gh-md-toc
15+
gh-md-toc
16+
/test/hbConfig/accessories
17+
/test/hbConfig/backups
18+
/test/hbConfig/persist
19+
test/hbConfig/config.json
20+
test/hbConfig/homebridge-alexa-discovery.json

.npmignore

+2
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,5 @@ README.md.toc.*
66
tools/*
77
publish.sh
88
beta.sh
9+
10+
test/*

CHANGELOG.md

+10
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,16 @@
22

33
All notable changes to this project will be documented in this file. This project uses [Semantic Versioning](https://semver.org/).
44

5+
## 0.8.0 (2024-12-24)
6+
7+
## [Version 0.8.0](https://github.com/northernman54/homebridge-alexa/compare/v0.7.1...v0.8.0)
8+
9+
#### Changes
10+
11+
- Changed behaviour for missing devices, and have updated the plugin inform Alexa about some missing devices so they can be automatically deleted. Feature is enabled with the config option `deviceCleanup`. Currently only removes devices when it detects that the homebridge instance / child bridge associated with the device is no longer available.
12+
13+
- Improved performance on `Alexa turn off all the lights`
14+
515
## 0.7.1 (2024-09-24)
616

717
## [Version 0.7.1](https://github.com/northernman54/homebridge-alexa/compare/v0.7.0...v0.7.1)

beta.sh

-16
This file was deleted.

config.schema.json

+7
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,12 @@
6262
"placeholder": false,
6363
"description": "Enable beta test environment. Only available by invitation."
6464
},
65+
"deviceCleanup": {
66+
"title": "<b>Cleanup of Not Responding Devices</b>",
67+
"type": "boolean",
68+
"default": true,
69+
"description": "Enables cleanup of devices that are not responding. This will remove devices from Alexa that are not responding. Defaults to true."
70+
},
6571
"refresh": {
6672
"title": "<b>Accessory Cache Refresh Interval</b>",
6773
"type": "integer",
@@ -255,6 +261,7 @@
255261
"items": [
256262
"pin",
257263
"routines",
264+
"deviceCleanup",
258265
"debug",
259266
"thermostatTurnOn",
260267
"enhancedSkip",

eslint.config.mjs

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
/** @type {import('eslint').FlatConfig[]} */
2+
import pluginJs from "@eslint/js";
3+
import pluginJest from "eslint-plugin-jest";
4+
import globals from "globals";
5+
6+
7+
export default [
8+
{
9+
files: ["**/*.js"],
10+
languageOptions: {
11+
sourceType: "commonjs", // This is necessary to parse imports/exports
12+
globals: {
13+
...globals.browser,
14+
...globals.es2021,
15+
...globals.jest, // Add Jest globals
16+
},
17+
},
18+
// Add any other specific rules here
19+
},
20+
pluginJs.configs.recommended,
21+
{
22+
plugins: {
23+
jest: pluginJest,
24+
},
25+
rules: {
26+
...pluginJest.configs.recommended.rules,
27+
"no-unused-vars": "warn", // Change no-unused-vars to a warning
28+
},
29+
},
30+
{
31+
// Exclude test, tools, and lib directories from linting
32+
ignores: ["test/**/*", "tools/**/*js"], // Exclude these files from linting
33+
}
34+
];

lib/alexaLocal.js

-197
This file was deleted.

0 commit comments

Comments
 (0)