homebridge-blueair-plugin 1.1.0
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/.eslintignore +3 -0
- package/.gitattributes +3 -0
- package/CHANGELOG.md +12 -0
- package/LICENSE +176 -0
- package/README.md +99 -0
- package/branding/Blueair.png +0 -0
- package/branding/Homebridge_x_Blueair.svg +82 -0
- package/dist/accessory.d.ts +111 -0
- package/dist/accessory.d.ts.map +1 -0
- package/dist/accessory.js +821 -0
- package/dist/accessory.js.map +1 -0
- package/dist/api/BlueAirAwsApi.d.ts +79 -0
- package/dist/api/BlueAirAwsApi.d.ts.map +1 -0
- package/dist/api/BlueAirAwsApi.js +216 -0
- package/dist/api/BlueAirAwsApi.js.map +1 -0
- package/dist/api/Consts.d.ts +36 -0
- package/dist/api/Consts.d.ts.map +1 -0
- package/dist/api/Consts.js +52 -0
- package/dist/api/Consts.js.map +1 -0
- package/dist/api/GigyaApi.d.ts +19 -0
- package/dist/api/GigyaApi.d.ts.map +1 -0
- package/dist/api/GigyaApi.js +79 -0
- package/dist/api/GigyaApi.js.map +1 -0
- package/dist/constants.d.ts +40 -0
- package/dist/constants.d.ts.map +1 -0
- package/dist/constants.js +146 -0
- package/dist/constants.js.map +1 -0
- package/dist/device.d.ts +49 -0
- package/dist/device.d.ts.map +1 -0
- package/dist/device.js +136 -0
- package/dist/device.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +11 -0
- package/dist/index.js.map +1 -0
- package/dist/platform.d.ts +35 -0
- package/dist/platform.d.ts.map +1 -0
- package/dist/platform.js +277 -0
- package/dist/platform.js.map +1 -0
- package/dist/utils.d.ts +96 -0
- package/dist/utils.d.ts.map +1 -0
- package/dist/utils.js +98 -0
- package/dist/utils.js.map +1 -0
- package/package.json +54 -0
package/.eslintignore
ADDED
package/.gitattributes
ADDED
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
# v1.1.0
|
|
4
|
+
## 2026-01-07
|
|
5
|
+
- fix: correct handling of state/sensor updates, so the states of the accessory in the Home app refreshes correctly
|
|
6
|
+
- fix: correct mutex usage
|
|
7
|
+
- fix: supports Node.js v24 (fixes #26)
|
|
8
|
+
- chore: outdated dependencies
|
|
9
|
+
|
|
10
|
+
# v1.0.11
|
|
11
|
+
## 2024-07-21
|
|
12
|
+
- fix: added Canada to the custom UI
|
package/LICENSE
ADDED
|
@@ -0,0 +1,176 @@
|
|
|
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
ADDED
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
<p align="center">
|
|
2
|
+
<a href="https://github.com/homebridge/verified/blob/master/verified-plugins.json"><img alt="Homebridge Verified" src="./branding/Homebridge_x_Blueair.svg" width="500px"></a>
|
|
3
|
+
</p>
|
|
4
|
+
|
|
5
|
+
# homebridge-blueair-plugin
|
|
6
|
+
|
|
7
|
+
## Installation
|
|
8
|
+
|
|
9
|
+
**Option 1: Install via Homebridge Config UI X:**
|
|
10
|
+
|
|
11
|
+
Search for "Blueair Purifier" in in [homebridge-config-ui-x](https://github.com/oznu/homebridge-config-ui-x) and install `homebridge-blueair-purifier`.
|
|
12
|
+
|
|
13
|
+
**Option 2: Manually Install:**
|
|
14
|
+
|
|
15
|
+
```text
|
|
16
|
+
sudo npm install -g homebridge-blueair-purifier
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
### Features
|
|
20
|
+
|
|
21
|
+
This plugin only supports WiFi connected BlueAir purifiers utilizing cloud connectivity (via AWS) for device communication. Below is a list of known tested products.
|
|
22
|
+
|
|
23
|
+
- **Simple Login Mechanism** - all you need is your username and password to get started.
|
|
24
|
+
- **Semi-automatic detection and configuration of multiple BlueAir devices.**
|
|
25
|
+
- **Fast response times** - the plugin uses the BlueAir API to communicate with the devices.
|
|
26
|
+
- **Intelligent device detection** - automatically detects device type and capabilities from API responses.
|
|
27
|
+
- **Expandable sensor support** - supports PM 1/2.5/10, Temperature, Humidity, VOC, HCHO, CO₂, NO₂, and Ozone sensors (when available on device).
|
|
28
|
+
|
|
29
|
+
>[!NOTE]
|
|
30
|
+
>**Air quality readings** - the plugin may not always report the correct air quality readings (like PM 2.5) due to the BlueAir API limitations. The solution for this issue is in progress.
|
|
31
|
+
>
|
|
32
|
+
>**Advanced sensors** - CO₂, NO₂, and Ozone sensors are now mapped and will be reported when available from your device, pending Homebridge characteristic support.
|
|
33
|
+
|
|
34
|
+
## Plugin Configuration
|
|
35
|
+
|
|
36
|
+
### Feature Toggles
|
|
37
|
+
* Show LED service as a lightbulb
|
|
38
|
+
* Show Air Quality Sensor service
|
|
39
|
+
* Show Temperature Sensor service
|
|
40
|
+
* Show Germ Shield switch service
|
|
41
|
+
* Show Night Mode switch service
|
|
42
|
+
|
|
43
|
+
### Customizable Options
|
|
44
|
+
* Adjustable Filter Change Level
|
|
45
|
+
* Device Name
|
|
46
|
+
* Verbose Logging
|
|
47
|
+
* BlueAir Server Region Selection
|
|
48
|
+
|
|
49
|
+
### Sensor Support
|
|
50
|
+
|
|
51
|
+
The plugin supports the following sensors when available on your device:
|
|
52
|
+
|
|
53
|
+
| Sensor Type | Code | Description |
|
|
54
|
+
|-------------|------|-------------|
|
|
55
|
+
| PM 1.0 | `pm1` | Particulate Matter 1 micron |
|
|
56
|
+
| PM 2.5 | `pm2_5` | Particulate Matter 2.5 microns |
|
|
57
|
+
| PM 10 | `pm10` | Particulate Matter 10 microns |
|
|
58
|
+
| Temperature | `t` | Ambient temperature |
|
|
59
|
+
| Humidity | `h` | Relative humidity |
|
|
60
|
+
| VOC | `tVOC` | Volatile Organic Compounds |
|
|
61
|
+
| Formaldehyde | `hcho` | HCHO concentration |
|
|
62
|
+
| Carbon Dioxide | `co2` | CO₂ levels |
|
|
63
|
+
| Nitrogen Dioxide | `no2` | NO₂ levels |
|
|
64
|
+
| Ozone | `o3` | Ozone concentration |
|
|
65
|
+
| Nitrogen Oxides | `nox` | NOx density |
|
|
66
|
+
|
|
67
|
+
### Device Detection
|
|
68
|
+
|
|
69
|
+
The plugin automatically detects device capabilities based on:
|
|
70
|
+
1. **API Device Type** - When the BlueAir API provides device type information
|
|
71
|
+
2. **Model Name** - Pattern matching against known device models
|
|
72
|
+
3. **Fallback Defaults** - Safe defaults for unknown devices
|
|
73
|
+
|
|
74
|
+
This allows the plugin to intelligently enable/disable features based on what your specific device supports.
|
|
75
|
+
|
|
76
|
+
## Extending the Plugin
|
|
77
|
+
|
|
78
|
+
### Adding Support for New Sensors
|
|
79
|
+
|
|
80
|
+
New sensor types can be added to the plugin by:
|
|
81
|
+
|
|
82
|
+
1. Updating the sensor map in `src/api/BlueAirAwsApi.ts`
|
|
83
|
+
2. Adding the sensor to the `BlueAirDeviceSensorData` type
|
|
84
|
+
3. Creating appropriate Homebridge characteristics (if new sensor type)
|
|
85
|
+
|
|
86
|
+
## Credits
|
|
87
|
+
|
|
88
|
+
This plugin is based on the original work by [@kovapatrik](https://github.com/kovapatrik). Special thanks to him for creating and maintaining the homebridge-blueair-purifier plugin.
|
|
89
|
+
|
|
90
|
+
If you'd like to support kovapatrik's work:
|
|
91
|
+
- [GitHub](https://github.com/kovapatrik)
|
|
92
|
+
- [Buy Me a Coffee](https://www.buymeacoffee.com/kovapatrik)
|
|
93
|
+
|
|
94
|
+
Original inspiration from the work of [@fsj21](https://github.com/fjs21) on the Amazon Web Services (AWS) API and construction of the documentation.
|
|
95
|
+
|
|
96
|
+
### Trademarks
|
|
97
|
+
|
|
98
|
+
Apple and HomeKit are registered trademarks of Apple Inc.
|
|
99
|
+
BlueAir is a trademark of Unilever Corporation
|
|
Binary file
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
|
2
|
+
<!-- Generator: Adobe Illustrator 27.6.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
|
3
|
+
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
|
4
|
+
viewBox="0 0 1800 630" style="enable-background:new 0 0 1800 630;" xml:space="preserve">
|
|
5
|
+
<style type="text/css">
|
|
6
|
+
.st0{fill:#0C2F4F;}
|
|
7
|
+
.st1{fill:#9596AE;}
|
|
8
|
+
.st2{fill:url(#SVGID_1_);}
|
|
9
|
+
.st3{fill:url(#SVGID_00000070101692078192461080000003741069921744300967_);}
|
|
10
|
+
.st4{fill:#FFFFFF;}
|
|
11
|
+
.st5{fill:none;stroke:#9596AE;stroke-width:5;stroke-linecap:round;stroke-miterlimit:10;}
|
|
12
|
+
</style>
|
|
13
|
+
<g>
|
|
14
|
+
<g id="Plugin_Logo_00000143588722170484654090000001453365823179829675_">
|
|
15
|
+
<path class="st0" d="M1292.5,283.5h15.8l-13.7,63.8h-15.4l13.3-63.1V283.5z M1589.6,298.5h-5.3c-9.1,0-14,2.8-21.4,10.5l2.1-9.5
|
|
16
|
+
h-15.1l-10.5,47.3h15.8l4.6-20.3c1.8-9.5,8.1-14.7,18.6-14.7c2.8,0,5.6,0.7,8.4,1.4l3.2-14.7H1589.6z M1275.3,299.6
|
|
17
|
+
c-1.4,6-5.6,10.5-11.2,12.6c7,1.8,9.5,8.8,8.1,15.8c-2.1,8.1-8.1,18.6-27.3,18.6h-45.2l13.7-63.1h47.3c9.5,0,17.2,4.2,14.7,15.8
|
|
18
|
+
V299.6z M1246.3,319.9h-23.5l-3.5,15.1h25.6c4.6,0,8.1-3.2,8.8-7.4c1.4-4.9-1.4-7.7-7-7.7H1246.3z M1249.8,295.4H1228l-3.2,13.3
|
|
19
|
+
h24.2c3.9,0,7.4-2.5,7.7-6.7c1.1-3.9,0-7-7-7L1249.8,295.4z M1149.5,276.5c-21.3,0-38.5,17.3-38.5,38.5s17.3,38.5,38.5,38.5
|
|
20
|
+
s38.5-17.3,38.5-38.5S1170.8,276.5,1149.5,276.5z M1438.3,325.9v1.4h-45.6c-1.4,4.9,1.8,11.9,12.3,11.9c5.6,0,10.9-2.1,14.4-6.3
|
|
21
|
+
h16.8c-7,11.2-18.9,15.8-32.9,15.8c-19.3,0-29.8-7.4-26.3-25.6c3.9-17.5,18.2-25.2,36.8-25.2
|
|
22
|
+
C1434.8,297.8,1442.1,308.3,1438.3,325.9z M1424.3,318.5c0-2.8-1.4-10.5-13-10.5c-7.2-0.3-13.9,3.9-16.8,10.5h29.4H1424.3z
|
|
23
|
+
M1507,314.3l-4.9,23.5c-0.7,3.5-1.1,6.7,0,9.8h-15.8v-5.3c-6.7,5.3-16.8,7-23.8,7c-12.3,0-20.3-4.2-17.5-15.4
|
|
24
|
+
c2.8-11.2,13-14,22.4-14.7l16.8-1.1c4.9-0.4,6.7-1.4,7.4-5.3c0.7-3.9-1.8-5.6-10.9-5.6c-7,0-10.5,0.4-14,7h-15.1
|
|
25
|
+
c4.9-14.7,18.6-16.1,31.5-16.1C1505.6,298.2,1509.1,305.2,1507,314.3z M1489.8,324.5c-3.2,1.1-6.3,1.8-9.5,1.8l-9.5,1.1
|
|
26
|
+
c-5.6,0-8.4,1.8-9.5,6c-1.1,4.2,2.5,7,8.4,7c8.1,0,17.5-4.2,19.3-11.9C1489.1,328.3,1489.8,324.5,1489.8,324.5z M1352.1,323.4
|
|
27
|
+
c-1.1,8.1-8.1,14-16.1,13.7c-7,0-9.8-3.5-8.4-9.8l5.6-27.7h-15.4l-7,32.2c-3.2,14,8.8,16.8,16.8,16.8c7.7,0,15.1-2.8,21-8.1
|
|
28
|
+
l-1.4,6.3h15.1l10.2-47.3h-15.8C1356.6,299.6,1352.1,323.4,1352.1,323.4z M1511.9,347.2h15.8l10.2-47.3H1522l-10.2,46.6V347.2z
|
|
29
|
+
M1525.9,283.5l-2.1,9.8h15.4l2.1-9.8C1541.3,283.5,1525.9,283.5,1525.9,283.5z"/>
|
|
30
|
+
</g>
|
|
31
|
+
<g id="Homebridge">
|
|
32
|
+
<g id="Text">
|
|
33
|
+
<path class="st1" d="M136.2,471.8h29v-31.1H178v75.9h-12.7v-33.8h-29v33.8h-12.8v-75.9h12.8v31.1H136.2z"/>
|
|
34
|
+
<path class="st1" d="M222.8,517.6c-16.9,0-28.4-10.2-28.4-34.1v-9.7c0-23.9,11.4-34.1,28.4-34.1s28.5,10.2,28.5,34.1v9.7
|
|
35
|
+
C251.3,507.3,239.9,517.6,222.8,517.6z M207.2,483.5c0,16.4,5.5,23,15.6,23s15.7-6.6,15.7-23v-9.7c0-16.4-5.6-23-15.7-23
|
|
36
|
+
s-15.6,6.6-15.6,23V483.5z"/>
|
|
37
|
+
<path class="st1" d="M301.7,484.7l21.9-44h12.2v75.9h-12.3v-50.8L306.1,502h-9L280,466.1v50.5h-12.3v-75.9h12.1L301.7,484.7z"/>
|
|
38
|
+
<path class="st1" d="M401.8,440.7v11.1H368v20h30.5v11H368v22.8h33.8v11h-46.5v-75.9L401.8,440.7z"/>
|
|
39
|
+
<path class="st1" d="M441,440.7c17.8,0,27,6.6,27,19.7c0.2,7.3-4.3,13.9-11.1,16.5c8.6,2.4,13.5,8.4,13.5,17.9
|
|
40
|
+
c0,11.4-7.3,21.8-27,21.8h-26.8v-75.9L441,440.7L441,440.7z M429.3,471.7h12.4c9.5,0,13.4-4.3,13.4-10.6c0-5.9-3-9.5-15.1-9.5
|
|
41
|
+
h-10.7L429.3,471.7z M429.3,505.5h13.3c10.2,0,15-4.2,15-11.4c0-8-5.3-11.4-16.5-11.4h-11.8V505.5z"/>
|
|
42
|
+
<path class="st1" d="M527.7,516.6l-14.6-30.8h-14.7v30.8h-12.8v-75.9h25.9c17.5,0,27.9,7.6,27.9,22.7c0,10.5-5,17.2-13.8,20.4
|
|
43
|
+
l16.2,32.9h-14.1V516.6z M510.6,474.8c10.8,0,16.1-2.9,16.1-11.4s-5.3-11.5-16.1-11.5h-12.2v23L510.6,474.8z"/>
|
|
44
|
+
<path class="st1" d="M569.4,516.6h-12.8v-75.9h12.8V516.6z"/>
|
|
45
|
+
<path class="st1" d="M589.9,516.6v-75.9h25.6c17,0,28.5,9.1,28.5,33.4v9c0,24.3-11.4,33.4-28.5,33.4L589.9,516.6z M631.2,483.1
|
|
46
|
+
v-9c0-15.6-4.8-22.3-15.7-22.3h-12.9v53.8h12.9C626.4,505.6,631.2,498.7,631.2,483.1z"/>
|
|
47
|
+
<path class="st1" d="M713.6,477.6v5.8c0,23.9-10.9,34.1-27.9,34.1s-28.4-10.2-28.4-34.1v-9.1c0-24.4,11.4-34.6,28.4-34.6
|
|
48
|
+
c15.4,0,25.2,8.6,27.6,24.5H701c-1.9-8.8-6.7-13.4-15.3-13.4c-10.1,0-15.6,6.6-15.6,23v9.7c0,16.4,5.5,23,15.6,23
|
|
49
|
+
c9.7,0,14.5-5.7,15.4-17.7H686v-11.1L713.6,477.6L713.6,477.6z"/>
|
|
50
|
+
<path class="st1" d="M776.5,440.7v11.1h-33.8v20h30.5v11h-30.5v22.8h33.8v11H730v-75.9L776.5,440.7z"/>
|
|
51
|
+
</g>
|
|
52
|
+
<g id="Logo">
|
|
53
|
+
|
|
54
|
+
<linearGradient id="SVGID_1_" gradientUnits="userSpaceOnUse" x1="450" y1="532.5001" x2="450" y2="832.5001" gradientTransform="matrix(1 0 0 1 0 -446.0001)">
|
|
55
|
+
<stop offset="0" style="stop-color:#57277C"/>
|
|
56
|
+
<stop offset="1" style="stop-color:#491F59"/>
|
|
57
|
+
</linearGradient>
|
|
58
|
+
<circle class="st2" cx="450" cy="236.5" r="150"/>
|
|
59
|
+
|
|
60
|
+
<radialGradient id="SVGID_00000183220377242521611990000013811618075543456901_" cx="450" cy="682.5001" r="150" gradientTransform="matrix(1 0 0 1 0 -446.0001)" gradientUnits="userSpaceOnUse">
|
|
61
|
+
<stop offset="0" style="stop-color:#000000;stop-opacity:0"/>
|
|
62
|
+
<stop offset="1" style="stop-color:#000000;stop-opacity:0.1"/>
|
|
63
|
+
</radialGradient>
|
|
64
|
+
<circle style="fill:url(#SVGID_00000183220377242521611990000013811618075543456901_);" cx="450" cy="236.5" r="150"/>
|
|
65
|
+
<path class="st4" d="M551.7,221.2h-0.2l-18.3-18.3c-0.6-0.7-1-1.6-1-2.5v-42.3c0-9-7.3-16.2-16.2-16.2h-11.5
|
|
66
|
+
c-9,0-16.2,7.3-16.2,16.2v0.2l-27.1-26.2c-6.4-6.1-16.5-6-22.8,0.2L346.8,224c-6.3,6.3-6.3,16.6,0,22.9l0,0l0,0l8.7,8.7
|
|
67
|
+
c6.3,6.3,16.5,6.3,22.9,0.1l70.5-69.4c1.4-1.4,3.6-1.4,5,0l69,69c1.4,1.4,1.4,3.6,0,5l-8.5,8.5c-1.4,1.4-3.6,1.4-5,0l-48.5-47
|
|
68
|
+
c-6.4-6.2-16.5-6.1-22.8,0.2l-46.5,46.7c-6.3,6.3-6.3,16.6,0,22.9l8.6,8.6c6.3,6.3,16.5,6.3,22.9,0.1l25.1-24.8
|
|
69
|
+
c1.4-1.4,3.6-1.4,5,0L478,300c1.4,1.4,1.4,3.6,0,5l0,0l-24.7,24.9c-0.1,0-0.2-0.1-0.3-0.1c-5.1,0-9.3,4.1-9.3,9.3
|
|
70
|
+
c0,5.1,4.1,9.3,9.3,9.3c5.1,0,9.3-4.1,9.3-9.3v-0.2l24.8-24.8c6.4-6.3,6.4-16.6,0-23l0,0L487,291l-24.9-24.5
|
|
71
|
+
c-6.3-6.2-16.5-6.2-22.8,0l-25.1,24.8c-1.4,1.4-3.6,1.4-5,0l-8.6-8.6c-1.4-1.4-1.4-3.6,0-5l46.5-46.7c1.4-1.4,3.6-1.4,5-0.1
|
|
72
|
+
l48.5,47.1c6.4,6.1,16.5,6.1,22.8-0.2l8.5-8.5c6.3-6.3,6.3-16.6,0-22.9l-69.1-69.1c-6.3-6.3-16.5-6.3-22.9-0.1l-70.5,69.4
|
|
73
|
+
c-1.4,1.4-3.6,1.4-5,0l-8.7-8.7c-1.4-1.4-1.4-3.6,0-5l91.7-91.7c1.4-1.4,3.6-1.4,5,0l48.6,47V158c0-2,1.6-3.5,3.5-3.5H516
|
|
74
|
+
c2,0,3.5,1.6,3.5,3.5v42.4c0,4.3,1.7,8.5,4.8,11.5l18.2,18.2c0,0.1-0.1,0.2-0.1,0.3c0,5.1,4.2,9.3,9.3,9.2c5.1,0,9.3-4.2,9.2-9.3
|
|
75
|
+
C561,225.4,556.8,221.3,551.7,221.2L551.7,221.2z"/>
|
|
76
|
+
</g>
|
|
77
|
+
</g>
|
|
78
|
+
<g id="Divider">
|
|
79
|
+
<line class="st5" x1="998" y1="14.2" x2="902" y2="614.2"/>
|
|
80
|
+
</g>
|
|
81
|
+
</g>
|
|
82
|
+
</svg>
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import { FullBlueAirDeviceState } from "./api/BlueAirAwsApi";
|
|
2
|
+
import { CharacteristicValue, PlatformAccessory } from "homebridge";
|
|
3
|
+
import { DeviceConfig } from "./utils";
|
|
4
|
+
import { BlueAirDevice } from "./device";
|
|
5
|
+
import type { BlueAirPlatform } from "./platform";
|
|
6
|
+
export { BlueAirDevice } from "./device";
|
|
7
|
+
type DeviceType = "humidifier" | "air-purifier";
|
|
8
|
+
export declare class BlueAirAccessory {
|
|
9
|
+
protected readonly platform: BlueAirPlatform;
|
|
10
|
+
protected readonly accessory: PlatformAccessory;
|
|
11
|
+
protected readonly device: BlueAirDevice;
|
|
12
|
+
protected readonly configDev: DeviceConfig;
|
|
13
|
+
private service;
|
|
14
|
+
private fanService?;
|
|
15
|
+
private filterMaintenanceService?;
|
|
16
|
+
private readonly optionalServices;
|
|
17
|
+
private deviceType;
|
|
18
|
+
private humidityAutoControlEnabled;
|
|
19
|
+
private lastManualOverride;
|
|
20
|
+
private lastAutoAdjust;
|
|
21
|
+
private loggedNoWritableTargetHumidity;
|
|
22
|
+
private lastBrightness;
|
|
23
|
+
private fanSpeedDebouncer;
|
|
24
|
+
private nlBrightnessDebouncer;
|
|
25
|
+
private humidityDebouncer;
|
|
26
|
+
private capabilities;
|
|
27
|
+
constructor(platform: BlueAirPlatform, accessory: PlatformAccessory, device: BlueAirDevice, configDev: DeviceConfig, deviceType?: DeviceType);
|
|
28
|
+
private initCapabilities;
|
|
29
|
+
private setupAccessoryInformation;
|
|
30
|
+
private setupMainService;
|
|
31
|
+
/**
|
|
32
|
+
* Setup characteristics common to both Air Purifier and Humidifier services
|
|
33
|
+
*/
|
|
34
|
+
private setupCommonServiceCharacteristics;
|
|
35
|
+
private setupAirPurifierService;
|
|
36
|
+
private setupHumidifierService;
|
|
37
|
+
/**
|
|
38
|
+
* Setup separate Fan service for humidifiers (optional)
|
|
39
|
+
*/
|
|
40
|
+
private setupFanService;
|
|
41
|
+
/**
|
|
42
|
+
* Helper to set up or remove an optional service based on config.
|
|
43
|
+
* Returns the service if enabled, undefined otherwise.
|
|
44
|
+
*
|
|
45
|
+
* Note: By default, optional services are NOT linked to the primary service.
|
|
46
|
+
* This means they appear as separate tiles in the Home app, which provides
|
|
47
|
+
* a cleaner UX than stacked controls in the main control popup.
|
|
48
|
+
* The primary service (purifier/humidifier) handles the main device controls.
|
|
49
|
+
*/
|
|
50
|
+
private setupOptionalService;
|
|
51
|
+
private setupOptionalServices;
|
|
52
|
+
private setupEventListeners;
|
|
53
|
+
/** Helper to get an optional service by subtype */
|
|
54
|
+
private getOptionalService;
|
|
55
|
+
/** Helper to update a characteristic on an optional service if it exists */
|
|
56
|
+
private updateOptionalCharacteristic;
|
|
57
|
+
updateCharacteristics(changedStates: Partial<FullBlueAirDeviceState>): void;
|
|
58
|
+
private handleStandbyChange;
|
|
59
|
+
private handleAutomodeChange;
|
|
60
|
+
private handleFanspeedChange;
|
|
61
|
+
private handleAirQualityChange;
|
|
62
|
+
getActive(): CharacteristicValue;
|
|
63
|
+
setActive(value: CharacteristicValue): Promise<void>;
|
|
64
|
+
getCurrentTemperature(): CharacteristicValue;
|
|
65
|
+
getDisplayOn(): CharacteristicValue;
|
|
66
|
+
setDisplayOn(value: CharacteristicValue): Promise<void>;
|
|
67
|
+
getDisplayBrightness(): CharacteristicValue;
|
|
68
|
+
setDisplayBrightness(value: CharacteristicValue): Promise<void>;
|
|
69
|
+
getNightLightOn(): CharacteristicValue;
|
|
70
|
+
setNightLightOn(value: CharacteristicValue): Promise<void>;
|
|
71
|
+
getNightLightBrightness(): CharacteristicValue;
|
|
72
|
+
setNightLightBrightness(value: CharacteristicValue): Promise<void>;
|
|
73
|
+
/** Debounced execution for night light brightness */
|
|
74
|
+
private executeNlBrightnessChange;
|
|
75
|
+
getNightMode(): CharacteristicValue;
|
|
76
|
+
setNightMode(value: CharacteristicValue): Promise<void>;
|
|
77
|
+
getCurrentAirPurifierState(): CharacteristicValue;
|
|
78
|
+
getTargetAirPurifierState(): CharacteristicValue;
|
|
79
|
+
setTargetAirPurifierState(value: CharacteristicValue): Promise<void>;
|
|
80
|
+
getLockPhysicalControls(): CharacteristicValue;
|
|
81
|
+
setLockPhysicalControls(value: CharacteristicValue): Promise<void>;
|
|
82
|
+
getRotationSpeed(): CharacteristicValue;
|
|
83
|
+
setRotationSpeed(value: CharacteristicValue): Promise<void>;
|
|
84
|
+
/** Debounced execution for fan speed changes */
|
|
85
|
+
private executeFanSpeedChange;
|
|
86
|
+
getFilterChangeIndication(): CharacteristicValue;
|
|
87
|
+
getFilterLifeLevel(): CharacteristicValue;
|
|
88
|
+
getPM2_5Density(): CharacteristicValue;
|
|
89
|
+
getPM10Density(): CharacteristicValue;
|
|
90
|
+
getVOCDensity(): CharacteristicValue;
|
|
91
|
+
getAirQuality(): CharacteristicValue;
|
|
92
|
+
getGermShield(): CharacteristicValue;
|
|
93
|
+
setGermShield(value: CharacteristicValue): Promise<void>;
|
|
94
|
+
private findHumidityTargetAttribute;
|
|
95
|
+
getCurrentRelativeHumidity(): CharacteristicValue;
|
|
96
|
+
/**
|
|
97
|
+
* Sync target humidity to current humidity when switching to manual mode.
|
|
98
|
+
* This provides a sensible starting point for manual control.
|
|
99
|
+
*/
|
|
100
|
+
private syncTargetHumidityToCurrent;
|
|
101
|
+
getTargetRelativeHumidity(): CharacteristicValue;
|
|
102
|
+
setTargetRelativeHumidity(value: CharacteristicValue): Promise<void>;
|
|
103
|
+
/** Debounced execution for target humidity changes */
|
|
104
|
+
private executeHumidityChange;
|
|
105
|
+
private maybeAutoAdjustFanSpeed;
|
|
106
|
+
getCurrentHumidifierState(): CharacteristicValue;
|
|
107
|
+
getTargetHumidifierState(): CharacteristicValue;
|
|
108
|
+
setTargetHumidifierState(_value: CharacteristicValue): Promise<void>;
|
|
109
|
+
getWaterLevel(): CharacteristicValue;
|
|
110
|
+
}
|
|
111
|
+
//# sourceMappingURL=accessory.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"accessory.d.ts","sourceRoot":"","sources":["../src/accessory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,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