Commit graph

47 commits

Author SHA1 Message Date
dependabot[bot]
ae9dc17e0f
Bump hap-nodejs from 0.11.0 to 0.11.1 (#239) 2023-05-22 16:03:50 +02:00
Lars Strojny
33a7c9d0cf
Terminate output with a linefeed 2023-01-08 17:21:41 +01:00
Lars Strojny
c5f289946c
Fix missing metrics grouping (#97)
Closes #96
2023-01-08 15:12:01 +01:00
dependabot[bot]
70e0d06c95
Bump homebridge from 1.5.1 to 1.6.0 (#42)
Bumps [homebridge](https://github.com/homebridge/homebridge) from 1.5.1
to 1.6.0.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/homebridge/homebridge/releases">homebridge's
releases</a>.</em></p>
<blockquote>
<h2>v1.6.0</h2>
<h2>What's Changed</h2>
<ul>
<li>Updated <code>hap-nodejs</code> to <a
href="https://github.com/homebridge/HAP-NodeJS/releases/tag/v0.11.0">v0.11.0</a>
adding support for <code>systemd-resolved</code> mDNS advertisers and
improved support for systems running avahi mDNS advertiser. The release
also contains general bug fixes and improvements.</li>
<li>Support resolved mDNS advertiser by <a
href="https://github.com/elyscape"><code>@​elyscape</code></a> in <a
href="https://github-redirect.dependabot.com/homebridge/homebridge/pull/3260">homebridge/homebridge#3260</a></li>
<li>Update to provide compatibility with hap-nodejs 0.11.0 by <a
href="https://github.com/Supereg"><code>@​Supereg</code></a> in <a
href="https://github-redirect.dependabot.com/homebridge/homebridge/pull/3263">homebridge/homebridge#3263</a></li>
</ul>
<h2>New Contributors</h2>
<ul>
<li><a href="https://github.com/elyscape"><code>@​elyscape</code></a>
made their first contribution in <a
href="https://github-redirect.dependabot.com/homebridge/homebridge/pull/3260">homebridge/homebridge#3260</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/homebridge/homebridge/compare/v1.5.1...v1.6.0">https://github.com/homebridge/homebridge/compare/v1.5.1...v1.6.0</a></p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="d98b430f69"><code>d98b430</code></a>
1.6.0</li>
<li><a
href="87452ceb6f"><code>87452ce</code></a>
Switch to hap-nodejs v0.11.0 release channel</li>
<li><a
href="708c718d71"><code>708c718</code></a>
Update to provide compatibility with hap-nodejs 0.11.0 (<a
href="https://github-redirect.dependabot.com/homebridge/homebridge/issues/3263">#3263</a>)</li>
<li><a
href="3d281f4fd3"><code>3d281f4</code></a>
Workaround hap-nodejs beta issues</li>
<li><a
href="7b764798e4"><code>7b76479</code></a>
Bump hap-nodejs beta channel</li>
<li><a
href="4bcf8829bd"><code>4bcf882</code></a>
Support resolved mDNS advertiser (<a
href="https://github-redirect.dependabot.com/homebridge/homebridge/issues/3260">#3260</a>)</li>
<li><a
href="6c2f927b20"><code>6c2f927</code></a>
Upgrade to hap-nodejs 0.11.0 beta channel</li>
<li>See full diff in <a
href="https://github.com/homebridge/homebridge/compare/v1.5.1...v1.6.0">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=homebridge&package-manager=npm_and_yarn&previous-version=1.5.1&new-version=1.6.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Lars Strojny <lars@strojny.net>
2022-12-01 01:38:39 +01:00
Lars Strojny
19131ee9c3
Winter cleanup (#41)
Various small cleanups, code reorgs, etc.
2022-11-24 22:12:40 +01:00
Lars Strojny
8a0061428d
Move conditions to the top 2022-11-24 20:21:10 +01:00
Lars Strojny
f30dfe0cee
Use constant instead of magic number 2022-11-24 20:18:48 +01:00
Lars Strojny
e5b3a90fae
Use string concatenation instead 2022-11-24 19:59:03 +01:00
Lars Strojny
d25207923c
Fix symbol name conflict 2022-11-24 19:58:07 +01:00
Lars Strojny
f45df5d422
Clean up prefix handling 2022-11-24 19:53:03 +01:00
Lars Strojny
65304798de
Memoized renderering (#37)
Pre-render metrics on discovery once and then reuse rendered response.
2022-11-24 19:35:02 +01:00
Lars Strojny
565f423dd9
Extract stringReverse() function 2022-11-24 19:24:00 +01:00
Lars Strojny
7c7673f1c2
Fix code smells (#36)
Fix code smells detected by SonarCloud
2022-11-23 14:30:23 +01:00
dependabot[bot]
f70de293a5
Bump hap-nodejs from 0.10.4 to 0.11.0 (#31) 2022-11-18 13:11:43 +01:00
Lars Strojny
261fa74ac9
Add configuration option for the metric server interface (#25)
Add a configuration option `interface` to allow configuring where the
HTTP metric server should bind to.
2022-11-17 13:15:07 +01:00
Lars Strojny
ce8876793d
Fall back to IPv4 if EAFNOSUPPORT (#24)
If listening to `::` fails, try `0.0.0.0` instead. Addresses #22
2022-11-16 22:47:41 +01:00
Lars Strojny
f8007b55ca
Add experimental support for basic auth and TLS (#23)
Allows restricting access to the monitoring endpoint using basic auth
and configure TLS certificates.
2022-11-16 22:19:08 +01:00
Lars Strojny
479fbe5727 Refactor internal APIs 2022-11-14 01:20:53 +01:00
Lars Strojny
34be5bbca2 Implement consistent request logging 2022-11-13 13:34:33 +01:00
Lars Strojny
8102144b85 Explicit type imports 2022-11-13 13:34:09 +01:00
Lars Strojny
b74721ee76
Handle null values in characteristics (#20)
Apparently `characteristic.value` can also be null. Let’s handle it
properly. Fixes #19
2022-11-13 11:13:13 +01:00
Lars Strojny
52efa69bf0
Automate code generation for config schema (#16)
Use a fork of https://github.com/lstrojny/json-schema-to-zod to generate
the boundary check for the config automatically.
2022-11-10 13:06:16 +01:00
Lars Strojny
1088a78079
Strict type imports (#17)
When a symbols is only used as a type, require `import type {…}`
2022-11-10 13:00:45 +01:00
Lars Strojny
822f0da2eb
Set charset in metrics content type (#15)
Send `Content-Type: text/plain; charset=utf-8; version=0.0.4` instead of
`Content-Type: text/plain; version=0.0.4` so that special characters in
names have a chance to work.
2022-11-10 11:10:31 +01:00
Lars Strojny
f6bc8ca90c
Use code generation for UUID service map (#14)
Instead of introspecting *hap-nodejs* at runtime for UUID to service
mapping, generate the map during build time.
2022-11-10 11:07:31 +01:00
Lars Strojny
71e45a3d8c
More user-friendly (and developer-friendly) zod error reporting (#12)
Show each error message from zod and include an excerpt of the data
around the failing path if possible
2022-11-09 21:36:23 +01:00
Lars Strojny
2bd799ca9c
Integration tests for the fastify HTTP adapter (#11) 2022-11-09 19:08:24 +01:00
Lars Strojny
eead518f95
Gracefully handle unknown service UUIDs (#10) 2022-11-09 14:58:03 +01:00
Lars Strojny
72761ceee6
Support "tlv8" and "data" characteristic formats (#8) 2022-11-09 14:10:50 +01:00
Lars Strojny
e64b621336 Mention where the escape functions come from 2022-11-09 00:41:15 +01:00
Lars Strojny
2596c9f4ea Remove bundled hap-nodejs dependency 2022-11-08 23:58:46 +01:00
Lars Strojny
25b9afa1d2 Run tests via github actions 2022-11-08 22:59:00 +01:00
Lars Strojny
84761dfa93 Replace runtypes with zod, validate config, stricter eslint config 2022-11-08 19:13:34 +01:00
Lars Strojny
4a7d6ff6de Allow configuring the prefix 2022-11-08 14:43:49 +01:00
Lars Strojny
900f528b95 Rename port setting 2022-11-08 14:26:08 +01:00
Lars Strojny
78a8972bb0 Expose bools as metrics as well 2022-11-08 01:20:46 +01:00
Lars Strojny
f1b48575cb Use hap-nodejs instead 2022-11-07 23:43:44 +01:00
Lars Strojny
ba3786bf6d Fix linting issues 2022-11-07 23:02:24 +01:00
Lars Strojny
e338c982d2 Prometheus wants counter, not count 2022-11-07 22:41:52 +01:00
Lars Strojny
7fd1c5a03c Extract prometheus server 2022-11-07 22:31:17 +01:00
Lars Strojny
d0b9b6a36e Rename /probe to /metrics 2022-11-07 21:01:21 +01:00
Lars Strojny
ff7fd44f2c Extract rendering 2022-11-07 20:50:58 +01:00
Lars Strojny
4b4f8e8d0f Remove instance attribute 2022-11-07 19:32:38 +01:00
Lars Strojny
60be04925e Fix Promise issue 2022-11-07 19:30:55 +01:00
Lars Strojny
8e183b9fb7 Listen not only on localhost 2022-11-07 18:26:58 +01:00
Lars Strojny
00dd20559a Initial version 2022-11-07 15:23:48 +01:00
Lars Strojny
dd4a135022
Initial commit 2022-11-06 13:04:30 +01:00