homebridge-blueair-purifier 0.2.0 → 0.2.2-beta.1
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/LICENSE +175 -175
- package/README.md +29 -166
- package/dist/api/BlueAirAwsApi.d.ts +1 -1
- package/dist/api/BlueAirAwsApi.d.ts.map +1 -1
- package/dist/api/BlueAirAwsApi.js +14 -5
- package/dist/api/BlueAirAwsApi.js.map +1 -1
- package/dist/device/BlueAirDevice.d.ts +1 -1
- package/dist/device/BlueAirDevice.d.ts.map +1 -1
- package/dist/device/BlueAirDevice.js +20 -18
- package/dist/device/BlueAirDevice.js.map +1 -1
- package/dist/platform.d.ts.map +1 -1
- package/dist/platform.js +9 -5
- package/dist/platform.js.map +1 -1
- package/package.json +3 -3
package/LICENSE
CHANGED
|
@@ -1,176 +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
|
-
|
|
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
176
|
END OF TERMS AND CONDITIONS
|
package/README.md
CHANGED
|
@@ -6,186 +6,49 @@
|
|
|
6
6
|
|
|
7
7
|
<span align="center">
|
|
8
8
|
|
|
9
|
-
# Homebridge
|
|
9
|
+
# Homebridge Blueair Purifier
|
|
10
10
|
|
|
11
11
|
</span>
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
## Supported Devices
|
|
14
14
|
|
|
15
|
-
This
|
|
15
|
+
This plugin only supports WiFi connected BlueAir purifiers utilizing cloud connectivity (via AWS) for device communication. Below is a list of known tested products.
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
| Device | Product Page |
|
|
18
|
+
|----------------|------------|
|
|
19
|
+
| Blue Pure 211i Max | [link](https://www.blueair.com/us/air-purifiers/blue-pure-211i-max/3541.html?cgid=air-purifiers) |
|
|
20
|
+
| Blue Pure 311i+ Max | [link](https://www.blueair.com/us/air-purifiers/blue-pure-311i-plus-max/3540.html?cgid=air-purifiers) |
|
|
21
|
+
| Blue Pure 311i Max | [link](https://www.blueair.com/us/air-purifiers/blue-pure-311i-max/3539.html?cgid=air-purifiers) |
|
|
22
|
+
| Blue Pure 411i Max | [link](https://www.blueair.com/us/air-purifiers/blue-pure-411i-max/3538.html?cgid=air-purifiers) |
|
|
23
|
+
| Protect 7470i | [link](https://www.blueair.com/us/air-purifiers/2954.html?cgid=air-purifiers) |
|
|
24
|
+
| DustMagnet™ 5440i | [link](https://www.blueair.com/us/air-purifiers/dustmagnet-5440i/2420.html?cgid=air-purifiers) |
|
|
18
25
|
|
|
19
|
-
|
|
26
|
+
## Features
|
|
20
27
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
### [Create New Repository From Template](https://github.com/homebridge/homebridge-plugin-template/generate)
|
|
24
|
-
|
|
25
|
-
</span>
|
|
26
|
-
|
|
27
|
-
### Setup Development Environment
|
|
28
|
-
|
|
29
|
-
To develop Homebridge plugins you must have Node.js 18 or later installed, and a modern code editor such as [VS Code](https://code.visualstudio.com/). This plugin template uses [TypeScript](https://www.typescriptlang.org/) to make development easier and comes with pre-configured settings for [VS Code](https://code.visualstudio.com/) and ESLint. If you are using VS Code install these extensions:
|
|
30
|
-
|
|
31
|
-
- [ESLint](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint)
|
|
32
|
-
|
|
33
|
-
### Install Development Dependencies
|
|
34
|
-
|
|
35
|
-
Using a terminal, navigate to the project folder and run this command to install the development dependencies:
|
|
36
|
-
|
|
37
|
-
```shell
|
|
38
|
-
npm install
|
|
39
|
-
```
|
|
40
|
-
|
|
41
|
-
### Update package.json
|
|
42
|
-
|
|
43
|
-
Open the [`package.json`](./package.json) and change the following attributes:
|
|
44
|
-
|
|
45
|
-
- `name` - this should be prefixed with `homebridge-` or `@username/homebridge-`, is case-sensitive, and contains no spaces nor special characters apart from a dash `-`
|
|
46
|
-
- `displayName` - this is the "nice" name displayed in the Homebridge UI
|
|
47
|
-
- `repository.url` - Link to your GitHub repo
|
|
48
|
-
- `bugs.url` - Link to your GitHub repo issues page
|
|
49
|
-
|
|
50
|
-
When you are ready to publish the plugin you should set `private` to false, or remove the attribute entirely.
|
|
51
|
-
|
|
52
|
-
### Update Plugin Defaults
|
|
53
|
-
|
|
54
|
-
Open the [`src/settings.ts`](./src/settings.ts) file and change the default values:
|
|
55
|
-
|
|
56
|
-
- `PLATFORM_NAME` - Set this to be the name of your platform. This is the name of the platform that users will use to register the plugin in the Homebridge `config.json`.
|
|
57
|
-
- `PLUGIN_NAME` - Set this to be the same name you set in the [`package.json`](./package.json) file.
|
|
58
|
-
|
|
59
|
-
Open the [`config.schema.json`](./config.schema.json) file and change the following attribute:
|
|
60
|
-
|
|
61
|
-
- `pluginAlias` - set this to match the `PLATFORM_NAME` you defined in the previous step.
|
|
62
|
-
|
|
63
|
-
### Build Plugin
|
|
64
|
-
|
|
65
|
-
TypeScript needs to be compiled into JavaScript before it can run. The following command will compile the contents of your [`src`](./src) directory and put the resulting code into the `dist` folder.
|
|
66
|
-
|
|
67
|
-
```shell
|
|
68
|
-
npm run build
|
|
69
|
-
```
|
|
70
|
-
|
|
71
|
-
### Link To Homebridge
|
|
72
|
-
|
|
73
|
-
Run this command so your global installation of Homebridge can discover the plugin in your development environment:
|
|
74
|
-
|
|
75
|
-
```shell
|
|
76
|
-
npm link
|
|
77
|
-
```
|
|
28
|
+
List features here along witgh what you can show and hide
|
|
78
29
|
|
|
79
|
-
|
|
30
|
+
## Installation
|
|
80
31
|
|
|
81
|
-
|
|
82
|
-
homebridge -D
|
|
83
|
-
```
|
|
32
|
+
**Option 1: Install via Homebridge Config UI X:**
|
|
84
33
|
|
|
85
|
-
|
|
34
|
+
Search for "Blueair Purifier" in in [homebridge-config-ui-x](https://github.com/oznu/homebridge-config-ui-x) and install `homebridge-blueair-purifier`.
|
|
86
35
|
|
|
87
|
-
|
|
88
|
-
```
|
|
89
|
-
{
|
|
90
|
-
...
|
|
91
|
-
"platforms": [
|
|
92
|
-
{
|
|
93
|
-
"name": "Config",
|
|
94
|
-
"port": 8581,
|
|
95
|
-
"platform": "config"
|
|
96
|
-
},
|
|
97
|
-
{
|
|
98
|
-
"name": "<PLUGIN_NAME>",
|
|
99
|
-
//... any other options, as listed in config.schema.json ...
|
|
100
|
-
"platform": "<PLATFORM_NAME>"
|
|
101
|
-
}
|
|
102
|
-
]
|
|
103
|
-
}
|
|
104
|
-
```
|
|
36
|
+
**Option 2: Manually Install:**
|
|
105
37
|
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
```shell
|
|
109
|
-
npm run watch
|
|
38
|
+
```text
|
|
39
|
+
sudo npm install -g homebridge-blueair-purifier
|
|
110
40
|
```
|
|
111
41
|
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
42
|
+
## Plugin Configuration
|
|
43
|
+
### Feature Toggles
|
|
44
|
+
* Hide LED
|
|
45
|
+
* Hide Air Quality Sensor
|
|
46
|
+
* Hide Temperature Sensor
|
|
47
|
+
* Hide Humidity Sensor
|
|
48
|
+
* Hide Night Mode
|
|
117
49
|
|
|
118
|
-
|
|
119
|
-
- [`src/platformAccessory.ts`](./src/platformAccessory.ts) - this is where your accessory control logic should go, you can rename or create multiple instances of this file for each accessory type you need to implement as part of your platform plugin. You can refer to the [developer documentation](https://developers.homebridge.io/) to see what characteristics you need to implement for each service type.
|
|
120
|
-
- [`config.schema.json`](./config.schema.json) - update the config schema to match the config you expect from the user. See the [Plugin Config Schema Documentation](https://developers.homebridge.io/#/config-schema).
|
|
50
|
+
### Trademarks
|
|
121
51
|
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
Given a version number `MAJOR`.`MINOR`.`PATCH`, such as `1.4.3`, increment the:
|
|
125
|
-
|
|
126
|
-
1. **MAJOR** version when you make breaking changes to your plugin,
|
|
127
|
-
2. **MINOR** version when you add functionality in a backwards compatible manner, and
|
|
128
|
-
3. **PATCH** version when you make backwards compatible bug fixes.
|
|
129
|
-
|
|
130
|
-
You can use the `npm version` command to help you with this:
|
|
131
|
-
|
|
132
|
-
```shell
|
|
133
|
-
# major update / breaking changes
|
|
134
|
-
npm version major
|
|
135
|
-
|
|
136
|
-
# minor update / new features
|
|
137
|
-
npm version update
|
|
138
|
-
|
|
139
|
-
# patch / bugfixes
|
|
140
|
-
npm version patch
|
|
141
|
-
```
|
|
142
|
-
|
|
143
|
-
### Publish Package
|
|
144
|
-
|
|
145
|
-
When you are ready to publish your plugin to [npm](https://www.npmjs.com/), make sure you have removed the `private` attribute from the [`package.json`](./package.json) file then run:
|
|
146
|
-
|
|
147
|
-
```shell
|
|
148
|
-
npm publish
|
|
149
|
-
```
|
|
150
|
-
|
|
151
|
-
If you are publishing a scoped plugin, i.e. `@username/homebridge-xxx` you will need to add `--access=public` to command the first time you publish.
|
|
152
|
-
|
|
153
|
-
#### Publishing Beta Versions
|
|
154
|
-
|
|
155
|
-
You can publish *beta* versions of your plugin for other users to test before you release it to everyone.
|
|
156
|
-
|
|
157
|
-
```shell
|
|
158
|
-
# create a new pre-release version (eg. 2.1.0-beta.1)
|
|
159
|
-
npm version prepatch --preid beta
|
|
160
|
-
|
|
161
|
-
# publish to @beta
|
|
162
|
-
npm publish --tag=beta
|
|
163
|
-
```
|
|
164
|
-
|
|
165
|
-
Users can then install the *beta* version by appending `@beta` to the install command, for example:
|
|
166
|
-
|
|
167
|
-
```shell
|
|
168
|
-
sudo npm install -g homebridge-example-plugin@beta
|
|
169
|
-
```
|
|
52
|
+
Apple and HomeKit are registered trademarks of Apple Inc.
|
|
170
53
|
|
|
171
|
-
|
|
172
|
-
Consider creating your plugin with the [Homebridge Verified](https://github.com/homebridge/verified) criteria in mind. This will help you to create a plugin that is easy to use and works well with Homebridge.
|
|
173
|
-
You can then submit your plugin to the Homebridge Verified list for review.
|
|
174
|
-
The most up-to-date criteria can be found [here](https://github.com/homebridge/verified#requirements).
|
|
175
|
-
For reference, the current criteria are:
|
|
176
|
-
|
|
177
|
-
- The plugin must successfully install.
|
|
178
|
-
- The plugin must implement the [Homebridge Plugin Settings GUI](https://github.com/oznu/homebridge-config-ui-x/wiki/Developers:-Plugin-Settings-GUI).
|
|
179
|
-
- The plugin must not start unless it is configured.
|
|
180
|
-
- The plugin must not execute post-install scripts that modify the users' system in any way.
|
|
181
|
-
- The plugin must not contain any analytics or calls that enable you to track the user.
|
|
182
|
-
- The plugin must not throw unhandled exceptions, the plugin must catch and log its own errors.
|
|
183
|
-
- The plugin must be published to npm and the source code available on GitHub.
|
|
184
|
-
- A GitHub release - with patch notes - should be created for every new version of your plugin.
|
|
185
|
-
- The plugin must run on all [supported LTS versions of Node.js](https://github.com/homebridge/homebridge/wiki/How-To-Update-Node.js), at the time of writing this is Node.js v16 and v18.
|
|
186
|
-
- The plugin must not require the user to run Homebridge in a TTY or with non-standard startup parameters, even for initial configuration.
|
|
187
|
-
- If the plugin needs to write files to disk (cache, keys, etc.), it must store them inside the Homebridge storage directory.
|
|
188
|
-
|
|
189
|
-
### Useful Links
|
|
190
|
-
Note these links are here for help but are not supported/verified by the Homebridge team
|
|
191
|
-
- [Custom Characteristics](https://github.com/homebridge/homebridge-plugin-template/issues/20)
|
|
54
|
+
BlueAir is a trademark of Unilever Corporation
|
|
@@ -56,7 +56,7 @@ export default class BlueAirAwsApi {
|
|
|
56
56
|
private readonly logger;
|
|
57
57
|
private readonly gigyaApi;
|
|
58
58
|
private last_login;
|
|
59
|
-
private
|
|
59
|
+
private mutex;
|
|
60
60
|
private accessToken;
|
|
61
61
|
private blueAirApiUrl;
|
|
62
62
|
constructor(username: string, password: string, region: string, logger: Logger);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BlueAirAwsApi.d.ts","sourceRoot":"","sources":["../../src/api/BlueAirAwsApi.ts"],"names":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,UAAU,IAAI,OAAO,CAAC,sBAAsB,EAAE,CAAC;IAe/C,eAAe,CAAC,WAAW,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,mBAAmB,EAAE,CAAC;IA2CrF,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,kBAAkB,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC;YAsB9F,iBAAiB;YAmBjB,OAAO;CAsCtB"}
|
|
@@ -7,7 +7,7 @@ exports.BlueAirDeviceSensorDataMap = void 0;
|
|
|
7
7
|
const platformUtils_1 = require("../platformUtils");
|
|
8
8
|
const GigyaApi_1 = __importDefault(require("./GigyaApi"));
|
|
9
9
|
const Consts_1 = require("./Consts");
|
|
10
|
-
const
|
|
10
|
+
const async_mutex_1 = require("async-mutex");
|
|
11
11
|
exports.BlueAirDeviceSensorDataMap = {
|
|
12
12
|
fsp0: 'fanspeed',
|
|
13
13
|
hcho: 'hcho',
|
|
@@ -23,7 +23,7 @@ class BlueAirAwsApi {
|
|
|
23
23
|
this.logger = logger;
|
|
24
24
|
const config = Consts_1.BLUEAIR_CONFIG[platformUtils_1.RegionMap[region]].awsConfig;
|
|
25
25
|
this.blueAirApiUrl = `https://${config.restApiId}.execute-api.${config.awsRegion}.amazonaws.com/prod/c`;
|
|
26
|
-
this.
|
|
26
|
+
this.mutex = new async_mutex_1.Mutex();
|
|
27
27
|
this.logger.debug(`Creating BlueAir API instance with config: ${JSON.stringify(config)} and username: ${username}\
|
|
28
28
|
and region: ${region}`);
|
|
29
29
|
this.gigyaApi = new GigyaApi_1.default(username, password, region, logger);
|
|
@@ -59,7 +59,11 @@ class BlueAirAwsApi {
|
|
|
59
59
|
async getDeviceStatus(accountUuid, uuids) {
|
|
60
60
|
await this.checkTokenExpiration();
|
|
61
61
|
const body = {
|
|
62
|
-
deviceconfigquery: uuids.map((uuid) => ({ id: uuid })),
|
|
62
|
+
deviceconfigquery: uuids.map((uuid) => ({ id: uuid, r: { r: ['sensors'] } })),
|
|
63
|
+
includestates: true,
|
|
64
|
+
eventsubscription: {
|
|
65
|
+
include: uuids.map((uuid) => ({ filter: { o: `= ${uuid}` } })),
|
|
66
|
+
},
|
|
63
67
|
};
|
|
64
68
|
const data = await this.apiCall(`/${accountUuid}/r/initial`, body);
|
|
65
69
|
if (!data.deviceInfo) {
|
|
@@ -127,7 +131,7 @@ class BlueAirAwsApi {
|
|
|
127
131
|
}
|
|
128
132
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
129
133
|
async apiCall(url, data, method = 'POST', headers, retries = 3) {
|
|
130
|
-
const release = await this.
|
|
134
|
+
const release = await this.mutex.acquire();
|
|
131
135
|
const controller = new AbortController();
|
|
132
136
|
const timeout = setTimeout(() => controller.abort(), Consts_1.BLUEAIR_API_TIMEOUT);
|
|
133
137
|
try {
|
|
@@ -155,7 +159,12 @@ class BlueAirAwsApi {
|
|
|
155
159
|
return this.apiCall(url, data, method, headers, retries - 1);
|
|
156
160
|
}
|
|
157
161
|
else {
|
|
158
|
-
|
|
162
|
+
if (error instanceof Error && error.name === 'AbortError') {
|
|
163
|
+
throw new Error(`API call failed after ${3 - retries} retries with timeout.`);
|
|
164
|
+
}
|
|
165
|
+
else {
|
|
166
|
+
throw new Error(`API call failed after ${3 - retries} retries with error: ${error}`);
|
|
167
|
+
}
|
|
159
168
|
}
|
|
160
169
|
}
|
|
161
170
|
finally {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BlueAirAwsApi.js","sourceRoot":"","sources":["../../src/api/BlueAirAwsApi.ts"],"names":[],"mappings":";;;;;;AACA,oDAA6C;AAC7C,0DAAkC;AAClC,qCAA8G;AAC9G,
|
|
1
|
+
{"version":3,"file":"BlueAirAwsApi.js","sourceRoot":"","sources":["../../src/api/BlueAirAwsApi.ts"],"names":[],"mappings":";;;;;;AACA,oDAA6C;AAC7C,0DAAkC;AAClC,qCA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gBAC5B,MAAM,IAAI,KAAK,CAAC,8BAA8B,QAAQ,CAAC,MAAM,KAAK,QAAQ,CAAC,UAAU,KAAK,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;YACpH,CAAC;YACD,OAAO,IAAS,CAAC;QACnB,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,IAAI,OAAO,GAAG,CAAC,EAAE,CAAC;gBAChB,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,GAAG,CAAC,CAAC,CAAC;YAC/D,CAAC;iBAAM,CAAC;gBACN,IAAI,KAAK,YAAY,KAAK,IAAI,KAAK,CAAC,IAAI,KAAK,YAAY,EAAE,CAAC;oBAC1D,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,GAAG,OAAO,wBAAwB,CAAC,CAAC;gBAChF,CAAC;qBAAM,CAAC;oBACN,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,GAAG,OAAO,wBAAwB,KAAK,EAAE,CAAC,CAAC;gBACvF,CAAC;YACH,CAAC;QACH,CAAC;gBAAS,CAAC;YACT,YAAY,CAAC,OAAO,CAAC,CAAC;YACtB,OAAO,EAAE,CAAC;QACZ,CAAC;IACH,CAAC;CACF;AA5LD,gCA4LC"}
|
|
@@ -9,7 +9,7 @@ export declare class BlueAirDevice extends EventEmitter {
|
|
|
9
9
|
sensorData: BlueAirSensorDataWithAqi;
|
|
10
10
|
readonly id: string;
|
|
11
11
|
readonly name: string;
|
|
12
|
-
private
|
|
12
|
+
private mutex;
|
|
13
13
|
private currentChanges;
|
|
14
14
|
private last_brightness;
|
|
15
15
|
constructor(device: BlueAirDeviceStatus);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BlueAirDevice.d.ts","sourceRoot":"","sources":["../../src/device/BlueAirDevice.ts"],"names":[],"mappings":";AAAA,OAAO,YAAY,MAAM,QAAQ,CAAC;A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importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.BlueAirDevice = void 0;
|
|
7
7
|
const events_1 = __importDefault(require("events"));
|
|
8
|
-
const
|
|
8
|
+
const async_mutex_1 = require("async-mutex");
|
|
9
9
|
// https://forum.airnowtech.org/t/the-aqi-equation-2024-valid-beginning-may-6th-2024
|
|
10
10
|
const AQI = {
|
|
11
11
|
PM2_5: {
|
|
@@ -38,24 +38,22 @@ class BlueAirDevice extends events_1.default {
|
|
|
38
38
|
aqi: undefined,
|
|
39
39
|
};
|
|
40
40
|
this.sensorData.aqi = this.calculateAqi();
|
|
41
|
-
this.
|
|
41
|
+
this.mutex = new async_mutex_1.Mutex();
|
|
42
42
|
this.currentChanges = {};
|
|
43
43
|
this.last_brightness = this.state.brightness || 0;
|
|
44
44
|
this.on('update', this.updateState.bind(this));
|
|
45
45
|
}
|
|
46
|
-
notifyStateUpdate(newState, newSensorData) {
|
|
46
|
+
async notifyStateUpdate(newState, newSensorData) {
|
|
47
47
|
this.currentChanges = { ...this.currentChanges, ...newState, ...newSensorData };
|
|
48
|
-
|
|
49
|
-
const release = this.semaphore.tryAcquire();
|
|
50
|
-
this.state = { ...this.state, ...newState };
|
|
51
|
-
this.sensorData = { ...this.sensorData, ...newSensorData };
|
|
52
|
-
this.emit('stateUpdated', this.currentChanges);
|
|
53
|
-
this.currentChanges = {};
|
|
54
|
-
release();
|
|
55
|
-
}
|
|
56
|
-
catch (_a) {
|
|
48
|
+
if (this.mutex.isLocked()) {
|
|
57
49
|
return;
|
|
58
50
|
}
|
|
51
|
+
const release = await this.mutex.acquire();
|
|
52
|
+
this.state = { ...this.state, ...newState };
|
|
53
|
+
this.sensorData = { ...this.sensorData, ...newSensorData };
|
|
54
|
+
this.emit('stateUpdated', this.currentChanges);
|
|
55
|
+
this.currentChanges = {};
|
|
56
|
+
release();
|
|
59
57
|
}
|
|
60
58
|
async setState(attribute, value) {
|
|
61
59
|
if (attribute in this.state === false) {
|
|
@@ -65,13 +63,17 @@ class BlueAirDevice extends events_1.default {
|
|
|
65
63
|
return;
|
|
66
64
|
}
|
|
67
65
|
this.emit('setState', { id: this.id, name: this.name, attribute, value });
|
|
68
|
-
const release = await this.
|
|
66
|
+
const release = await this.mutex.acquire();
|
|
69
67
|
return new Promise((resolve) => {
|
|
70
|
-
this.once('setStateDone', (success) => {
|
|
68
|
+
this.once('setStateDone', async (success) => {
|
|
71
69
|
release();
|
|
72
70
|
if (success) {
|
|
73
|
-
|
|
74
|
-
|
|
71
|
+
const newState = { [attribute]: value };
|
|
72
|
+
if (attribute === 'nightmode' && value === true) {
|
|
73
|
+
newState['fanspeed'] = 11;
|
|
74
|
+
newState['brightness'] = 0;
|
|
75
|
+
}
|
|
76
|
+
await this.notifyStateUpdate(newState);
|
|
75
77
|
}
|
|
76
78
|
resolve();
|
|
77
79
|
});
|
|
@@ -84,7 +86,7 @@ class BlueAirDevice extends events_1.default {
|
|
|
84
86
|
const brightness = value ? this.last_brightness : 0;
|
|
85
87
|
await this.setState('brightness', brightness);
|
|
86
88
|
}
|
|
87
|
-
updateState(newState) {
|
|
89
|
+
async updateState(newState) {
|
|
88
90
|
const changedState = {};
|
|
89
91
|
const changedSensorData = {};
|
|
90
92
|
for (const [k, v] of Object.entries(newState.state)) {
|
|
@@ -100,7 +102,7 @@ class BlueAirDevice extends events_1.default {
|
|
|
100
102
|
}
|
|
101
103
|
}
|
|
102
104
|
}
|
|
103
|
-
this.notifyStateUpdate(changedState, changedSensorData);
|
|
105
|
+
await this.notifyStateUpdate(changedState, changedSensorData);
|
|
104
106
|
}
|
|
105
107
|
calculateAqi() {
|
|
106
108
|
if (this.sensorData.pm2_5 === undefined && this.sensorData.pm10 === undefined && this.sensorData.voc === undefined) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BlueAirDevice.js","sourceRoot":"","sources":["../../src/device/BlueAirDevice.ts"],"names":[],"mappings":";;;;;;AAAA,oDAAkC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IAE3C,OAAO,CAAC,aAAa,CAAgB;IAErC,OAAO,CAAC,OAAO,CAAuB;IACtC,OAAO,CAAC,OAAO,CAA+B;gBAG5B,GAAG,EAAE,MAAM,EACX,MAAM,EAAE,cAAc,EACtB,GAAG,EAAE,GAAG;IAqB1B,kBAAkB,CAAC,SAAS,EAAE,iBAAiB;IAKzC,qBAAqB;
|
|
1
|
+
{"version":3,"file":"platform.d.ts","sourceRoot":"","sources":["../src/platform.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,qBAAqB,EAAE,MAAM,EAAE,iBAAiB,EAAE,cAAc,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAK5H,OAAsB,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAGzE,OAAO,YAAY,MAAM,QAAQ,CAAC;AAElC,qBAAa,eAAgB,SAAQ,YAAa,YAAW,qBAAqB;aAgB9D,GAAG,EAAE,MAAM;aACX,MAAM,EAAE,cAAc;aACtB,GAAG,EAAE,GAAG;IAjB1B,SAAgB,OAAO,EAAE,OAAO,OAAO,CAAwB;IAC/D,SAAgB,cAAc,EAAE,OAAO,cAAc,CAA+B;IAGpF,SAAgB,WAAW,EAAE,iBAAiB,EAAE,CAAM;IAEtD,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAS;IACxC,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAgB;IAE3C,OAAO,CAAC,aAAa,CAAgB;IAErC,OAAO,CAAC,OAAO,CAAuB;IACtC,OAAO,CAAC,OAAO,CAA+B;gBAG5B,GAAG,EAAE,MAAM,EACX,MAAM,EAAE,cAAc,EACtB,GAAG,EAAE,GAAG;IAqB1B,kBAAkB,CAAC,SAAS,EAAE,iBAAiB;IAKzC,qBAAqB;IAqBrB,sBAAsB;IAuBtB,SAAS,CAAC,MAAM,EAAE,mBAAmB;CA2C5C"}
|
package/dist/platform.js
CHANGED
|
@@ -32,7 +32,7 @@ class BlueAirPlatform extends events_1.default {
|
|
|
32
32
|
this.blueAirApi = new BlueAirAwsApi_1.default(this.platformConfig.username, this.platformConfig.password, this.platformConfig.region, log);
|
|
33
33
|
this.api.on('didFinishLaunching', async () => {
|
|
34
34
|
await this.getInitialDeviceStates();
|
|
35
|
-
this.
|
|
35
|
+
this.getValidDevicesStatus();
|
|
36
36
|
});
|
|
37
37
|
}
|
|
38
38
|
configureAccessory(accessory) {
|
|
@@ -55,7 +55,10 @@ class BlueAirPlatform extends events_1.default {
|
|
|
55
55
|
this.log.debug('Devices states updated!');
|
|
56
56
|
}
|
|
57
57
|
catch (error) {
|
|
58
|
-
this.log.
|
|
58
|
+
this.log.warn('Error getting valid devices status, reason:', error, '. Retrying in 5 seconds...');
|
|
59
|
+
}
|
|
60
|
+
finally {
|
|
61
|
+
this.polling = setTimeout(this.getValidDevicesStatus.bind(this), this.platformConfig.pollingInterval);
|
|
59
62
|
}
|
|
60
63
|
}
|
|
61
64
|
async getInitialDeviceStates() {
|
|
@@ -92,7 +95,7 @@ class BlueAirPlatform extends events_1.default {
|
|
|
92
95
|
blueAirDevice.on('setState', async ({ id, name, attribute, value }) => {
|
|
93
96
|
// this.log.info(`[${name}] Setting state: ${attribute} = ${value}`);
|
|
94
97
|
// Clear polling to avoid conflicts
|
|
95
|
-
this.polling &&
|
|
98
|
+
this.polling && clearTimeout(this.polling);
|
|
96
99
|
let success = false;
|
|
97
100
|
try {
|
|
98
101
|
await this.blueAirApi.setDeviceStatus(id, attribute, value);
|
|
@@ -103,8 +106,9 @@ class BlueAirPlatform extends events_1.default {
|
|
|
103
106
|
}
|
|
104
107
|
finally {
|
|
105
108
|
blueAirDevice.emit('setStateDone', success);
|
|
106
|
-
//
|
|
107
|
-
this.polling
|
|
109
|
+
// Have to clear polling again to avoid conflicts
|
|
110
|
+
this.polling && clearTimeout(this.polling);
|
|
111
|
+
this.polling = setTimeout(this.getValidDevicesStatus.bind(this), this.platformConfig.pollingInterval);
|
|
108
112
|
}
|
|
109
113
|
});
|
|
110
114
|
if (existingAccessory) {
|
package/dist/platform.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"platform.js","sourceRoot":"","sources":["../src/platform.ts"],"names":[],"mappings":";;;;;;AAEA,yCAAwD;AACxD,mDAAwD;AACxD,mCAAsC;AACtC,wEAAyE;AACzE,0DAAuD;AACvD,2EAAwE;AACxE,oDAAkC;AAElC,MAAa,eAAgB,SAAQ,gBAAY;IAe/C,YACkB,GAAW,EACX,MAAsB,EACtB,GAAQ;QAExB,KAAK,EAAE,CAAC;QAJQ,QAAG,GAAH,GAAG,CAAQ;QACX,WAAM,GAAN,MAAM,CAAgB;QACtB,QAAG,GAAH,GAAG,CAAK;QAjBV,YAAO,GAAmB,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,OAAO,CAAC;QAC/C,mBAAc,GAA0B,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,cAAc,CAAC;QAEpF,oDAAoD;QACpC,gBAAW,GAAwB,EAAE,CAAC;QAK9C,kBAAa,GAAa,EAAE,CAAC;QAE7B,YAAO,GAAoB,EAAE,CAAC;QAC9B,YAAO,GAA0B,IAAI,CAAC;QAQ5C,IAAI,CAAC,cAAc,GAAG,IAAA,qBAAY,EAAC,MAAM,EAAE,6BAAa,CAAC,CAAC;QAE1D,IAAI,CAAC,IAAI,CAAC,cAAc,CAAC,QAAQ,IAAI,CAAC,IAAI,CAAC,cAAc,CAAC,QAAQ,IAAI,CAAC,IAAI,CAAC,cAAc,CAAC,WAAW,EAAE,CAAC;YACvG,IAAI,CAAC,GAAG,CAAC,KAAK,CACZ;uBACe,CAChB,CAAC;QACJ,CAAC;QAED,IAAI,CAAC,UAAU,GAAG,IAAI,uBAAa,CAAC,IAAI,CAAC,cAAc,CAAC,QAAQ,EAAE,IAAI,CAAC,cAAc,CAAC,QAAQ,EAAE,IAAI,CAAC,cAAc,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;QAEjI,IAAI,CAAC,GAAG,CAAC,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sBAAW,EAAE,wBAAa,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC;QAChF,CAAC;IACH,CAAC;CACF;AAnID,0CAmIC"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"displayName": "Homebridge BlueAir Platform",
|
|
3
3
|
"name": "homebridge-blueair-purifier",
|
|
4
|
-
"version": "0.2.
|
|
4
|
+
"version": "0.2.2-beta.1",
|
|
5
5
|
"description": "Homebridge plugin for BlueAir purifiers",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"repository": {
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
},
|
|
63
63
|
"dependencies": {
|
|
64
64
|
"@homebridge/plugin-ui-utils": "^1.0.3",
|
|
65
|
-
"
|
|
66
|
-
"
|
|
65
|
+
"async-mutex": "^0.5.0",
|
|
66
|
+
"lodash": "^4.17.21"
|
|
67
67
|
}
|
|
68
68
|
}
|