Skip to content

updates to lint, tests and build #3681

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Aug 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 0 additions & 39 deletions .eslintrc

This file was deleted.

6 changes: 3 additions & 3 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Add 'beta' label to any PR where the head branch name starts with `beta` or has a `beta` section in the name
beta:
- base-branch: ['^beta', 'beta', 'beta*']
- base-branch: [^beta, beta, 'beta*']

# Add 'alpha' label to any PR where the head branch name starts with `alpha` or has an `alpha` section in the name
alpha:
- base-branch: ['^alpha', 'alpha', 'alpha*']
- base-branch: [^alpha, alpha, 'alpha*']

# Add 'latest' label to any PR where the head branch name starts with `latest` or has a `latest` section in the name
latest:
- base-branch: ['^latest', 'latest', 'latest*']
- base-branch: [^latest, latest, 'latest*']
12 changes: 6 additions & 6 deletions .github/workflows/alpha-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ on:
jobs:
publish:
if: ${{ github.repository == 'homebridge/homebridge' }}
uses: homebridge/.github/.github/workflows/npm-publish.yml@latest
uses: homebridge/.github/.github/workflows/npm-publish-esm.yml@latest
with:
tag: 'alpha'
tag: alpha
dynamically_adjust_version: true
npm_version_command: 'pre'
pre_id: 'alpha'
npm_version_command: pre
pre_id: alpha
secrets:
npm_auth_token: ${{ secrets.npm_token }}

Expand All @@ -22,9 +22,9 @@ jobs:
needs: [publish]
uses: homebridge/.github/.github/workflows/discord-webhooks.yml@latest
with:
title: "Homebridge Alpha Release"
title: Homebridge Alpha Release
description: |
Version `v${{ needs.publish.outputs.NPM_VERSION }}`
url: "https://github.com/homebridge/homebridge/releases/tag/v${{ needs.publish.outputs.NPM_VERSION }}"
url: 'https://github.com/homebridge/homebridge/releases/tag/v${{ needs.publish.outputs.NPM_VERSION }}'
secrets:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK_URL_BETA }}
14 changes: 7 additions & 7 deletions .github/workflows/beta-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,23 +21,23 @@ jobs:

if: ${{ github.repository == 'homebridge/homebridge' }}

uses: homebridge/.github/.github/workflows/npm-publish.yml@latest
uses: homebridge/.github/.github/workflows/npm-publish-esm.yml@latest
with:
tag: 'beta'
tag: beta
dynamically_adjust_version: true
npm_version_command: 'pre'
pre_id: 'beta'
npm_version_command: pre
pre_id: beta
secrets:
npm_auth_token: ${{ secrets.npm_token }}

github-releases-to-discord:
name: Discord Webhooks
needs: [build_and_test,publish]
needs: [build_and_test, publish]
uses: homebridge/.github/.github/workflows/discord-webhooks.yml@latest
with:
title: "Homebridge Beta Release"
title: Homebridge Beta Release
description: |
Version `v${{ needs.publish.outputs.NPM_VERSION }}`
url: "https://github.com/homebridge/homebridge/releases/tag/v${{ needs.publish.outputs.NPM_VERSION }}"
url: 'https://github.com/homebridge/homebridge/releases/tag/v${{ needs.publish.outputs.NPM_VERSION }}'
secrets:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK_URL_BETA }}
6 changes: 3 additions & 3 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
name: "CodeQL"
name: CodeQL

on:
push:
branches: [ latest, beta* ]
branches: [latest, beta*]
pull_request:
branches: [ latest, beta* ]
branches: [latest, beta*]
schedule:
- cron: '17 9 * * 2'

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ jobs:
stale:
uses: homebridge/.github/.github/workflows/labeler.yml@latest
secrets:
token: ${{ secrets.GITHUB_TOKEN }}
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 @@ -19,18 +19,18 @@ jobs:

if: ${{ github.repository == 'homebridge/homebridge' }}

uses: homebridge/.github/.github/workflows/npm-publish.yml@latest
uses: homebridge/.github/.github/workflows/npm-publish-esm.yml@latest
secrets:
npm_auth_token: ${{ secrets.npm_token }}

github-releases-to-discord:
name: Discord Webhooks
needs: [build_and_test,publish]
needs: [build_and_test, publish]
uses: homebridge/.github/.github/workflows/discord-webhooks.yml@latest
with:
title: "Homebridge Release"
title: Homebridge Release
description: |
Version `v${{ needs.publish.outputs.NPM_VERSION }}`
url: "https://github.com/homebridge/homebridge/releases/tag/v${{ needs.publish.outputs.NPM_VERSION }}"
url: 'https://github.com/homebridge/homebridge/releases/tag/v${{ needs.publish.outputs.NPM_VERSION }}'
secrets:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK_URL_LATEST }}
2 changes: 1 addition & 1 deletion .github/workflows/wiki-change-notification.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
notify:
runs-on: ubuntu-latest
steps:
- uses: 'oznu/gh-wiki-edit-discord-notification@main'
- uses: oznu/gh-wiki-edit-discord-notification@main
with:
discord-webhook-url: ${{ secrets.DISCORD_WEBHOOK_WIKI_EDIT }}
ignore-collaborators: true
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ coverage/
# Ignore any extra plugins in the example directory that aren't in Git already
# (this is a sandbox for the user)
example-plugins
lib
dist

.idea

Expand Down
4 changes: 2 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"codeQL.githubDatabase.download": "never"
}
"codeQL.githubDatabase.download": "never"
}
8 changes: 6 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

All notable changes to `homebridge` will be documented in this file. This project tries to adhere to [Semantic Versioning](http://semver.org/).

## v1.8.4 (2024-07-19)
## BETA

### ⚠️ Breaking Changes

Expand All @@ -23,10 +23,14 @@ All notable changes to `homebridge` will be documented in this file. This projec
- remove deprecated `--remove-orphans` flag
- Update `typedoc` and refresh documentation
- Update dependencies + lint
- general code modernisation:
- move from `commonjs` to `esm` modules
- use lint rules from `@antfu/eslint-config`
- migrate from `jest` to `vitest` for testing

### Homebridge Dependencies

- `hap-nodejs` @ `v1.1.1-beta.0`
- `hap-nodejs` @ `v1.1.1-beta.2`

## v1.8.4 (2024-07-19)

Expand Down
33 changes: 16 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,19 @@

<img src="https://media.giphy.com/media/10l79ICohTu4iQ/giphy.gif" align="right" alt="Unlocking Door">

**Homebridge** is a lightweight Node.js server you can run on your home network that emulates the iOS HomeKit API. It supports Plugins, which are community-contributed modules that provide a basic bridge from HomeKit to various 3rd-party APIs provided by manufacturers of "smart home" devices.
**Homebridge** is a lightweight Node.js server you can run on your home network to emulate the HomeKit Accessory Protocol (HAP). It supports plugins, which are community-contributed modules that provide a basic bridge from HomeKit to various 3rd-party APIs provided by manufacturers of "smart home" devices.

Since Siri supports devices added through HomeKit, this means that with Homebridge you can ask Siri to control devices that don't have any support for HomeKit at all. For instance, using just some of the available plugins, you can say:

* _Siri, unlock the back door._ [pictured to the right]
* _Siri, open the garage door._
* _Siri, turn on the coffee maker._
* _Siri, turn on the living room lights._
* _Siri, good morning!_
- _Siri, unlock the back door._ [pictured to the right]
- _Siri, open the garage door._
- _Siri, turn on the coffee maker._
- _Siri, turn on the living room lights._
- _Siri, good morning!_

You can explore all available plugins at the NPM website by [searching for the keyword `homebridge-plugin`](https://www.npmjs.com/search?q=homebridge-plugin).

## Community
## Community

The official Homebridge Discord server and Reddit community are where users can discuss Homebridge and ask for help.

Expand Down Expand Up @@ -79,7 +79,7 @@ HomeKit communities can also be found on both [Discord](https://discord.gg/RcV7f

### Docker

[Install Homebridge on Docker](https://github.com/homebridge/homebridge/wiki/Install-Homebridge-on-Docker) <br> [Synology](https://github.com/homebridge/docker-homebridge/wiki/Homebridge-on-Synology) | [Unraid](https://github.com/homebridge/docker-homebridge/wiki/Homebridge-on-Unraid) | [QNAP](https://github.com/homebridge/docker-homebridge/wiki/Homebridge-on-QNAP) | [TrueNAS Scale](https://github.com/homebridge/docker-homebridge/wiki/Homebridge-on-TrueNAS-Scale)
[Install Homebridge on Docker](https://github.com/homebridge/homebridge/wiki/Install-Homebridge-on-Docker) <br> [Synology](https://github.com/homebridge/docker-homebridge/wiki/Homebridge-on-Synology) | [Unraid](https://github.com/homebridge/docker-homebridge/wiki/Homebridge-on-Unraid) | [QNAP](https://github.com/homebridge/docker-homebridge/wiki/Homebridge-on-QNAP) | [TrueNAS Scale](https://github.com/homebridge/docker-homebridge/wiki/Homebridge-on-TrueNAS-Scale)

---

Expand All @@ -97,9 +97,9 @@ HomeKit communities can also be found on both [Discord](https://discord.gg/RcV7f

1. Open the Home <img src="https://user-images.githubusercontent.com/3979615/78010622-4ea1d380-738e-11ea-8a17-e6a465eeec35.png" height="16.42px"> app on your device.
2. Tap the Home tab, then tap <img src="https://user-images.githubusercontent.com/3979615/78010869-9aed1380-738e-11ea-9644-9f46b3633026.png" height="16.42px">.
3. Tap *Add Accessory*, then scan the QR code shown in the Homebridge UI or your Homebridge logs.
3. Tap _Add Accessory_, then scan the QR code shown in the Homebridge UI or your Homebridge logs.

If the bridge does not have any accessories yet, you may receive a message saying *Additional Set-up Required*, this is ok, as you add plugins they will show up in the Home app without the need to pair again (except for Cameras and TVs).
If the bridge does not have any accessories yet, you may receive a message saying _Additional Set-up Required_, this is ok, as you add plugins they will show up in the Home app without the need to pair again (except for Cameras and TVs).

Cameras and most TV devices are exposed as separate accessories and each needs to be paired separately. See [this wiki article](https://github.com/homebridge/homebridge/wiki/Connecting-Homebridge-To-HomeKit#how-to-add-homebridge-cameras--tvs) for instructions.

Expand All @@ -113,18 +113,17 @@ One final thing to remember is that Siri will almost always prefer its default p

The https://developers.homebridge.io website contains the Homebridge API reference, available service and characteristic types, and plugin examples.

The [Homebridge Plugin Template](https://github.com/homebridge/homebridge-plugin-template) project provides a base you can use to create your own *platform* plugin.
The [Homebridge Plugin Template](https://github.com/homebridge/homebridge-plugin-template) project provides a base you can use to create your own _platform_ plugin.

There are many existing plugins you can study; you might start with the [Homebridge Example Plugins](https://github.com/homebridge/homebridge-examples) or a plugin that already implements the device type you need.

When writing your plugin, you'll want Homebridge to load it from your development directory instead of publishing it to `npm` each time. Run this command inside your plugin project folder so your global installation of Homebridge can discover it:


```shell
npm link
```

*You can undo this using the `npm unlink` command.*
_You can undo this using the `npm unlink` command._

Then start Homebridge in debug mode:

Expand All @@ -150,13 +149,13 @@ To fix this, [Reset Homebridge](https://github.com/homebridge/homebridge/wiki/Co

Try the following:

1. Swap between the `Bonjour HAP` and `Ciao` mDNS Advertiser options. See [the wiki](https://github.com/homebridge/homebridge/wiki/mDNS-Options) for more details.
2. iOS DNS cache has gone stale or gotten misconfigured. To fix this, turn airplane mode on and back off to flush the DNS cache.
1. Swap between the `Bonjour HAP` and `Ciao` mDNS Advertiser options. See [the wiki](https://github.com/homebridge/homebridge/wiki/mDNS-Options) for more details.
2. iOS DNS cache has gone stale or gotten misconfigured. To fix this, turn airplane mode on and back off to flush the DNS cache.

### Limitations

* One bridge can only expose 150 accessories due to a HomeKit limit. You can however run your plugins as a [Child Bridge](https://github.com/homebridge/homebridge/wiki/Child-Bridges) or run [Multiple Homebridge Instances](https://github.com/homebridge/homebridge-config-ui-x/wiki/Homebridge-Service-Command#multiple-instances) to get around this limitation.
* Once an accessory has been added to the Home app, changing its name via Homebridge won't be automatically reflected in iOS. You must change it via the Home app as well.
- One bridge can only expose 150 accessories due to a HomeKit limit. You can however run your plugins as a [Child Bridge](https://github.com/homebridge/homebridge/wiki/Child-Bridges) or run [Multiple Homebridge Instances](https://github.com/homebridge/homebridge-config-ui-x/wiki/Homebridge-Service-Command#multiple-instances) to get around this limitation.
- Once an accessory has been added to the Home app, changing its name via Homebridge won't be automatically reflected in iOS. You must change it via the Home app as well.

## Why Homebridge?

Expand Down
14 changes: 8 additions & 6 deletions bin/homebridge
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,16 @@
// This executable sets up the environment and runs the HomeBridge CLI.
//

"use strict";
import { realpathSync } from 'node:fs'
import { dirname, join } from 'node:path'
import process from 'node:process'
import { fileURLToPath } from 'node:url'

process.title = "homebridge";
process.title = 'homebridge'

// Find the HomeBridge lib
const path = require("path");
const fs = require("fs");
const lib = path.join(path.dirname(fs.realpathSync(__filename)), "../lib");
const __filename = fileURLToPath(import.meta.url)
const lib = join(dirname(realpathSync(__filename)), '../dist')

// Run HomeBridge
require(lib + '/cli')();
import(`${lib}/cli.js`).then(({ default: run }) => run())
6 changes: 3 additions & 3 deletions config-sample.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"port": 51826,
"pin": "031-45-154"
},

"description": "This is an example configuration file with one fake accessory and one fake platform. You can use this as a template for creating your own configuration file containing devices you actually own.",
"ports": {
"start": 52100,
Expand All @@ -23,8 +23,8 @@

"platforms": [
{
"platform" : "PhilipsHue",
"name" : "Hue"
"platform": "PhilipsHue",
"name": "Hue"
}
]
}
2 changes: 1 addition & 1 deletion docs/assets/main.js

Large diffs are not rendered by default.

Loading
Loading
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy