homebridge-flume 3.0.3 → 3.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,11 @@
2
2
 
3
3
  All notable changes to homebridge-flume will be documented in this file.
4
4
 
5
+ ## 3.0.4 (2025-05-19)
6
+
7
+ - Updating README and other metadata to reflect new plugin ownership
8
+ - Getting plugin ready for Homebridge v2
9
+
5
10
  ## 3.0.3 (2024-07-23)
6
11
 
7
12
  - Maintenance release
package/LICENSE CHANGED
@@ -1,21 +1,176 @@
1
- MIT License
2
-
3
- Copyright (c) 2022 Darrin Thomas & Ben Potter
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
package/README.md CHANGED
@@ -1,54 +1,69 @@
1
1
  <p align="center">
2
- <a href="https://github.com/bwp91/homebridge-flume"><img src="https://user-images.githubusercontent.com/43026681/143831753-ed67cad2-909a-4337-9b18-dd8e65dfdf5e.png" width="600px"></a>
2
+ <img src="https://github.com/mpatfield/homebridge-flume/blob/latest/img/banner.png" width="600">
3
3
  </p>
4
+
4
5
  <span align="center">
5
6
 
6
7
  # homebridge-flume
7
8
 
8
- Homebridge plugin to integrate Flume devices into HomeKit
9
+ Homebridge plugin to integrate Flume devices into Apple HomeKit
9
10
 
10
11
  [![verified-by-homebridge](https://badgen.net/badge/homebridge/verified/purple)](https://github.com/homebridge/homebridge/wiki/Verified-Plugins)
11
- [![hoobs-certified](https://badgen.net/badge/HOOBS/certified/yellow)](https://plugins.hoobs.org/plugin/homebridge-thermobit)
12
- [![npm](https://img.shields.io/npm/v/homebridge-flume/latest?label=latest)](https://www.npmjs.com/package/homebridge-flume)
13
- [![npm](https://img.shields.io/npm/v/homebridge-flume/beta?label=beta)](https://github.com/bwp91/homebridge-flume/wiki/Beta-Version)
12
+ [![hoobs-certified](https://badgen.net/badge/HOOBS/certified/yellow)](https://plugins.hoobs.org/plugin/homebridge-flume)
14
13
  [![npm](https://img.shields.io/npm/dw/homebridge-flume)](https://www.npmjs.com/package/homebridge-flume)
15
- [![npm](https://img.shields.io/npm/dt/homebridge-flume)](https://www.npmjs.com/package/homebridge-flume)
16
- [![Discord](https://img.shields.io/discord/784827113378676736?color=728ED5&logo=discord&label=bwp91-discord)](https://discord.com/channels/784827113378676736/784827113378676739)
17
- [![Discord](https://img.shields.io/discord/432663330281226270?color=728ED5&logo=discord&label=hb-discord)](https://discord.com/channels/432663330281226270/742733745743855627)
14
+ [![npm](https://img.shields.io/npm/dt/homebridge-flume)](https://www.npmjs.com/package/homebridge-flume)
18
15
 
19
16
  </span>
20
17
 
21
- ### Plugin Information
18
+ ## Disclaimer
19
+
20
+ This plugin is independently developed and is not in any way affiliated with or endorsed by Flume. Any issues or damage resulting from use of this plugin are not the fault of the developer. Use at your own risk.
21
+
22
+ ## What does this plugin do?
23
+
24
+ Once you have completed [Configuration](https://github.com/mpatfield/homebridge-flume#configuration) you will see a new leak sensor pop up in your Home app. If the sensor detetcs a leak, you will receive a HomeKit notification and can setup automations to react to state changes.
25
+
26
+ <img src="https://github.com/mpatfield/homebridge-flume/blob/latest/img/screenshot_1.png"> <img src="https://github.com/mpatfield/homebridge-flume/blob/latest/img/screenshot_2.png">
27
+
28
+ If you use a more advanced HomeKit app like the Eve app, you will see some additional information about your water use.
29
+
30
+ <img src="https://github.com/mpatfield/homebridge-flume/blob/latest/img/screenshot_3.png">
31
+
32
+ Unfortunately, this is all the plugin is able to do. This is due to limitations in what HomeKit offers.
22
33
 
23
- - This plugin allows you to view and control your Flume devices within HomeKit.
34
+ ## Configuration
24
35
 
25
- ### Prerequisites
36
+ You'll need to get your API Access Client ID and Client Secret from the [Flume portal](https://portal.flumetech.com).
26
37
 
27
- - To use this plugin, you will need to already have:
28
- - [Homebridge](https://homebridge.io): v1.6 or [HOOBS](https://hoobs.org): v4.3 installed - refer to the links for more information and installation instructions.
29
- - Node: latest version of v18, v20 or v22 - any other major version is not supported.
38
+ [This guide](https://flumetech.readme.io/reference/accessing-the-api) provides step-by-step instructions.
30
39
 
31
- ### Setup
40
+ Using the Homebridge Config UI is the easiest way to set up this plugin. However, if you wish to do things manually then you will need to add the following to your Homebridge `config.json`:
32
41
 
33
- - [Installation](https://github.com/bwp91/homebridge-flume/wiki/Installation)
34
- - [Configuration](https://github.com/bwp91/homebridge-flume/wiki/Configuration)
35
- - [Beta Version](https://github.com/bwp91/homebridge-flume/wiki/Beta-Version)
36
- - [Node Version](https://github.com/bwp91/homebridge-flume/wiki/Node-Version)
42
+ ```json
43
+ {
44
+ "name": "Flume",
45
+ "platform": "Flume",
46
+ "username": "[username]",
47
+ "password": "[password]",
48
+ "clientId": "1234567890ABCD",
49
+ "clientSecret": "1234567890ABCDEFGHIJ",
50
+ "refreshInterval": 1,
51
+ "disableDeviceLogging": false,
52
+ }
53
+ ```
37
54
 
38
- ### Help/About
55
+ - `username` - (Required) Flume username
56
+ - `password` - (Required) Flume password
57
+ - `clientId`/`clientSecret` - (Required) Flume Client ID, found at [https://portal.flumetech.com](https://portal.flumetech.com)
58
+ - `refreshInterval` - (Optional) number of minutes between updates; must be `1` or more
59
+ - `disableDeviceLogging` - (Optional) if true then accessory status changes will not be logged
39
60
 
40
- - [Common Errors](https://github.com/bwp91/homebridge-flume/wiki/Common-Errors)
41
- - [Support Request](https://github.com/bwp91/homebridge-flume/issues/new/choose)
42
- - [Changelog](https://github.com/bwp91/homebridge-flume/blob/latest/CHANGELOG.md)
43
- - [About Me](https://github.com/sponsors/bwp91)
61
+ ## Credits
44
62
 
45
- ### Credits
63
+ @weallknowwhoisatfaulthere for earlier work done [homebridge-flume-water-sensor](https://www.npmjs.com/package/homebridge-flume-water-sensor)
46
64
 
47
- - This is a forked rewrite of the [homebridge-flume-water-sensor](https://www.npmjs.com/package/homebridge-flume-water-sensor) plugin by @weallknowwhoisatfaulthere.
48
- - To the creator of the awesome plugin header logo: [Keryan Belahcene](https://www.instagram.com/keryan.me).
49
- - To the creators/contributors of [Homebridge](https://homebridge.io) who make this plugin possible.
65
+ [@bwp91](https://github.com/sponsors/bwp91) for creating and maintaining this plugin for years despite not even owning a Flume device
50
66
 
51
- ### Disclaimer
67
+ [Keryan Belahcene](https://www.instagram.com/keryan.me) for creating the [Flume](https://github.com/homebridge-plugins/homebridge-flume) header logo
52
68
 
53
- - I am in no way affiliated with Flume and this plugin is a personal project that I maintain in my free time.
54
- - Use this plugin entirely at your own risk - please see licence for more information.
69
+ And to the amazing creators/contributors of [Homebridge](https://homebridge.io) who made this plugin possible!
@@ -4,7 +4,7 @@
4
4
  "singular": true,
5
5
  "customUi": true,
6
6
  "customUiPath": "./lib/homebridge-ui",
7
- "headerDisplay": "<p align=\"center\"><img width=\"60%\" src=\"https://user-images.githubusercontent.com/43026681/143831753-ed67cad2-909a-4337-9b18-dd8e65dfdf5e.png\"></p><p align=\"center\">For help and support please visit our <a href=\"https://github.com/bwp91/homebridge-thermobit/wiki\">GitHub Wiki</a>. We hope you find this plugin useful!</p>",
7
+ "headerDisplay": "<p align=\"center\"><img width=\"60%\" src=\"https://github.com/mpatfield/homebridge-flume/blob/latest/img/banner.png\"></p><p align=\"center\">For help and support please visit <a href=\"https://github.com/mpatfield/homebridge-flume/\">GitHub</a>. We hope you find this plugin useful!</p>",
8
8
  "schema": {
9
9
  "type": "object",
10
10
  "properties": {
@@ -29,15 +29,14 @@
29
29
  "title": "Client ID",
30
30
  "type": "string",
31
31
  "placeholder": "1234567890ABCD",
32
- "required": true,
33
- "description": "Your Flume Client ID, found at https://portal.flumetech.com."
32
+ "required": true
34
33
  },
35
34
  "clientSecret": {
36
35
  "title": "Client Secret",
37
36
  "type": "string",
38
37
  "placeholder": "1234567890ABCDEFGHIJ",
39
38
  "required": true,
40
- "description": "Your Flume Client Secret, found at https://portal.flumetech.com."
39
+ "description": "Your Flume Client ID and Client Secret can be found at https://portal.flumetech.com."
41
40
  },
42
41
  "disableDeviceLogging": {
43
42
  "type": "boolean",
@@ -0,0 +1,8 @@
1
+ /**
2
+ * This is the name of the platform that users will use to register the plugin in the Homebridge config.json
3
+ */
4
+ export declare const PLATFORM_NAME = "HomebridgeFlume";
5
+ /**
6
+ * This must match the name of your plugin as defined the package.json `name` property
7
+ */
8
+ export declare const PLUGIN_NAME = "homebridge-flume";
@@ -0,0 +1,9 @@
1
+ /**
2
+ * This is the name of the platform that users will use to register the plugin in the Homebridge config.json
3
+ */
4
+ export const PLATFORM_NAME = 'HomebridgeFlume';
5
+ /**
6
+ * This must match the name of your plugin as defined the package.json `name` property
7
+ */
8
+ export const PLUGIN_NAME = 'homebridge-flume';
9
+ //# sourceMappingURL=settings.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"settings.js","sourceRoot":"","sources":["../lib/settings.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,iBAAiB,CAAC;AAE/C;;GAEG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,kBAAkB,CAAC"}
@@ -0,0 +1,46 @@
1
+ import eslint from '@eslint/js';
2
+ import tseslint from 'typescript-eslint';
3
+
4
+ export default tseslint.config(
5
+ {
6
+ ignores: ['dist/**', '**/*.js'],
7
+ },
8
+ {
9
+ files: ['**/*.js'],
10
+ rules: {},
11
+ languageOptions: {},
12
+ linterOptions: {
13
+ noInlineConfig: false,
14
+ },
15
+ processor: null,
16
+ },
17
+ {
18
+ files: ['**/*.ts'],
19
+ rules: {
20
+ 'quotes': ['error', 'single'],
21
+ 'indent': ['error', 2, { 'SwitchCase': 0 }],
22
+ 'linebreak-style': ['error', 'unix'],
23
+ 'semi': ['error', 'always'],
24
+ 'comma-dangle': ['error', 'always-multiline'],
25
+ 'dot-notation': 'error',
26
+ 'eqeqeq': ['error', 'smart'],
27
+ 'curly': ['error', 'all'],
28
+ 'brace-style': ['error'],
29
+ 'prefer-arrow-callback': 'warn',
30
+ 'max-len': ['warn', 160],
31
+ 'object-curly-spacing': ['error', 'always'],
32
+ 'no-use-before-define': 'off',
33
+ '@typescript-eslint/no-use-before-define': ['error', { 'classes': false, 'enums': false }],
34
+ '@typescript-eslint/no-unused-vars': ['error', { 'caughtErrors': 'none' }],
35
+ },
36
+ },
37
+ {
38
+ files: ['**/*.ts'],
39
+ languageOptions: {
40
+ ecmaVersion: 2022,
41
+ sourceType: 'module',
42
+ },
43
+ },
44
+ eslint.configs.recommended,
45
+ ...tseslint.configs.recommended,
46
+ );
package/img/banner.png ADDED
Binary file
Binary file
Binary file
Binary file
@@ -24,75 +24,7 @@
24
24
  </div>
25
25
  <div id="pageSupport" class="mt-4" style="display: none;">
26
26
  <p class="text-center lead">Thank you for using <strong>homebridge-flume</strong></p>
27
- <p class="text-center">The links below will take you to our GitHub wiki</p>
28
- <h4>Setup</h4>
29
- <ul>
30
- <li>
31
- <a href="https://github.com/bwp91/homebridge-flume/wiki/Installation" target="_blank"
32
- >Installation</a
33
- >
34
- </li>
35
- <li>
36
- <a href="https://github.com/bwp91/homebridge-flume/wiki/Configuration" target="_blank"
37
- >Configuration</a
38
- >
39
- </li>
40
- <li>
41
- <a href="https://github.com/bwp91/homebridge-flume/wiki/Beta-Version" target="_blank"
42
- >Beta Version</a
43
- >
44
- </li>
45
- <li>
46
- <a href="https://github.com/bwp91/homebridge-flume/wiki/Node-Version" target="_blank"
47
- >Node Version</a
48
- >
49
- </li>
50
- </ul>
51
- <h4>Help/About</h4>
52
- <ul>
53
- <li>
54
- <a href="https://github.com/bwp91/homebridge-flume/wiki/Common-Errors" target="_blank"
55
- >Common Errors</a
56
- >
57
- </li>
58
- <li>
59
- <a href="https://github.com/bwp91/homebridge-flume/issues/new/choose" target="_blank"
60
- >Support Request</a
61
- >
62
- </li>
63
- <li>
64
- <a href="https://github.com/bwp91/homebridge-flume/blob/latest/CHANGELOG.md" target="_blank"
65
- >Changelog</a
66
- >
67
- </li>
68
- <li><a href="https://github.com/sponsors/bwp91" target="_blank">About Me</a></li>
69
- </ul>
70
- <h4>Credits</h4>
71
- <ul>
72
- <li>
73
- This is a forked rewrite of the
74
- <a href="https://www.npmjs.com/package/homebridge-flume-water-sensor" target="_blank"
75
- >homebridge-flume-water-sensor</a
76
- >
77
- plugin by @weallknowwhoisatfaulthere
78
- </li>
79
- <li>
80
- To the creator of the awesome plugin header logo:
81
- <a href="https://www.instagram.com/keryan.me" target="_blank">Keryan Belahcene</a>.
82
- </li>
83
- <li>
84
- To the creators/contributors of
85
- <a href="https://homebridge.io" target="_blank">Homebridge</a> who make this plugin possible.
86
- </li>
87
- </ul>
88
- <h4>Disclaimer</h4>
89
- <ul>
90
- <li>
91
- I am in no way affiliated with Flume and this plugin is a personal project that I maintain in
92
- my free time.
93
- </li>
94
- <li>Use this plugin entirely at your own risk - please see licence for more information.</li>
95
- </ul>
27
+ <p class="text-center">Please visit <a href="https://github.com/mpatfield/homebridge-flume/blob/latest/README.md" target="_blank">GitHub</a> for support.</p>
96
28
  </div>
97
29
  <script>
98
30
  ;(async () => {
@@ -0,0 +1,9 @@
1
+ /**
2
+ * This is the name of the platform that users will use to register the plugin in the Homebridge config.json
3
+ */
4
+ export const PLATFORM_NAME = 'HomebridgeFlume';
5
+
6
+ /**
7
+ * This must match the name of your plugin as defined the package.json `name` property
8
+ */
9
+ export const PLUGIN_NAME = 'homebridge-flume';
@@ -9,39 +9,47 @@ export default class {
9
9
  monthUsage: 'E966F002-079E-48FF-8F27-9C2605A29F52',
10
10
  prevMonthUsage: 'E966F003-079E-48FF-8F27-9C2605A29F52',
11
11
  };
12
- const self = this;
13
- this.TodayUsage = function TodayUsage() {
14
- self.hapChar.call(this, 'Today Usage', self.uuids.todayUsage);
15
- this.setProps({
16
- format: api.hap.Formats.UINT32,
17
- perms: [api.hap.Perms.READ, api.hap.Perms.NOTIFY],
18
- unit: 'Gallons',
19
- });
20
- this.value = this.getDefaultValue();
12
+
13
+ const hapChar = this.hapChar;
14
+ const uuids = this.uuids;
15
+
16
+ this.TodayUsage = class TodayUsage extends hapChar {
17
+ constructor() {
18
+ super('Today Usage', uuids.todayUsage);
19
+ this.setProps({
20
+ format: api.hap.Formats.UINT32,
21
+ perms: [api.hap.Perms.READ, api.hap.Perms.NOTIFY],
22
+ unit: 'Gallons',
23
+ });
24
+ this.value = this.getDefaultValue();
25
+ }
21
26
  };
22
- this.MonthUsage = function MonthUsage() {
23
- self.hapChar.call(this, 'Month Usage', self.uuids.monthUsage);
24
- this.setProps({
25
- format: api.hap.Formats.UINT32,
26
- perms: [api.hap.Perms.READ, api.hap.Perms.NOTIFY],
27
- unit: 'Gallons',
28
- });
29
- this.value = this.getDefaultValue();
27
+ this.TodayUsage.UUID = uuids.todayUsage;
28
+
29
+ this.MonthUsage = class MonthUsage extends hapChar {
30
+ constructor() {
31
+ super('Month Usage', uuids.monthUsage);
32
+ this.setProps({
33
+ format: api.hap.Formats.UINT32,
34
+ perms: [api.hap.Perms.READ, api.hap.Perms.NOTIFY],
35
+ unit: 'Gallons',
36
+ });
37
+ this.value = this.getDefaultValue();
38
+ }
30
39
  };
31
- this.PrevMonthUsage = function PrevMonthUsage() {
32
- self.hapChar.call(this, 'Previous Month', self.uuids.prevMonthUsage);
33
- this.setProps({
34
- format: api.hap.Formats.UINT32,
35
- perms: [api.hap.Perms.READ, api.hap.Perms.NOTIFY],
36
- unit: 'Gallons',
37
- });
38
- this.value = this.getDefaultValue();
40
+ this.MonthUsage.UUID = uuids.monthUsage;
41
+
42
+ this.PrevMonthUsage = class PrevMonthUsage extends hapChar {
43
+ constructor() {
44
+ super('Previous Month', uuids.prevMonthUsage);
45
+ this.setProps({
46
+ format: api.hap.Formats.UINT32,
47
+ perms: [api.hap.Perms.READ, api.hap.Perms.NOTIFY],
48
+ unit: 'Gallons',
49
+ });
50
+ this.value = this.getDefaultValue();
51
+ }
39
52
  };
40
- inherits(this.TodayUsage, this.hapChar);
41
- inherits(this.MonthUsage, this.hapChar);
42
- inherits(this.PrevMonthUsage, this.hapChar);
43
- this.TodayUsage.UUID = this.uuids.todayUsage;
44
- this.MonthUsage.UUID = this.uuids.monthUsage;
45
- this.PrevMonthUsage.UUID = this.uuids.prevMonthUsage;
53
+ this.PrevMonthUsage.UUID = uuids.prevMonthUsage;
46
54
  }
47
55
  }
@@ -34,16 +34,10 @@ export default {
34
34
  syncFailed: 'Sync process failed as',
35
35
  updateFail: 'could not be updated as',
36
36
  zWelcome: [
37
- 'Don\'t forget to ☆ this plugin on GitHub if you\'re finding it useful!',
38
- 'Have a feature request? Visit https://bit.ly/hb-flume-issues to ask!',
39
- 'Interested in sponsoring this plugin? https://github.com/sponsors/bwp91',
40
- 'Join the plugin\'s Discord community! https://discord.gg/cMGhNtZ3tW',
41
- 'Thanks for using this plugin, I hope you find it helpful!',
42
- 'This plugin has been made with ♥ by bwp91 from the UK!',
43
- 'Check out my other Homebridge plugins! https://github.com/bwp91',
44
- 'Have time to give this plugin a review? https://bit.ly/hb-flume-review',
37
+ 'Please ☆ this plugin on GitHub if you\'re finding it useful!',
38
+ 'Interested in sponsoring this plugin? https://github.com/sponsors/mpatfield',
39
+ 'Check out my other Homebridge plugins! https://github.com/mpatfield',
45
40
  'This plugin currently has a 4☆ rating on HOOBS! https://bit.ly/hb-flume-review',
46
41
  'Want to see this plugin in your own language? Let me know!',
47
- 'Want to beta test Homebridge 2.0? https://github.com/homebridge/homebridge/wiki/Homebridge-Beta-Testing',
48
42
  ],
49
43
  };
package/package.json CHANGED
@@ -1,12 +1,15 @@
1
1
  {
2
2
  "name": "homebridge-flume",
3
3
  "alias": "Flume",
4
- "version": "3.0.3",
4
+ "version": "3.0.4",
5
5
  "author": {
6
- "name": "Ben Potter",
7
- "email": "bwp91@icloud.com"
6
+ "name": "mpatfield"
8
7
  },
9
8
  "description": "Homebridge plugin to integrate Flume devices into HomeKit.",
9
+ "homebridge": {
10
+ "platform": "HomebridgeFlume",
11
+ "name": "homebridge-flume"
12
+ },
10
13
  "type": "module",
11
14
  "main": "lib/index.js",
12
15
  "keywords": [
@@ -16,56 +19,48 @@
16
19
  "hoobs",
17
20
  "hoobs-plugin",
18
21
  "homekit",
19
- "siri",
20
22
  "flume",
21
- "water sensor",
22
- "water monitor",
23
+ "siri",
23
24
  "leak detector",
24
- "water leak detector"
25
+ "water leak detector",
26
+ "water monitor",
27
+ "water sensor"
25
28
  ],
26
29
  "scripts": {
27
- "lint": "eslint . --fix",
30
+ "build": "rimraf ./dist && tsc",
31
+ "lint": "eslint . --max-warnings=0",
32
+ "prepublishOnly": "npm run lint && npm run build",
28
33
  "rebuild": "rm -rf package-lock.json && rm -rf node_modules && npm install"
29
34
  },
30
35
  "engines": {
31
- "homebridge": "^1.6.0 || 2.0.0",
32
- "node": "^18.20.4 || ^20.15.1 || ^22.5.1"
36
+ "homebridge": "^1.8.0 || ^2.0.0-beta.0",
37
+ "node": "^18.20.4 || ^20.15.1 || ^22"
33
38
  },
34
39
  "repository": {
35
40
  "type": "git",
36
- "url": "git+https://github.com/bwp91/homebridge-flume.git"
41
+ "url": "git+https://github.com/mpatfield/homebridge-flume.git"
37
42
  },
38
43
  "bugs": {
39
- "url": "https://github.com/bwp91/homebridge-flume/issues"
44
+ "url": "https://github.com/mpatfield/homebridge-flume/issues"
45
+ },
46
+ "funding": {
47
+ "type": "github",
48
+ "url": "https://github.com/sponsors/mpatfield"
40
49
  },
41
- "funding": [
42
- {
43
- "type": "github",
44
- "url": "https://github.com/sponsors/bwp91"
45
- },
46
- {
47
- "type": "kofi",
48
- "url": "https://ko-fi.com/bwp91"
49
- },
50
- {
51
- "type": "patreon",
52
- "url": "https://www.patreon.com/bwp91"
53
- },
54
- {
55
- "type": "paypal",
56
- "url": "https://www.paypal.me/BenPotter"
57
- }
58
- ],
59
50
  "dependencies": {
60
- "@homebridge/plugin-ui-utils": "^1.0.3",
51
+ "@homebridge/plugin-ui-utils": "^2.0.2",
61
52
  "axios": "^1.7.2",
53
+ "homebridge-lib": "^7.1.4",
62
54
  "jwt-decode": "^4.0.0"
63
55
  },
64
56
  "devDependencies": {
65
- "eslint": "^8.57.0",
66
- "eslint-config-airbnb-base": "^15.0.0",
67
- "eslint-plugin-import": "^2.29.1",
68
- "eslint-plugin-import-newlines": "^1.4.0",
69
- "eslint-plugin-sort-exports": "^0.9.1"
70
- }
57
+ "@eslint/js": "^9.21.0",
58
+ "@types/node": "^22.15.18",
59
+ "eslint": "^9.27.0",
60
+ "homebridge": "^2.0.0-beta.0",
61
+ "rimraf": "^6.0.1",
62
+ "typescript": "^5.8.3",
63
+ "typescript-eslint": "^8.24.1"
64
+ },
65
+ "license": "Apache-2.0"
71
66
  }
package/tsconfig.json ADDED
@@ -0,0 +1,25 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "ES2022",
4
+ "lib": [
5
+ "DOM",
6
+ "ES2022"
7
+ ],
8
+ "rootDir": "lib",
9
+ "module": "ES2022",
10
+ "moduleResolution": "node",
11
+ "strict": true,
12
+ "declaration": true,
13
+ "outDir": "dist",
14
+ "sourceMap": true,
15
+ "allowSyntheticDefaultImports": true,
16
+ "esModuleInterop": true,
17
+ "forceConsistentCasingInFileNames": true,
18
+ "resolveJsonModule": true
19
+ },
20
+ "include": [
21
+ "eslint.config.js",
22
+ "homebridge-ui",
23
+ "lib"
24
+ ]
25
+ }
package/.eslintrc.cjs DELETED
@@ -1,26 +0,0 @@
1
- module.exports = {
2
- env: {
3
- es2022: true,
4
- node: true,
5
- },
6
- extends: ['airbnb-base'],
7
- parserOptions: {
8
- ecmaVersion: 13,
9
- sourceType: 'module',
10
- },
11
- plugins: ['import', 'import-newlines', 'sort-exports'],
12
- rules: {
13
- camelcase: 'off',
14
- 'import/extensions': ['error', { js: 'always', json: 'always' }],
15
- 'import/order': ['warn', { alphabetize: { order: 'asc' } }],
16
- 'import-newlines/enforce': ['error', 3],
17
- indent: ['error', 2, { SwitchCase: 1 }],
18
- 'max-len': 'off',
19
- 'new-cap': 0,
20
- quotes: ['error', 'single'],
21
- 'no-multiple-empty-lines': ['error', { max: 1, maxBOF: 1, maxEOF: 0 }],
22
- 'no-param-reassign': 0,
23
- 'sort-exports/sort-exports': ['warn', { sortDir: 'asc' }],
24
- 'sort-imports': ['warn', { ignoreDeclarationSort: true }],
25
- },
26
- };