mirror of
https://github.com/Koenkk/zigbee2mqtt.git
synced 2026-07-02 10:01:37 +00:00
Update
This commit is contained in:
@@ -0,0 +1,674 @@
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 3, 29 June 2007
|
||||
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The GNU General Public License is a free, copyleft license for
|
||||
software and other kinds of works.
|
||||
|
||||
The licenses for most software and other practical works are designed
|
||||
to take away your freedom to share and change the works. By contrast,
|
||||
the GNU General Public License is intended to guarantee your freedom to
|
||||
share and change all versions of a program--to make sure it remains free
|
||||
software for all its users. We, the Free Software Foundation, use the
|
||||
GNU General Public License for most of our software; it applies also to
|
||||
any other work released this way by its authors. You can apply it to
|
||||
your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
them if you wish), that you receive source code or can get it if you
|
||||
want it, that you can change the software or use pieces of it in new
|
||||
free programs, and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to prevent others from denying you
|
||||
these rights or asking you to surrender the rights. Therefore, you have
|
||||
certain responsibilities if you distribute copies of the software, or if
|
||||
you modify it: responsibilities to respect the freedom of others.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must pass on to the recipients the same
|
||||
freedoms that you received. You must make sure that they, too, receive
|
||||
or can get the source code. And you must show them these terms so they
|
||||
know their rights.
|
||||
|
||||
Developers that use the GNU GPL protect your rights with two steps:
|
||||
(1) assert copyright on the software, and (2) offer you this License
|
||||
giving you legal permission to copy, distribute and/or modify it.
|
||||
|
||||
For the developers' and authors' protection, the GPL clearly explains
|
||||
that there is no warranty for this free software. For both users' and
|
||||
authors' sake, the GPL requires that modified versions be marked as
|
||||
changed, so that their problems will not be attributed erroneously to
|
||||
authors of previous versions.
|
||||
|
||||
Some devices are designed to deny users access to install or run
|
||||
modified versions of the software inside them, although the manufacturer
|
||||
can do so. This is fundamentally incompatible with the aim of
|
||||
protecting users' freedom to change the software. The systematic
|
||||
pattern of such abuse occurs in the area of products for individuals to
|
||||
use, which is precisely where it is most unacceptable. Therefore, we
|
||||
have designed this version of the GPL to prohibit the practice for those
|
||||
products. If such problems arise substantially in other domains, we
|
||||
stand ready to extend this provision to those domains in future versions
|
||||
of the GPL, as needed to protect the freedom of users.
|
||||
|
||||
Finally, every program is threatened constantly by software patents.
|
||||
States should not allow patents to restrict development and use of
|
||||
software on general-purpose computers, but in those that do, we wish to
|
||||
avoid the special danger that patents applied to a free program could
|
||||
make it effectively proprietary. To prevent this, the GPL assures that
|
||||
patents cannot be used to render the program non-free.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
TERMS AND CONDITIONS
|
||||
|
||||
0. Definitions.
|
||||
|
||||
"This License" refers to version 3 of the GNU General Public License.
|
||||
|
||||
"Copyright" also means copyright-like laws that apply to other kinds of
|
||||
works, such as semiconductor masks.
|
||||
|
||||
"The Program" refers to any copyrightable work licensed under this
|
||||
License. Each licensee is addressed as "you". "Licensees" and
|
||||
"recipients" may be individuals or organizations.
|
||||
|
||||
To "modify" a work means to copy from or adapt all or part of the work
|
||||
in a fashion requiring copyright permission, other than the making of an
|
||||
exact copy. The resulting work is called a "modified version" of the
|
||||
earlier work or a work "based on" the earlier work.
|
||||
|
||||
A "covered work" means either the unmodified Program or a work based
|
||||
on the Program.
|
||||
|
||||
To "propagate" a work means to do anything with it that, without
|
||||
permission, would make you directly or secondarily liable for
|
||||
infringement under applicable copyright law, except executing it on a
|
||||
computer or modifying a private copy. Propagation includes copying,
|
||||
distribution (with or without modification), making available to the
|
||||
public, and in some countries other activities as well.
|
||||
|
||||
To "convey" a work means any kind of propagation that enables other
|
||||
parties to make or receive copies. Mere interaction with a user through
|
||||
a computer network, with no transfer of a copy, is not conveying.
|
||||
|
||||
An interactive user interface displays "Appropriate Legal Notices"
|
||||
to the extent that it includes a convenient and prominently visible
|
||||
feature that (1) displays an appropriate copyright notice, and (2)
|
||||
tells the user that there is no warranty for the work (except to the
|
||||
extent that warranties are provided), that licensees may convey the
|
||||
work under this License, and how to view a copy of this License. If
|
||||
the interface presents a list of user commands or options, such as a
|
||||
menu, a prominent item in the list meets this criterion.
|
||||
|
||||
1. Source Code.
|
||||
|
||||
The "source code" for a work means the preferred form of the work
|
||||
for making modifications to it. "Object code" means any non-source
|
||||
form of a work.
|
||||
|
||||
A "Standard Interface" means an interface that either is an official
|
||||
standard defined by a recognized standards body, or, in the case of
|
||||
interfaces specified for a particular programming language, one that
|
||||
is widely used among developers working in that language.
|
||||
|
||||
The "System Libraries" of an executable work include anything, other
|
||||
than the work as a whole, that (a) is included in the normal form of
|
||||
packaging a Major Component, but which is not part of that Major
|
||||
Component, and (b) serves only to enable use of the work with that
|
||||
Major Component, or to implement a Standard Interface for which an
|
||||
implementation is available to the public in source code form. A
|
||||
"Major Component", in this context, means a major essential component
|
||||
(kernel, window system, and so on) of the specific operating system
|
||||
(if any) on which the executable work runs, or a compiler used to
|
||||
produce the work, or an object code interpreter used to run it.
|
||||
|
||||
The "Corresponding Source" for a work in object code form means all
|
||||
the source code needed to generate, install, and (for an executable
|
||||
work) run the object code and to modify the work, including scripts to
|
||||
control those activities. However, it does not include the work's
|
||||
System Libraries, or general-purpose tools or generally available free
|
||||
programs which are used unmodified in performing those activities but
|
||||
which are not part of the work. For example, Corresponding Source
|
||||
includes interface definition files associated with source files for
|
||||
the work, and the source code for shared libraries and dynamically
|
||||
linked subprograms that the work is specifically designed to require,
|
||||
such as by intimate data communication or control flow between those
|
||||
subprograms and other parts of the work.
|
||||
|
||||
The Corresponding Source need not include anything that users
|
||||
can regenerate automatically from other parts of the Corresponding
|
||||
Source.
|
||||
|
||||
The Corresponding Source for a work in source code form is that
|
||||
same work.
|
||||
|
||||
2. Basic Permissions.
|
||||
|
||||
All rights granted under this License are granted for the term of
|
||||
copyright on the Program, and are irrevocable provided the stated
|
||||
conditions are met. This License explicitly affirms your unlimited
|
||||
permission to run the unmodified Program. The output from running a
|
||||
covered work is covered by this License only if the output, given its
|
||||
content, constitutes a covered work. This License acknowledges your
|
||||
rights of fair use or other equivalent, as provided by copyright law.
|
||||
|
||||
You may make, run and propagate covered works that you do not
|
||||
convey, without conditions so long as your license otherwise remains
|
||||
in force. You may convey covered works to others for the sole purpose
|
||||
of having them make modifications exclusively for you, or provide you
|
||||
with facilities for running those works, provided that you comply with
|
||||
the terms of this License in conveying all material for which you do
|
||||
not control copyright. Those thus making or running the covered works
|
||||
for you must do so exclusively on your behalf, under your direction
|
||||
and control, on terms that prohibit them from making any copies of
|
||||
your copyrighted material outside their relationship with you.
|
||||
|
||||
Conveying under any other circumstances is permitted solely under
|
||||
the conditions stated below. Sublicensing is not allowed; section 10
|
||||
makes it unnecessary.
|
||||
|
||||
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
||||
|
||||
No covered work shall be deemed part of an effective technological
|
||||
measure under any applicable law fulfilling obligations under article
|
||||
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
||||
similar laws prohibiting or restricting circumvention of such
|
||||
measures.
|
||||
|
||||
When you convey a covered work, you waive any legal power to forbid
|
||||
circumvention of technological measures to the extent such circumvention
|
||||
is effected by exercising rights under this License with respect to
|
||||
the covered work, and you disclaim any intention to limit operation or
|
||||
modification of the work as a means of enforcing, against the work's
|
||||
users, your or third parties' legal rights to forbid circumvention of
|
||||
technological measures.
|
||||
|
||||
4. Conveying Verbatim Copies.
|
||||
|
||||
You may convey verbatim copies of the Program's source code as you
|
||||
receive it, in any medium, provided that you conspicuously and
|
||||
appropriately publish on each copy an appropriate copyright notice;
|
||||
keep intact all notices stating that this License and any
|
||||
non-permissive terms added in accord with section 7 apply to the code;
|
||||
keep intact all notices of the absence of any warranty; and give all
|
||||
recipients a copy of this License along with the Program.
|
||||
|
||||
You may charge any price or no price for each copy that you convey,
|
||||
and you may offer support or warranty protection for a fee.
|
||||
|
||||
5. Conveying Modified Source Versions.
|
||||
|
||||
You may convey a work based on the Program, or the modifications to
|
||||
produce it from the Program, in the form of source code under the
|
||||
terms of section 4, provided that you also meet all of these conditions:
|
||||
|
||||
a) The work must carry prominent notices stating that you modified
|
||||
it, and giving a relevant date.
|
||||
|
||||
b) The work must carry prominent notices stating that it is
|
||||
released under this License and any conditions added under section
|
||||
7. This requirement modifies the requirement in section 4 to
|
||||
"keep intact all notices".
|
||||
|
||||
c) You must license the entire work, as a whole, under this
|
||||
License to anyone who comes into possession of a copy. This
|
||||
License will therefore apply, along with any applicable section 7
|
||||
additional terms, to the whole of the work, and all its parts,
|
||||
regardless of how they are packaged. This License gives no
|
||||
permission to license the work in any other way, but it does not
|
||||
invalidate such permission if you have separately received it.
|
||||
|
||||
d) If the work has interactive user interfaces, each must display
|
||||
Appropriate Legal Notices; however, if the Program has interactive
|
||||
interfaces that do not display Appropriate Legal Notices, your
|
||||
work need not make them do so.
|
||||
|
||||
A compilation of a covered work with other separate and independent
|
||||
works, which are not by their nature extensions of the covered work,
|
||||
and which are not combined with it such as to form a larger program,
|
||||
in or on a volume of a storage or distribution medium, is called an
|
||||
"aggregate" if the compilation and its resulting copyright are not
|
||||
used to limit the access or legal rights of the compilation's users
|
||||
beyond what the individual works permit. Inclusion of a covered work
|
||||
in an aggregate does not cause this License to apply to the other
|
||||
parts of the aggregate.
|
||||
|
||||
6. Conveying Non-Source Forms.
|
||||
|
||||
You may convey a covered work in object code form under the terms
|
||||
of sections 4 and 5, provided that you also convey the
|
||||
machine-readable Corresponding Source under the terms of this License,
|
||||
in one of these ways:
|
||||
|
||||
a) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by the
|
||||
Corresponding Source fixed on a durable physical medium
|
||||
customarily used for software interchange.
|
||||
|
||||
b) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by a
|
||||
written offer, valid for at least three years and valid for as
|
||||
long as you offer spare parts or customer support for that product
|
||||
model, to give anyone who possesses the object code either (1) a
|
||||
copy of the Corresponding Source for all the software in the
|
||||
product that is covered by this License, on a durable physical
|
||||
medium customarily used for software interchange, for a price no
|
||||
more than your reasonable cost of physically performing this
|
||||
conveying of source, or (2) access to copy the
|
||||
Corresponding Source from a network server at no charge.
|
||||
|
||||
c) Convey individual copies of the object code with a copy of the
|
||||
written offer to provide the Corresponding Source. This
|
||||
alternative is allowed only occasionally and noncommercially, and
|
||||
only if you received the object code with such an offer, in accord
|
||||
with subsection 6b.
|
||||
|
||||
d) Convey the object code by offering access from a designated
|
||||
place (gratis or for a charge), and offer equivalent access to the
|
||||
Corresponding Source in the same way through the same place at no
|
||||
further charge. You need not require recipients to copy the
|
||||
Corresponding Source along with the object code. If the place to
|
||||
copy the object code is a network server, the Corresponding Source
|
||||
may be on a different server (operated by you or a third party)
|
||||
that supports equivalent copying facilities, provided you maintain
|
||||
clear directions next to the object code saying where to find the
|
||||
Corresponding Source. Regardless of what server hosts the
|
||||
Corresponding Source, you remain obligated to ensure that it is
|
||||
available for as long as needed to satisfy these requirements.
|
||||
|
||||
e) Convey the object code using peer-to-peer transmission, provided
|
||||
you inform other peers where the object code and Corresponding
|
||||
Source of the work are being offered to the general public at no
|
||||
charge under subsection 6d.
|
||||
|
||||
A separable portion of the object code, whose source code is excluded
|
||||
from the Corresponding Source as a System Library, need not be
|
||||
included in conveying the object code work.
|
||||
|
||||
A "User Product" is either (1) a "consumer product", which means any
|
||||
tangible personal property which is normally used for personal, family,
|
||||
or household purposes, or (2) anything designed or sold for incorporation
|
||||
into a dwelling. In determining whether a product is a consumer product,
|
||||
doubtful cases shall be resolved in favor of coverage. For a particular
|
||||
product received by a particular user, "normally used" refers to a
|
||||
typical or common use of that class of product, regardless of the status
|
||||
of the particular user or of the way in which the particular user
|
||||
actually uses, or expects or is expected to use, the product. A product
|
||||
is a consumer product regardless of whether the product has substantial
|
||||
commercial, industrial or non-consumer uses, unless such uses represent
|
||||
the only significant mode of use of the product.
|
||||
|
||||
"Installation Information" for a User Product means any methods,
|
||||
procedures, authorization keys, or other information required to install
|
||||
and execute modified versions of a covered work in that User Product from
|
||||
a modified version of its Corresponding Source. The information must
|
||||
suffice to ensure that the continued functioning of the modified object
|
||||
code is in no case prevented or interfered with solely because
|
||||
modification has been made.
|
||||
|
||||
If you convey an object code work under this section in, or with, or
|
||||
specifically for use in, a User Product, and the conveying occurs as
|
||||
part of a transaction in which the right of possession and use of the
|
||||
User Product is transferred to the recipient in perpetuity or for a
|
||||
fixed term (regardless of how the transaction is characterized), the
|
||||
Corresponding Source conveyed under this section must be accompanied
|
||||
by the Installation Information. But this requirement does not apply
|
||||
if neither you nor any third party retains the ability to install
|
||||
modified object code on the User Product (for example, the work has
|
||||
been installed in ROM).
|
||||
|
||||
The requirement to provide Installation Information does not include a
|
||||
requirement to continue to provide support service, warranty, or updates
|
||||
for a work that has been modified or installed by the recipient, or for
|
||||
the User Product in which it has been modified or installed. Access to a
|
||||
network may be denied when the modification itself materially and
|
||||
adversely affects the operation of the network or violates the rules and
|
||||
protocols for communication across the network.
|
||||
|
||||
Corresponding Source conveyed, and Installation Information provided,
|
||||
in accord with this section must be in a format that is publicly
|
||||
documented (and with an implementation available to the public in
|
||||
source code form), and must require no special password or key for
|
||||
unpacking, reading or copying.
|
||||
|
||||
7. Additional Terms.
|
||||
|
||||
"Additional permissions" are terms that supplement the terms of this
|
||||
License by making exceptions from one or more of its conditions.
|
||||
Additional permissions that are applicable to the entire Program shall
|
||||
be treated as though they were included in this License, to the extent
|
||||
that they are valid under applicable law. If additional permissions
|
||||
apply only to part of the Program, that part may be used separately
|
||||
under those permissions, but the entire Program remains governed by
|
||||
this License without regard to the additional permissions.
|
||||
|
||||
When you convey a copy of a covered work, you may at your option
|
||||
remove any additional permissions from that copy, or from any part of
|
||||
it. (Additional permissions may be written to require their own
|
||||
removal in certain cases when you modify the work.) You may place
|
||||
additional permissions on material, added by you to a covered work,
|
||||
for which you have or can give appropriate copyright permission.
|
||||
|
||||
Notwithstanding any other provision of this License, for material you
|
||||
add to a covered work, you may (if authorized by the copyright holders of
|
||||
that material) supplement the terms of this License with terms:
|
||||
|
||||
a) Disclaiming warranty or limiting liability differently from the
|
||||
terms of sections 15 and 16 of this License; or
|
||||
|
||||
b) Requiring preservation of specified reasonable legal notices or
|
||||
author attributions in that material or in the Appropriate Legal
|
||||
Notices displayed by works containing it; or
|
||||
|
||||
c) Prohibiting misrepresentation of the origin of that material, or
|
||||
requiring that modified versions of such material be marked in
|
||||
reasonable ways as different from the original version; or
|
||||
|
||||
d) Limiting the use for publicity purposes of names of licensors or
|
||||
authors of the material; or
|
||||
|
||||
e) Declining to grant rights under trademark law for use of some
|
||||
trade names, trademarks, or service marks; or
|
||||
|
||||
f) Requiring indemnification of licensors and authors of that
|
||||
material by anyone who conveys the material (or modified versions of
|
||||
it) with contractual assumptions of liability to the recipient, for
|
||||
any liability that these contractual assumptions directly impose on
|
||||
those licensors and authors.
|
||||
|
||||
All other non-permissive additional terms are considered "further
|
||||
restrictions" within the meaning of section 10. If the Program as you
|
||||
received it, or any part of it, contains a notice stating that it is
|
||||
governed by this License along with a term that is a further
|
||||
restriction, you may remove that term. If a license document contains
|
||||
a further restriction but permits relicensing or conveying under this
|
||||
License, you may add to a covered work material governed by the terms
|
||||
of that license document, provided that the further restriction does
|
||||
not survive such relicensing or conveying.
|
||||
|
||||
If you add terms to a covered work in accord with this section, you
|
||||
must place, in the relevant source files, a statement of the
|
||||
additional terms that apply to those files, or a notice indicating
|
||||
where to find the applicable terms.
|
||||
|
||||
Additional terms, permissive or non-permissive, may be stated in the
|
||||
form of a separately written license, or stated as exceptions;
|
||||
the above requirements apply either way.
|
||||
|
||||
8. Termination.
|
||||
|
||||
You may not propagate or modify a covered work except as expressly
|
||||
provided under this License. Any attempt otherwise to propagate or
|
||||
modify it is void, and will automatically terminate your rights under
|
||||
this License (including any patent licenses granted under the third
|
||||
paragraph of section 11).
|
||||
|
||||
However, if you cease all violation of this License, then your
|
||||
license from a particular copyright holder is reinstated (a)
|
||||
provisionally, unless and until the copyright holder explicitly and
|
||||
finally terminates your license, and (b) permanently, if the copyright
|
||||
holder fails to notify you of the violation by some reasonable means
|
||||
prior to 60 days after the cessation.
|
||||
|
||||
Moreover, your license from a particular copyright holder is
|
||||
reinstated permanently if the copyright holder notifies you of the
|
||||
violation by some reasonable means, this is the first time you have
|
||||
received notice of violation of this License (for any work) from that
|
||||
copyright holder, and you cure the violation prior to 30 days after
|
||||
your receipt of the notice.
|
||||
|
||||
Termination of your rights under this section does not terminate the
|
||||
licenses of parties who have received copies or rights from you under
|
||||
this License. If your rights have been terminated and not permanently
|
||||
reinstated, you do not qualify to receive new licenses for the same
|
||||
material under section 10.
|
||||
|
||||
9. Acceptance Not Required for Having Copies.
|
||||
|
||||
You are not required to accept this License in order to receive or
|
||||
run a copy of the Program. Ancillary propagation of a covered work
|
||||
occurring solely as a consequence of using peer-to-peer transmission
|
||||
to receive a copy likewise does not require acceptance. However,
|
||||
nothing other than this License grants you permission to propagate or
|
||||
modify any covered work. These actions infringe copyright if you do
|
||||
not accept this License. Therefore, by modifying or propagating a
|
||||
covered work, you indicate your acceptance of this License to do so.
|
||||
|
||||
10. Automatic Licensing of Downstream Recipients.
|
||||
|
||||
Each time you convey a covered work, the recipient automatically
|
||||
receives a license from the original licensors, to run, modify and
|
||||
propagate that work, subject to this License. You are not responsible
|
||||
for enforcing compliance by third parties with this License.
|
||||
|
||||
An "entity transaction" is a transaction transferring control of an
|
||||
organization, or substantially all assets of one, or subdividing an
|
||||
organization, or merging organizations. If propagation of a covered
|
||||
work results from an entity transaction, each party to that
|
||||
transaction who receives a copy of the work also receives whatever
|
||||
licenses to the work the party's predecessor in interest had or could
|
||||
give under the previous paragraph, plus a right to possession of the
|
||||
Corresponding Source of the work from the predecessor in interest, if
|
||||
the predecessor has it or can get it with reasonable efforts.
|
||||
|
||||
You may not impose any further restrictions on the exercise of the
|
||||
rights granted or affirmed under this License. For example, you may
|
||||
not impose a license fee, royalty, or other charge for exercise of
|
||||
rights granted under this License, and you may not initiate litigation
|
||||
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
||||
any patent claim is infringed by making, using, selling, offering for
|
||||
sale, or importing the Program or any portion of it.
|
||||
|
||||
11. Patents.
|
||||
|
||||
A "contributor" is a copyright holder who authorizes use under this
|
||||
License of the Program or a work on which the Program is based. The
|
||||
work thus licensed is called the contributor's "contributor version".
|
||||
|
||||
A contributor's "essential patent claims" are all patent claims
|
||||
owned or controlled by the contributor, whether already acquired or
|
||||
hereafter acquired, that would be infringed by some manner, permitted
|
||||
by this License, of making, using, or selling its contributor version,
|
||||
but do not include claims that would be infringed only as a
|
||||
consequence of further modification of the contributor version. For
|
||||
purposes of this definition, "control" includes the right to grant
|
||||
patent sublicenses in a manner consistent with the requirements of
|
||||
this License.
|
||||
|
||||
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
||||
patent license under the contributor's essential patent claims, to
|
||||
make, use, sell, offer for sale, import and otherwise run, modify and
|
||||
propagate the contents of its contributor version.
|
||||
|
||||
In the following three paragraphs, a "patent license" is any express
|
||||
agreement or commitment, however denominated, not to enforce a patent
|
||||
(such as an express permission to practice a patent or covenant not to
|
||||
sue for patent infringement). To "grant" such a patent license to a
|
||||
party means to make such an agreement or commitment not to enforce a
|
||||
patent against the party.
|
||||
|
||||
If you convey a covered work, knowingly relying on a patent license,
|
||||
and the Corresponding Source of the work is not available for anyone
|
||||
to copy, free of charge and under the terms of this License, through a
|
||||
publicly available network server or other readily accessible means,
|
||||
then you must either (1) cause the Corresponding Source to be so
|
||||
available, or (2) arrange to deprive yourself of the benefit of the
|
||||
patent license for this particular work, or (3) arrange, in a manner
|
||||
consistent with the requirements of this License, to extend the patent
|
||||
license to downstream recipients. "Knowingly relying" means you have
|
||||
actual knowledge that, but for the patent license, your conveying the
|
||||
covered work in a country, or your recipient's use of the covered work
|
||||
in a country, would infringe one or more identifiable patents in that
|
||||
country that you have reason to believe are valid.
|
||||
|
||||
If, pursuant to or in connection with a single transaction or
|
||||
arrangement, you convey, or propagate by procuring conveyance of, a
|
||||
covered work, and grant a patent license to some of the parties
|
||||
receiving the covered work authorizing them to use, propagate, modify
|
||||
or convey a specific copy of the covered work, then the patent license
|
||||
you grant is automatically extended to all recipients of the covered
|
||||
work and works based on it.
|
||||
|
||||
A patent license is "discriminatory" if it does not include within
|
||||
the scope of its coverage, prohibits the exercise of, or is
|
||||
conditioned on the non-exercise of one or more of the rights that are
|
||||
specifically granted under this License. You may not convey a covered
|
||||
work if you are a party to an arrangement with a third party that is
|
||||
in the business of distributing software, under which you make payment
|
||||
to the third party based on the extent of your activity of conveying
|
||||
the work, and under which the third party grants, to any of the
|
||||
parties who would receive the covered work from you, a discriminatory
|
||||
patent license (a) in connection with copies of the covered work
|
||||
conveyed by you (or copies made from those copies), or (b) primarily
|
||||
for and in connection with specific products or compilations that
|
||||
contain the covered work, unless you entered into that arrangement,
|
||||
or that patent license was granted, prior to 28 March 2007.
|
||||
|
||||
Nothing in this License shall be construed as excluding or limiting
|
||||
any implied license or other defenses to infringement that may
|
||||
otherwise be available to you under applicable patent law.
|
||||
|
||||
12. No Surrender of Others' Freedom.
|
||||
|
||||
If conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot convey a
|
||||
covered work so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you may
|
||||
not convey it at all. For example, if you agree to terms that obligate you
|
||||
to collect a royalty for further conveying from those to whom you convey
|
||||
the Program, the only way you could satisfy both those terms and this
|
||||
License would be to refrain entirely from conveying the Program.
|
||||
|
||||
13. Use with the GNU Affero General Public License.
|
||||
|
||||
Notwithstanding any other provision of this License, you have
|
||||
permission to link or combine any covered work with a work licensed
|
||||
under version 3 of the GNU Affero General Public License into a single
|
||||
combined work, and to convey the resulting work. The terms of this
|
||||
License will continue to apply to the part which is the covered work,
|
||||
but the special requirements of the GNU Affero General Public License,
|
||||
section 13, concerning interaction through a network will apply to the
|
||||
combination as such.
|
||||
|
||||
14. Revised Versions of this License.
|
||||
|
||||
The Free Software Foundation may publish revised and/or new versions of
|
||||
the GNU General Public License from time to time. Such new versions will
|
||||
be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the
|
||||
Program specifies that a certain numbered version of the GNU General
|
||||
Public License "or any later version" applies to it, you have the
|
||||
option of following the terms and conditions either of that numbered
|
||||
version or of any later version published by the Free Software
|
||||
Foundation. If the Program does not specify a version number of the
|
||||
GNU General Public License, you may choose any version ever published
|
||||
by the Free Software Foundation.
|
||||
|
||||
If the Program specifies that a proxy can decide which future
|
||||
versions of the GNU General Public License can be used, that proxy's
|
||||
public statement of acceptance of a version permanently authorizes you
|
||||
to choose that version for the Program.
|
||||
|
||||
Later license versions may give you additional or different
|
||||
permissions. However, no additional obligations are imposed on any
|
||||
author or copyright holder as a result of your choosing to follow a
|
||||
later version.
|
||||
|
||||
15. Disclaimer of Warranty.
|
||||
|
||||
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
||||
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
||||
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
||||
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
||||
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
||||
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
||||
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. Limitation of Liability.
|
||||
|
||||
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
||||
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
||||
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
||||
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
||||
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
||||
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
||||
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
||||
SUCH DAMAGES.
|
||||
|
||||
17. Interpretation of Sections 15 and 16.
|
||||
|
||||
If the disclaimer of warranty and limitation of liability provided
|
||||
above cannot be given local legal effect according to their terms,
|
||||
reviewing courts shall apply local law that most closely approximates
|
||||
an absolute waiver of all civil liability in connection with the
|
||||
Program, unless a warranty or assumption of liability accompanies a
|
||||
copy of the Program in return for a fee.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
state the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
{one line to give the program's name and a brief idea of what it does.}
|
||||
Copyright (C) {year} {name of author}
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program does terminal interaction, make it output a short
|
||||
notice like this when it starts in an interactive mode:
|
||||
|
||||
{project} Copyright (C) {year} {fullname}
|
||||
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type `show c' for details.
|
||||
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||
parts of the General Public License. Of course, your program's commands
|
||||
might be different; for a GUI interface, you would use an "about box".
|
||||
|
||||
You should also get your employer (if you work as a programmer) or school,
|
||||
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
||||
For more information on this, and how to apply and follow the GNU GPL, see
|
||||
<http://www.gnu.org/licenses/>.
|
||||
|
||||
The GNU General Public License does not permit incorporating your program
|
||||
into proprietary programs. If your program is a subroutine library, you
|
||||
may consider it more useful to permit linking proprietary applications with
|
||||
the library. If this is what you want to do, use the GNU Lesser General
|
||||
Public License instead of this License. But first, please read
|
||||
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
|
||||
Vendored
+27
@@ -0,0 +1,27 @@
|
||||
import type Extension from "./extension/extension";
|
||||
import { type MqttPublishOptions } from "./mqtt";
|
||||
export declare class Controller {
|
||||
private eventBus;
|
||||
private zigbee;
|
||||
private state;
|
||||
private mqtt;
|
||||
private restartCallback;
|
||||
private exitCallback;
|
||||
readonly extensions: Set<Extension>;
|
||||
readonly extensionArgs: ConstructorParameters<typeof Extension>;
|
||||
private sdNotify;
|
||||
constructor(restartCallback: () => Promise<void>, exitCallback: (code: number, restart: boolean) => Promise<void>);
|
||||
start(): Promise<void>;
|
||||
enableDisableExtension(enable: boolean, name: string): Promise<void>;
|
||||
getExtension(name: string): Extension | undefined;
|
||||
addExtension(extension: Extension): Promise<void>;
|
||||
removeExtension(extension: Extension): Promise<void>;
|
||||
private startExtension;
|
||||
private stopExtension;
|
||||
stop(restart?: boolean): Promise<void>;
|
||||
exit(code: number, restart?: boolean): Promise<void>;
|
||||
onZigbeeAdapterDisconnected(): Promise<void>;
|
||||
publishEntityState(entity: Group | Device, payload: KeyValue, stateChangeReason?: StateChangeReason): Promise<void>;
|
||||
iteratePayloadAttributeOutput(topicRoot: string, payload: KeyValue, options: Partial<MqttPublishOptions>): Promise<void>;
|
||||
}
|
||||
//# sourceMappingURL=controller.d.ts.map
|
||||
Vendored
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"controller.d.ts","sourceRoot":"","sources":["../lib/controller.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,SAAS,MAAM,uBAAuB,CAAC;AAwBnD,OAAa,EAAC,KAAK,kBAAkB,EAAC,MAAM,QAAQ,CAAC;AAQrD,qBAAa,UAAU;IACnB,OAAO,CAAC,QAAQ,CAAW;IAC3B,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,KAAK,CAAQ;IACrB,OAAO,CAAC,IAAI,CAAO;IACnB,OAAO,CAAC,eAAe,CAAsB;IAC7C,OAAO,CAAC,YAAY,CAAoD;IACxE,SAAgB,UAAU,EAAE,GAAG,CAAC,SAAS,CAAC,CAAC;IAC3C,SAAgB,aAAa,EAAE,qBAAqB,CAAC,OAAO,SAAS,CAAC,CAAC;IACvE,OAAO,CAAC,QAAQ,CAA2C;gBAE/C,eAAe,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,EAAE,YAAY,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,KAAK,OAAO,CAAC,IAAI,CAAC;IAwC3G,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAwFhB,sBAAsB,CAAC,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IA0EzE,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,SAAS;IAQ5C,YAAY,CAAC,SAAS,EAAE,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC;IAWvD,eAAe,CAAC,SAAS,EAAE,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC;YAM5C,cAAc;YAQd,aAAa;IAQrB,IAAI,CAAC,OAAO,UAAQ,GAAG,OAAO,CAAC,IAAI,CAAC;IAgCpC,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,UAAQ,GAAG,OAAO,CAAC,IAAI,CAAC;IAK5C,2BAA2B,IAAI,OAAO,CAAC,IAAI,CAAC;IAK5C,kBAAkB,CAAC,MAAM,EAAE,KAAK,GAAG,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,iBAAiB,CAAC,EAAE,iBAAiB,GAAG,OAAO,CAAC,IAAI,CAAC;IAgFzH,6BAA6B,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,CAAC,kBAAkB,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;CA0BjI"}
|
||||
Vendored
+69
@@ -0,0 +1,69 @@
|
||||
type ListenerKey = object;
|
||||
type Stats = {
|
||||
devices: Map<string, // IEEE address
|
||||
{
|
||||
lastSeenChanges?: {
|
||||
messages: number;
|
||||
first: number;
|
||||
};
|
||||
leaveCounts: number;
|
||||
networkAddressChanges: number;
|
||||
}>;
|
||||
mqtt: {
|
||||
published: number;
|
||||
received: number;
|
||||
};
|
||||
};
|
||||
export default class EventBus {
|
||||
private callbacksByExtension;
|
||||
private emitter;
|
||||
readonly stats: Stats;
|
||||
constructor();
|
||||
emitAdapterDisconnected(): void;
|
||||
onAdapterDisconnected(key: ListenerKey, callback: () => void): void;
|
||||
emitPermitJoinChanged(data: eventdata.PermitJoinChanged): void;
|
||||
onPermitJoinChanged(key: ListenerKey, callback: (data: eventdata.PermitJoinChanged) => void): void;
|
||||
emitEntityRenamed(data: eventdata.EntityRenamed): void;
|
||||
onEntityRenamed(key: ListenerKey, callback: (data: eventdata.EntityRenamed) => void): void;
|
||||
emitEntityRemoved(data: eventdata.EntityRemoved): void;
|
||||
onEntityRemoved(key: ListenerKey, callback: (data: eventdata.EntityRemoved) => void): void;
|
||||
emitLastSeenChanged(data: eventdata.LastSeenChanged): void;
|
||||
onLastSeenChanged(key: ListenerKey, callback: (data: eventdata.LastSeenChanged) => void): void;
|
||||
emitDeviceNetworkAddressChanged(data: eventdata.DeviceNetworkAddressChanged): void;
|
||||
onDeviceNetworkAddressChanged(key: ListenerKey, callback: (data: eventdata.DeviceNetworkAddressChanged) => void): void;
|
||||
emitDeviceAnnounce(data: eventdata.DeviceAnnounce): void;
|
||||
onDeviceAnnounce(key: ListenerKey, callback: (data: eventdata.DeviceAnnounce) => void): void;
|
||||
emitDeviceInterview(data: eventdata.DeviceInterview): void;
|
||||
onDeviceInterview(key: ListenerKey, callback: (data: eventdata.DeviceInterview) => void): void;
|
||||
emitDeviceJoined(data: eventdata.DeviceJoined): void;
|
||||
onDeviceJoined(key: ListenerKey, callback: (data: eventdata.DeviceJoined) => void): void;
|
||||
emitEntityOptionsChanged(data: eventdata.EntityOptionsChanged): void;
|
||||
onEntityOptionsChanged(key: ListenerKey, callback: (data: eventdata.EntityOptionsChanged) => void): void;
|
||||
emitExposesChanged(data: eventdata.ExposesChanged): void;
|
||||
onExposesChanged(key: ListenerKey, callback: (data: eventdata.ExposesChanged) => void): void;
|
||||
emitDeviceLeave(data: eventdata.DeviceLeave): void;
|
||||
onDeviceLeave(key: ListenerKey, callback: (data: eventdata.DeviceLeave) => void): void;
|
||||
emitDeviceMessage(data: eventdata.DeviceMessage): void;
|
||||
onDeviceMessage(key: ListenerKey, callback: (data: eventdata.DeviceMessage) => void): void;
|
||||
emitMQTTMessage(data: eventdata.MQTTMessage): void;
|
||||
onMQTTMessage(key: ListenerKey, callback: (data: eventdata.MQTTMessage) => void): void;
|
||||
emitMQTTMessagePublished(data: eventdata.MQTTMessagePublished): void;
|
||||
onMQTTMessagePublished(key: ListenerKey, callback: (data: eventdata.MQTTMessagePublished) => void): void;
|
||||
emitPublishEntityState(data: eventdata.PublishEntityState): void;
|
||||
onPublishEntityState(key: ListenerKey, callback: (data: eventdata.PublishEntityState) => void): void;
|
||||
emitGroupMembersChanged(data: eventdata.GroupMembersChanged): void;
|
||||
onGroupMembersChanged(key: ListenerKey, callback: (data: eventdata.GroupMembersChanged) => void): void;
|
||||
emitDevicesChanged(): void;
|
||||
onDevicesChanged(key: ListenerKey, callback: () => void): void;
|
||||
emitScenesChanged(data: eventdata.ScenesChanged): void;
|
||||
onScenesChanged(key: ListenerKey, callback: (data: eventdata.ScenesChanged) => void): void;
|
||||
emitReconfigure(data: eventdata.Reconfigure): void;
|
||||
onReconfigure(key: ListenerKey, callback: (data: eventdata.Reconfigure) => void): void;
|
||||
emitStateChange(data: eventdata.StateChange): void;
|
||||
onStateChange(key: ListenerKey, callback: (data: eventdata.StateChange) => void): void;
|
||||
emitExposesAndDevicesChanged(device: Device): void;
|
||||
private on;
|
||||
removeListeners(key: ListenerKey): void;
|
||||
}
|
||||
export {};
|
||||
//# sourceMappingURL=eventBus.d.ts.map
|
||||
Vendored
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"eventBus.d.ts","sourceRoot":"","sources":["../lib/eventBus.ts"],"names":[],"mappings":"AAIA,KAAK,WAAW,GAAG,MAAM,CAAC;AAgC1B,KAAK,KAAK,GAAG;IACT,OAAO,EAAE,GAAG,CACR,MAAM,EAAE,eAAe;IACvB;QACI,eAAe,CAAC,EAAE;YAAC,QAAQ,EAAE,MAAM,CAAC;YAAC,KAAK,EAAE,MAAM,CAAA;SAAC,CAAC;QACpD,WAAW,EAAE,MAAM,CAAC;QACpB,qBAAqB,EAAE,MAAM,CAAC;KACjC,CACJ,CAAC;IACF,IAAI,E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I,EAAE,SAAS,CAAC,WAAW,KAAK,IAAI,GAAG,IAAI;IAItF,eAAe,CAAC,IAAI,EAAE,SAAS,CAAC,WAAW,GAAG,IAAI;IAGlD,aAAa,CAAC,GAAG,EAAE,WAAW,EAAE,QAAQ,EAAE,CAAC,IAAI,EAAE,SAAS,CAAC,WAAW,KAAK,IAAI,GAAG,IAAI;IAItF,4BAA4B,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI;IAKzD,OAAO,CAAC,EAAE;IAoBH,eAAe,CAAC,GAAG,EAAE,WAAW,GAAG,IAAI;CASjD"}
|
||||
Vendored
+34
@@ -0,0 +1,34 @@
|
||||
import Extension from "./extension";
|
||||
export default class Availability extends Extension {
|
||||
/** Mapped by IEEE address */
|
||||
private readonly timers;
|
||||
/** Mapped by IEEE address or Group ID */
|
||||
private readonly lastPublishedAvailabilities;
|
||||
/** Mapped by IEEE address */
|
||||
private readonly pingBackoffs;
|
||||
/** IEEE addresses, waiting for last seen changes to take them out of "availability sleep" */
|
||||
private readonly backoffPausedDevices;
|
||||
/** Mapped by IEEE address */
|
||||
private readonly retrieveStateDebouncers;
|
||||
private pingQueue;
|
||||
private pingQueueExecuting;
|
||||
private stopped;
|
||||
private getTimeout;
|
||||
private getMaxJitter;
|
||||
private getBackoff;
|
||||
private getPauseOnBackoffGt;
|
||||
private isActiveDevice;
|
||||
private isAvailable;
|
||||
private resetTimer;
|
||||
private clearTimer;
|
||||
private addToPingQueue;
|
||||
private removeFromPingQueue;
|
||||
private pingQueueExecuteNext;
|
||||
start(): Promise<void>;
|
||||
private publishAvailabilityForAllEntities;
|
||||
private publishAvailability;
|
||||
private onLastSeenChanged;
|
||||
stop(): Promise<void>;
|
||||
private retrieveState;
|
||||
}
|
||||
//# sourceMappingURL=availability.d.ts.map
|
||||
Vendored
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"availability.d.ts","sourceRoot":"","sources":["../../lib/extension/availability.ts"],"names":[],"mappings":"AAYA,OAAO,SAAS,MAAM,aAAa,CAAC;AAQpC,MAAM,CAAC,OAAO,OAAO,YAAa,SAAQ,SAAS;IAC/C,6BAA6B;IAC7B,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAqC;IAC5D,yCAAyC;IACzC,OAAO,CAAC,QAAQ,CAAC,2BAA2B,CAAuC;IACnF,6BAA6B;IAC7B,OAAO,CAAC,QAAQ,CAAC,YAAY,CAA6B;IAC1D,6FAA6F;IAC7F,OAAO,CAAC,QAAQ,CAAC,oBAAoB,CAAqB;IAC1D,6BAA6B;IAC7B,OAAO,CAAC,QAAQ,CAAC,uBAAuB,CAAiC;IACzE,OAAO,CAAC,SAAS,CAAgB;IACjC,OAAO,CAAC,kBAAkB,CAAS;IACnC,OAAO,CAAC,OAAO,CAAS;IAExB,OAAO,CAAC,UAAU;IAQlB,OAAO,CAAC,YAAY;IAQpB,OAAO,CAAC,UAAU;IAQlB,OAAO,CAAC,mBAAmB;IAQ3B,OAAO,CAAC,cAAc;IAOtB,OAAO,CAAC,WAAW;IAgBnB,OAAO,CAAC,UAAU;IAkClB,OAAO,CAAC,UAAU;IAKlB,OAAO,CAAC,cAAc;IAKtB,OAAO,CAAC,mBAAmB;YAOb,oBAAoB;IA4DnB,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;YAiCvB,iCAAiC;YAQjC,mBAAmB;YAoCb,iBAAiB;IAStB,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAWpC,OAAO,CAAC,aAAa;CAiDxB"}
|
||||
Vendored
+14
@@ -0,0 +1,14 @@
|
||||
import Extension from "./extension";
|
||||
export default class Bind extends Extension {
|
||||
private pollDebouncers;
|
||||
start(): Promise<void>;
|
||||
private parseMQTTMessage;
|
||||
private onMQTTMessage;
|
||||
private publishResponse;
|
||||
onGroupMembersChanged(data: eventdata.GroupMembersChanged): Promise<void>;
|
||||
getSetupReportingEndpoints(bind: zh.Bind, coordinatorEp: zh.Endpoint): zh.Endpoint[];
|
||||
setupReporting(binds: zh.Bind[]): Promise<void>;
|
||||
disableUnnecessaryReportings(target: zh.Group | zh.Endpoint): Promise<void>;
|
||||
poll(data: eventdata.DeviceMessage): Promise<void>;
|
||||
}
|
||||
//# sourceMappingURL=bind.d.ts.map
|
||||
Vendored
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"bind.d.ts","sourceRoot":"","sources":["../../lib/extension/bind.ts"],"names":[],"mappings":"AAiBA,OAAO,SAAS,MAAM,aAAa,CAAC;AAiMpC,MAAM,CAAC,OAAO,OAAO,IAAK,SAAQ,SAAS;IACvC,OAAO,CAAC,cAAc,CAAiC;IAGxC,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAMrC,OAAO,CAAC,gBAAgB;YAiFJ,aAAa;YAiHnB,eAAe;IAcjB,qBAAqB,CAAC,IAAI,EAAE,SAAS,CAAC,mBAAmB,GAAG,OAAO,CAAC,IAAI,CAAC;IAuBrF,0BAA0B,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,EAAE,aAAa,EAAE,EAAE,CAAC,QAAQ,GAAG,EAAE,CAAC,QAAQ,EAAE;IAoB9E,cAAc,CAAC,KAAK,EAAE,EAAE,CAAC,IAAI,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAqC/C,4BAA4B,CAAC,MAAM,EAAE,EAAE,CAAC,KAAK,GAAG,EAAE,CAAC,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC;IA0DrE,IAAI,CAAC,IAAI,EAAE,SAAS,CAAC,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC;CAyEjE"}
|
||||
Vendored
+57
@@ -0,0 +1,57 @@
|
||||
import type Group from "../model/group";
|
||||
import type { Zigbee2MQTTDevice, Zigbee2MQTTResponse } from "../types/api";
|
||||
import Device from "../model/device";
|
||||
import Extension from "./extension";
|
||||
export default class Bridge extends Extension {
|
||||
#private;
|
||||
private zigbee2mqttVersion;
|
||||
private zigbeeHerdsmanVersion;
|
||||
private zigbeeHerdsmanConvertersVersion;
|
||||
private coordinatorVersion;
|
||||
private restartRequired;
|
||||
private lastJoinedDeviceIeeeAddr?;
|
||||
private lastBridgeLoggingPayload?;
|
||||
private logTransport;
|
||||
private requestLookup;
|
||||
start(): Promise<void>;
|
||||
stop(): Promise<void>;
|
||||
onMQTTMessage(data: eventdata.MQTTMessage): Promise<void>;
|
||||
/**
|
||||
* Requests
|
||||
*/
|
||||
deviceOptions(message: KeyValue | string): Promise<Zigbee2MQTTResponse<"bridge/response/device/options">>;
|
||||
groupOptions(message: KeyValue | string): Promise<Zigbee2MQTTResponse<"bridge/response/group/options">>;
|
||||
bridgeOptions(message: KeyValue | string): Promise<Zigbee2MQTTResponse<"bridge/response/options">>;
|
||||
deviceRemove(message: string | KeyValue): Promise<Zigbee2MQTTResponse<"bridge/response/device/remove">>;
|
||||
groupRemove(message: string | KeyValue): Promise<Zigbee2MQTTResponse<"bridge/response/group/remove">>;
|
||||
healthCheck(message: string | KeyValue): Promise<Zigbee2MQTTResponse<"bridge/response/health_check">>;
|
||||
coordinatorCheck(message: string | KeyValue): Promise<Zigbee2MQTTResponse<"bridge/response/coordinator_check">>;
|
||||
groupAdd(message: string | KeyValue): Promise<Zigbee2MQTTResponse<"bridge/response/group/add">>;
|
||||
deviceRename(message: string | KeyValue): Promise<Zigbee2MQTTResponse<"bridge/response/device/rename">>;
|
||||
groupRename(message: string | KeyValue): Promise<Zigbee2MQTTResponse<"bridge/response/group/rename">>;
|
||||
restart(message: string | KeyValue): Promise<Zigbee2MQTTResponse<"bridge/response/restart">>;
|
||||
backup(message: string | KeyValue): Promise<Zigbee2MQTTResponse<"bridge/response/backup">>;
|
||||
installCodeAdd(message: KeyValue | string): Promise<Zigbee2MQTTResponse<"bridge/response/install_code/add">>;
|
||||
permitJoin(message: KeyValue | string): Promise<Zigbee2MQTTResponse<"bridge/response/permit_join">>;
|
||||
touchlinkIdentify(message: KeyValue | string): Promise<Zigbee2MQTTResponse<"bridge/response/touchlink/identify">>;
|
||||
touchlinkFactoryReset(message: KeyValue | string): Promise<Zigbee2MQTTResponse<"bridge/response/touchlink/factory_reset">>;
|
||||
touchlinkScan(message: KeyValue | string): Promise<Zigbee2MQTTResponse<"bridge/response/touchlink/scan">>;
|
||||
/**
|
||||
* Utils
|
||||
*/
|
||||
changeEntityOptions<T extends "device" | "group">(entityType: T, message: KeyValue | string): Promise<Zigbee2MQTTResponse<T extends "device" ? "bridge/response/device/options" : "bridge/response/group/options">>;
|
||||
deviceConfigureReporting(message: string | KeyValue): Promise<Zigbee2MQTTResponse<"bridge/response/device/configure_reporting">>;
|
||||
deviceInterview(message: string | KeyValue): Promise<Zigbee2MQTTResponse<"bridge/response/device/interview">>;
|
||||
deviceGenerateExternalDefinition(message: string | KeyValue): Promise<Zigbee2MQTTResponse<"bridge/response/device/generate_external_definition">>;
|
||||
renameEntity<T extends "device" | "group">(entityType: T, message: string | KeyValue): Promise<Zigbee2MQTTResponse<T extends "device" ? "bridge/response/device/rename" : "bridge/response/group/rename">>;
|
||||
removeEntity<T extends "device" | "group">(entityType: T, message: string | KeyValue): Promise<Zigbee2MQTTResponse<T extends "device" ? "bridge/response/device/remove" : "bridge/response/group/remove">>;
|
||||
getEntity(type: "group", id: string): Group;
|
||||
getEntity(type: "device", id: string): Device;
|
||||
getEntity(type: "group" | "device", id: string): Device | Group;
|
||||
publishInfo(): Promise<void>;
|
||||
publishDevices(): Promise<void>;
|
||||
publishGroups(): Promise<void>;
|
||||
publishDefinitions(): Promise<void>;
|
||||
getDefinitionPayload(device: Device): Zigbee2MQTTDevice["definition"] | undefined;
|
||||
}
|
||||
//# sourceMappingURL=bridge.d.ts.map
|
||||
Vendored
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"bridge.d.ts","sourceRoot":"","sources":["../../lib/extension/bridge.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,gBAAgB,CAAC;AACxC,OAAO,KAAK,EAAiB,iBAAiB,EAAE,mBAAmB,EAA+B,MAAM,cAAc,CAAC;AAcvH,OAAO,MAAM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I,CAAC;IAsB9B,kBAAkB,IAAI,OAAO,CAAC,IAAI,CAAC;IAazC,oBAAoB,CAAC,MAAM,EAAE,MAAM,GAAG,iBAAiB,CAAC,YAAY,CAAC,GAAG,SAAS;CA4BpF"}
|
||||
Vendored
+14
@@ -0,0 +1,14 @@
|
||||
import Extension from "./extension";
|
||||
/**
|
||||
* This extension calls the zigbee-herdsman-converters definition configure() method
|
||||
*/
|
||||
export default class Configure extends Extension {
|
||||
private configuring;
|
||||
private attempts;
|
||||
private topic;
|
||||
private onReconfigure;
|
||||
private onMQTTMessage;
|
||||
start(): Promise<void>;
|
||||
private configure;
|
||||
}
|
||||
//# sourceMappingURL=configure.d.ts.map
|
||||
Vendored
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"configure.d.ts","sourceRoot":"","sources":["../../lib/extension/configure.ts"],"names":[],"mappings":"AAWA,OAAO,SAAS,MAAM,aAAa,CAAC;AAEpC;;GAEG;AACH,MAAM,CAAC,OAAO,OAAO,SAAU,SAAQ,SAAS;IAC5C,OAAO,CAAC,WAAW,CAAa;IAChC,OAAO,CAAC,QAAQ,CAA6B;IAC7C,OAAO,CAAC,KAAK,CAAuE;YAEhE,aAAa;YAUb,aAAa;IA8BlB,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;YAyBvB,SAAS;CAuD1B"}
|
||||
Vendored
+34
@@ -0,0 +1,34 @@
|
||||
declare abstract class Extension {
|
||||
protected zigbee: Zigbee;
|
||||
protected mqtt: Mqtt;
|
||||
protected state: State;
|
||||
protected publishEntityState: PublishEntityState;
|
||||
protected eventBus: EventBus;
|
||||
protected enableDisableExtension: (enable: boolean, name: string) => Promise<void>;
|
||||
protected restartCallback: () => Promise<void>;
|
||||
protected addExtension: (extension: Extension) => Promise<void>;
|
||||
/**
|
||||
* Besides initializing variables, the constructor should do nothing!
|
||||
*
|
||||
* @param {Zigbee} zigbee Zigbee controller
|
||||
* @param {Mqtt} mqtt MQTT controller
|
||||
* @param {State} state State controller
|
||||
* @param {Function} publishEntityState Method to publish device state to MQTT.
|
||||
* @param {EventBus} eventBus The event bus
|
||||
* @param {enableDisableExtension} enableDisableExtension Enable/disable extension method
|
||||
* @param {restartCallback} restartCallback Restart Zigbee2MQTT
|
||||
* @param {addExtension} addExtension Add an extension
|
||||
*/
|
||||
constructor(zigbee: Zigbee, mqtt: Mqtt, state: State, publishEntityState: PublishEntityState, eventBus: EventBus, enableDisableExtension: (enable: boolean, name: string) => Promise<void>, restartCallback: () => Promise<void>, addExtension: (extension: Extension) => Promise<void>);
|
||||
/**
|
||||
* Is called once the extension has to start
|
||||
*/
|
||||
start(): Promise<void>;
|
||||
/**
|
||||
* Is called once the extension has to stop
|
||||
*/
|
||||
stop(): Promise<void>;
|
||||
adjustMessageBeforePublish(_entity: Group | Device, _message: KeyValue): void;
|
||||
}
|
||||
export default Extension;
|
||||
//# sourceMappingURL=extension.d.ts.map
|
||||
Vendored
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"extension.d.ts","sourceRoot":"","sources":["../../lib/extension/extension.ts"],"names":[],"mappings":"AAAA,uBAAe,SAAS;IACpB,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC;IACzB,SAAS,CAAC,IAAI,EAAE,IAAI,CAAC;IACrB,SAAS,CAAC,KAAK,EAAE,KAAK,CAAC;IACvB,SAAS,CAAC,kBAAkB,EAAE,kBAAkB,CAAC;IACjD,SAAS,CAAC,QAAQ,EAAE,QAAQ,CAAC;IAC7B,SAAS,CAAC,sBAAsB,EAAE,CAAC,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACnF,SAAS,CAAC,eAAe,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAC/C,SAAS,CAAC,YAAY,EAAE,CAAC,SAAS,EAAE,SAAS,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAEhE;;;;;;;;;;;OAWG;gBAEC,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,IAAI,EACV,KAAK,EAAE,KAAK,EACZ,kBAAkB,EAAE,kBAAkB,EACtC,QAAQ,EAAE,QAAQ,EAClB,sBAAsB,EAAE,CAAC,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,EACxE,eAAe,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,EACpC,YAAY,EAAE,CAAC,SAAS,EAAE,SAAS,KAAK,OAAO,CAAC,IAAI,CAAC;IAYzD;;OAEG;IACG,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAE5B;;OAEG;IAGG,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAIpB,0BAA0B,CAAC,OAAO,EAAE,KAAK,GAAG,MAAM,EAAE,QAAQ,EAAE,QAAQ,GAAG,IAAI;CACvF;AAED,eAAe,SAAS,CAAC"}
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
import type { ExternalDefinitionWithExtend } from "zigbee-herdsman-converters";
|
||||
import ExternalJSExtension from "./externalJS";
|
||||
type TModule = ExternalDefinitionWithExtend | ExternalDefinitionWithExtend[];
|
||||
export default class ExternalConverters extends ExternalJSExtension<TModule> {
|
||||
constructor(zigbee: Zigbee, mqtt: Mqtt, state: State, publishEntityState: PublishEntityState, eventBus: EventBus, enableDisableExtension: (enable: boolean, name: string) => Promise<void>, restartCallback: () => Promise<void>, addExtension: (extension: Extension) => Promise<void>);
|
||||
protected removeJS(name: string, _mod: TModule): Promise<void>;
|
||||
protected loadJS(name: string, mod: TModule, newName?: string): Promise<void>;
|
||||
}
|
||||
export {};
|
||||
//# sourceMappingURL=externalConverters.d.ts.map
|
||||
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"externalConverters.d.ts","sourceRoot":"","sources":["../../lib/extension/externalConverters.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,4BAA4B,EAAC,MAAM,4BAA4B,CAAC;AAK7E,OAAO,mBAAmB,MAAM,cAAc,CAAC;AAE/C,KAAK,OAAO,GAAG,4BAA4B,GAAG,4BAA4B,EAAE,CAAC;AAE7E,MAAM,CAAC,OAAO,OAAO,kBAAmB,SAAQ,mBAAmB,CAAC,OAAO,CAAC;gBAEpE,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,IAAI,EACV,KAAK,EAAE,KAAK,EACZ,kBAAkB,EAAE,kBAAkB,EACtC,QAAQ,EAAE,QAAQ,EAClB,sBAAsB,EAAE,CAAC,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,EACxE,eAAe,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,EACpC,YAAY,EAAE,CAAC,SAAS,EAAE,SAAS,KAAK,OAAO,CAAC,IAAI,CAAC;cAgBzC,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC;cAMpD,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CA0BtF"}
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
import type Extension from "./extension";
|
||||
import ExternalJSExtension from "./externalJS";
|
||||
type TModule = new (...args: ConstructorParameters<typeof Extension>) => Extension;
|
||||
export default class ExternalExtensions extends ExternalJSExtension<TModule> {
|
||||
constructor(zigbee: Zigbee, mqtt: Mqtt, state: State, publishEntityState: PublishEntityState, eventBus: EventBus, enableDisableExtension: (enable: boolean, name: string) => Promise<void>, restartCallback: () => Promise<void>, addExtension: (extension: Extension) => Promise<void>);
|
||||
protected removeJS(_name: string, mod: TModule): Promise<void>;
|
||||
protected loadJS(name: string, mod: TModule, newName?: string): Promise<void>;
|
||||
}
|
||||
export {};
|
||||
//# sourceMappingURL=externalExtensions.d.ts.map
|
||||
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"externalExtensions.d.ts","sourceRoot":"","sources":["../../lib/extension/externalExtensions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,SAAS,MAAM,aAAa,CAAC;AAIzC,OAAO,mBAAmB,MAAM,cAAc,CAAC;AAE/C,KAAK,OAAO,GAAG,KAAK,GAAG,IAAI,EAAE,qBAAqB,CAAC,OAAO,SAAS,CAAC,KAAK,SAAS,CAAC;AAEnF,MAAM,CAAC,OAAO,OAAO,kBAAmB,SAAQ,mBAAmB,CAAC,OAAO,CAAC;gBAEpE,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,IAAI,EACV,KAAK,EAAE,KAAK,EACZ,kBAAkB,EAAE,kBAAkB,EACtC,QAAQ,EAAE,QAAQ,EAClB,sBAAsB,EAAE,CAAC,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,EACxE,eAAe,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,EACpC,YAAY,EAAE,CAAC,SAAS,EAAE,SAAS,KAAK,OAAO,CAAC,IAAI,CAAC;cAgBzC,QAAQ,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC;cAIpD,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAgCtF"}
|
||||
Vendored
+32
@@ -0,0 +1,32 @@
|
||||
import Extension from "./extension";
|
||||
export default abstract class ExternalJSExtension<M> extends Extension {
|
||||
protected folderName: string;
|
||||
protected mqttTopic: string;
|
||||
protected requestRegex: RegExp;
|
||||
protected basePath: string;
|
||||
protected nodeModulesSymlinked: boolean;
|
||||
constructor(zigbee: Zigbee, mqtt: Mqtt, state: State, publishEntityState: PublishEntityState, eventBus: EventBus, enableDisableExtension: (enable: boolean, name: string) => Promise<void>, restartCallback: () => Promise<void>, addExtension: (extension: Extension) => Promise<void>, mqttTopic: string, folderName: string);
|
||||
/**
|
||||
* In case the external JS is not in the Z2M install dir (e.g. when `ZIGBEE2MQTT_DATA` is used), the external
|
||||
* JS cannot import from `node_modules`.
|
||||
* To workaround this create a symlink to `node_modules` in the external JS dir.
|
||||
* https://nodejs.org/api/esm.html#no-node_path
|
||||
*/
|
||||
private symlinkNodeModulesIfNecessary;
|
||||
start(): Promise<void>;
|
||||
private getFilePath;
|
||||
protected getFileCode(name: string): string;
|
||||
protected getFiles(): Generator<{
|
||||
name: string;
|
||||
code: string;
|
||||
}>;
|
||||
onMQTTMessage(data: eventdata.MQTTMessage): Promise<void>;
|
||||
protected abstract removeJS(name: string, mod: M): Promise<void>;
|
||||
protected abstract loadJS(name: string, mod: M, newName?: string): Promise<void>;
|
||||
private remove;
|
||||
private save;
|
||||
private loadFiles;
|
||||
private publishExternalJS;
|
||||
private importFile;
|
||||
}
|
||||
//# sourceMappingURL=externalJS.d.ts.map
|
||||
Vendored
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"externalJS.d.ts","sourceRoot":"","sources":["../../lib/extension/externalJS.ts"],"names":[],"mappings":"AAaA,OAAO,SAAS,MAAM,aAAa,CAAC;AAKpC,MAAM,CAAC,OAAO,CAAC,QAAQ,OAAO,mBAAmB,CAAC,CAAC,CAAE,SAAQ,SAAS;IAClE,SAAS,CAAC,UAAU,EAAE,MAAM,CAAC;IAC7B,SAAS,CAAC,SAAS,EAAE,MAAM,CAAC;IAC5B,SAAS,CAAC,YAAY,EAAE,MAAM,CAAC;IAC/B,SAAS,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC3B,SAAS,CAAC,oBAAoB,UAAS;gBAGnC,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,IAAI,EACV,KAAK,EAAE,KAAK,EACZ,kBAAkB,EAAE,kBAAkB,EACtC,QAAQ,EAAE,QAAQ,EAClB,sBAAsB,EAAE,CAAC,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,EACxE,eAAe,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,EACpC,YAAY,EAAE,CAAC,SAAS,EAAE,SAAS,KAAK,OAAO,CAAC,IAAI,CAAC,EACrD,SAAS,EAAE,MAAM,EACjB,UAAU,EAAE,MAAM;IAUtB;;;;;OAKG;IACH,OAAO,CAAC,6BAA6B;IAqBtB,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAOrC,OAAO,CAAC,WAAW;IAQnB,SAAS,CAAC,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM;IAI3C,SAAS,CAAE,QAAQ,IAAI,SAAS,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAC,CAAC;IAUlD,aAAa,CAAC,IAAI,EAAE,SAAS,CAAC,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;IA8BrE,SAAS,CAAC,QAAQ,CAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;IAEhE,SAAS,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;YAE5D,MAAM;YAwBN,IAAI;YAyBV,SAAS;YAqBT,iBAAiB;YAQjB,UAAU;CAc3B"}
|
||||
Vendored
+21
@@ -0,0 +1,21 @@
|
||||
import Extension from "./extension";
|
||||
/**
|
||||
* This extension servers the frontend
|
||||
*/
|
||||
export declare class Frontend extends Extension {
|
||||
private mqttBaseTopic;
|
||||
private server;
|
||||
private fileServer;
|
||||
private deviceIconsFileServer;
|
||||
private wss;
|
||||
private baseUrl;
|
||||
constructor(zigbee: Zigbee, mqtt: Mqtt, state: State, publishEntityState: PublishEntityState, eventBus: EventBus, enableDisableExtension: (enable: boolean, name: string) => Promise<void>, restartCallback: () => Promise<void>, addExtension: (extension: Extension) => Promise<void>);
|
||||
start(): Promise<void>;
|
||||
stop(): Promise<void>;
|
||||
private onRequest;
|
||||
private onUpgrade;
|
||||
private onWebSocketConnection;
|
||||
private onMQTTPublishMessageOrEntityState;
|
||||
}
|
||||
export default Frontend;
|
||||
//# sourceMappingURL=frontend.d.ts.map
|
||||
Vendored
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"frontend.d.ts","sourceRoot":"","sources":["../../lib/extension/frontend.ts"],"names":[],"mappings":"AAsBA,OAAO,SAAS,MAAM,aAAa,CAAC;AAEpC;;GAEG;AACH,qBAAa,QAAS,SAAQ,SAAS;IACnC,OAAO,CAAC,aAAa,CAAS;IAC9B,OAAO,CAAC,MAAM,CAAU;IACxB,OAAO,CAAC,UAAU,CAAkB;IACpC,OAAO,CAAC,qBAAqB,CAAkB;IAC/C,OAAO,CAAC,GAAG,CAAoB;IAC/B,OAAO,CAAC,OAAO,CAAS;gBAGpB,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,IAAI,EACV,KAAK,EAAE,KAAK,EACZ,kBAAkB,EAAE,kBAAkB,EACtC,QAAQ,EAAE,QAAQ,EAClB,sBAAsB,EAAE,CAAC,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,EACxE,eAAe,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,EACpC,YAAY,EAAE,CAAC,SAAS,EAAE,SAAS,KAAK,OAAO,CAAC,IAAI,CAAC;IAU1C,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAyDtB,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAe9B,OAAO,CAAC,SAAS;IA2BjB,OAAO,CAAC,SAAS;IAcjB,OAAO,CAAC,qBAAqB;IAsC7B,OAAO,CAAC,iCAAiC;CA4BlD;AAED,eAAe,QAAQ,CAAC"}
|
||||
Vendored
+12
@@ -0,0 +1,12 @@
|
||||
import Extension from "./extension";
|
||||
export default class Groups extends Extension {
|
||||
private lastOptimisticState;
|
||||
start(): Promise<void>;
|
||||
onStateChange(data: eventdata.StateChange): Promise<void>;
|
||||
private shouldPublishPayloadForGroup;
|
||||
private areAllMembersOffOrClosed;
|
||||
private parseMQTTMessage;
|
||||
private onMQTTMessage;
|
||||
private publishResponse;
|
||||
}
|
||||
//# sourceMappingURL=groups.d.ts.map
|
||||
Vendored
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"groups.d.ts","sourceRoot":"","sources":["../../lib/extension/groups.ts"],"names":[],"mappings":"AAeA,OAAO,SAAS,MAAM,aAAa,CAAC;AA4BpC,MAAM,CAAC,OAAO,OAAO,MAAO,SAAQ,SAAS;IACzC,OAAO,CAAC,mBAAmB,CAA+B;IAG3C,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAKzB,aAAa,CAAC,IAAI,EAAE,SAAS,CAAC,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;IAsGrE,OAAO,CAAC,4BAA4B;IASpC,OAAO,CAAC,wBAAwB;IAyBhC,OAAO,CAAC,gBAAgB;YAsEJ,aAAa;YA6DnB,eAAe;CAahC"}
|
||||
Vendored
+8
@@ -0,0 +1,8 @@
|
||||
import Extension from "./extension";
|
||||
export default class Health extends Extension {
|
||||
#private;
|
||||
start(): Promise<void>;
|
||||
stop(): Promise<void>;
|
||||
clearStats(): void;
|
||||
}
|
||||
//# sourceMappingURL=health.d.ts.map
|
||||
Vendored
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"health.d.ts","sourceRoot":"","sources":["../../lib/extension/health.ts"],"names":[],"mappings":"AAKA,OAAO,SAAS,MAAM,aAAa,CAAC;AAOpC,MAAM,CAAC,OAAO,OAAO,MAAO,SAAQ,SAAS;;IAG1B,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAMtB,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAKpC,UAAU,IAAI,IAAI;CAkDrB"}
|
||||
Vendored
+83
@@ -0,0 +1,83 @@
|
||||
import Extension from "./extension";
|
||||
interface MockProperty {
|
||||
property: string;
|
||||
value: KeyValue | string | null;
|
||||
}
|
||||
interface DiscoveryEntry {
|
||||
mockProperties: MockProperty[];
|
||||
type: string;
|
||||
object_id: string;
|
||||
discovery_payload: KeyValue;
|
||||
}
|
||||
interface ActionData {
|
||||
action: string;
|
||||
button?: string;
|
||||
scene?: string;
|
||||
region?: string;
|
||||
}
|
||||
/**
|
||||
* This class handles the bridge entity configuration for Home Assistant Discovery.
|
||||
*/
|
||||
declare class Bridge {
|
||||
private coordinatorIeeeAddress;
|
||||
private coordinatorType;
|
||||
private coordinatorFirmwareVersion;
|
||||
private discoveryEntries;
|
||||
readonly options: {
|
||||
ID?: string;
|
||||
homeassistant?: KeyValue;
|
||||
};
|
||||
get ID(): string;
|
||||
get name(): string;
|
||||
get hardwareVersion(): string;
|
||||
get firmwareVersion(): string;
|
||||
get configs(): DiscoveryEntry[];
|
||||
constructor(ieeeAdress: string, version: zh.CoordinatorVersion, discovery: DiscoveryEntry[]);
|
||||
isDevice(): this is Device;
|
||||
isGroup(): this is Group;
|
||||
}
|
||||
/**
|
||||
* This extensions handles integration with HomeAssistant
|
||||
*/
|
||||
export declare class HomeAssistant extends Extension {
|
||||
private discovered;
|
||||
private discoveryTopic;
|
||||
private discoveryRegex;
|
||||
private discoveryRegexWoTopic;
|
||||
private statusTopic;
|
||||
private legacyActionSensor;
|
||||
private experimentalEventEntities;
|
||||
private zigbee2MQTTVersion;
|
||||
private discoveryOrigin;
|
||||
private bridge;
|
||||
private bridgeIdentifier;
|
||||
private actionValueTemplate;
|
||||
constructor(zigbee: Zigbee, mqtt: Mqtt, state: State, publishEntityState: PublishEntityState, eventBus: EventBus, enableDisableExtension: (enable: boolean, name: string) => Promise<void>, restartCallback: () => Promise<void>, addExtension: (extension: Extension) => Promise<void>);
|
||||
start(): Promise<void>;
|
||||
private getDiscovered;
|
||||
private exposeToConfig;
|
||||
onEntityRemoved(data: eventdata.EntityRemoved): Promise<void>;
|
||||
onGroupMembersChanged(data: eventdata.GroupMembersChanged): Promise<void>;
|
||||
onPublishEntityState(data: eventdata.PublishEntityState): Promise<void>;
|
||||
onEntityRenamed(data: eventdata.EntityRenamed): Promise<void>;
|
||||
private getConfigs;
|
||||
private discover;
|
||||
private onMQTTMessage;
|
||||
onZigbeeEvent(data: {
|
||||
device: Device;
|
||||
}): Promise<void>;
|
||||
onScenesChanged(data: eventdata.ScenesChanged): Promise<void>;
|
||||
private getDevicePayload;
|
||||
adjustMessageBeforePublish(entity: Device | Group | Bridge, message: KeyValue): void;
|
||||
private getEncodedBaseTopic;
|
||||
private getDiscoveryTopic;
|
||||
private publishDeviceTriggerDiscover;
|
||||
private getBridgeEntity;
|
||||
parseActionValue(action: string): ActionData;
|
||||
private buildAction;
|
||||
private prepareActionEventTypes;
|
||||
private parseGroupsFromRegex;
|
||||
private getActionValueTemplate;
|
||||
}
|
||||
export default HomeAssistant;
|
||||
//# sourceMappingURL=homeassistant.d.ts.map
|
||||
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"homeassistant.d.ts","sourceRoot":"","sources":["../../lib/extension/homeassistant.ts"],"names":[],"mappings":"AAUA,OAAO,SAAS,MAAM,aAAa,CAAC;AAEpC,UAAU,YAAY;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,QAAQ,GAAG,MAAM,GAAG,IAAI,CAAC;CACnC;AAED,UAAU,cAAc;IACpB,cAAc,EAAE,YAAY,EAAE,CAAC;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,iBAAiB,EAAE,QAAQ,CAAC;CAC/B;AASD,UAAU,UAAU;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;CACnB;AA0QD;;GAEG;AACH,cAAM,MAAM;IACR,OAAO,CAAC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vendored
+15
@@ -0,0 +1,15 @@
|
||||
import type { Zigbee2MQTTNetworkMap } from "../types/api";
|
||||
import Extension from "./extension";
|
||||
/**
|
||||
* This extension creates a network map
|
||||
*/
|
||||
export default class NetworkMap extends Extension {
|
||||
private topic;
|
||||
start(): Promise<void>;
|
||||
onMQTTMessage(data: eventdata.MQTTMessage): Promise<void>;
|
||||
raw(topology: Zigbee2MQTTNetworkMap): Zigbee2MQTTNetworkMap;
|
||||
graphviz(topology: Zigbee2MQTTNetworkMap): string;
|
||||
plantuml(topology: Zigbee2MQTTNetworkMap): string;
|
||||
networkScan(includeRoutes: boolean): Promise<Zigbee2MQTTNetworkMap>;
|
||||
}
|
||||
//# sourceMappingURL=networkMap.d.ts.map
|
||||
Vendored
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"networkMap.d.ts","sourceRoot":"","sources":["../../lib/extension/networkMap.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAiB,qBAAqB,EAAC,MAAM,cAAc,CAAC;AAQxE,OAAO,SAAS,MAAM,aAAa,CAAC;AAIpC;;GAEG;AACH,MAAM,CAAC,OAAO,OAAO,UAAW,SAAQ,SAAS;IAC7C,OAAO,CAAC,KAAK,CAAiE;IAG/D,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAIzB,aAAa,CAAC,IAAI,EAAE,SAAS,CAAC,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;IAqCrE,GAAG,CAAC,QAAQ,EAAE,qBAAqB,GAAG,qBAAqB;IAI3D,QAAQ,CAAC,QAAQ,EAAE,qBAAqB,GAAG,MAAM;IAqEjD,QAAQ,CAAC,QAAQ,EAAE,qBAAqB,GAAG,MAAM;IAqD3C,WAAW,CAAC,aAAa,EAAE,OAAO,GAAG,OAAO,CAAC,qBAAqB,CAAC;CA0I5E"}
|
||||
Vendored
+10
@@ -0,0 +1,10 @@
|
||||
import Extension from "./extension";
|
||||
/**
|
||||
* This extension calls the zigbee-herdsman-converters onEvent.
|
||||
*/
|
||||
export default class OnEvent extends Extension {
|
||||
start(): Promise<void>;
|
||||
stop(): Promise<void>;
|
||||
private callOnEvent;
|
||||
}
|
||||
//# sourceMappingURL=onEvent.d.ts.map
|
||||
Vendored
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"onEvent.d.ts","sourceRoot":"","sources":["../../lib/extension/onEvent.ts"],"names":[],"mappings":"AAGA,OAAO,SAAS,MAAM,aAAa,CAAC;AAEpC;;GAEG;AACH,MAAM,CAAC,OAAO,OAAO,OAAQ,SAAQ,SAAS;IAE3B,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAwCtB,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;YAQtB,WAAW;CAe5B"}
|
||||
Vendored
+25
@@ -0,0 +1,25 @@
|
||||
import Extension from "./extension";
|
||||
type UpdateState = "updating" | "idle" | "available" | "scheduled";
|
||||
export interface UpdatePayload {
|
||||
update: {
|
||||
progress?: number;
|
||||
remaining?: number;
|
||||
state: UpdateState;
|
||||
installed_version: number | null;
|
||||
latest_version: number | null;
|
||||
};
|
||||
}
|
||||
export default class OTAUpdate extends Extension {
|
||||
private inProgress;
|
||||
private lastChecked;
|
||||
private scheduledUpgrades;
|
||||
private scheduledDowngrades;
|
||||
start(): Promise<void>;
|
||||
private removeProgressAndRemainingFromState;
|
||||
private onZigbeeEvent;
|
||||
private readSoftwareBuildIDAndDateCode;
|
||||
private getEntityPublishPayload;
|
||||
onMQTTMessage(data: eventdata.MQTTMessage): Promise<void>;
|
||||
}
|
||||
export {};
|
||||
//# sourceMappingURL=otaUpdate.d.ts.map
|
||||
Vendored
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"otaUpdate.d.ts","sourceRoot":"","sources":["../../lib/extension/otaUpdate.ts"],"names":[],"mappings":"AAkBA,OAAO,SAAS,MAAM,aAAa,CAAC;AAEpC,KAAK,WAAW,GAAG,UAAU,GAAG,MAAM,GAAG,WAAW,GAAG,WAAW,CAAC;AAEnE,MAAM,WAAW,aAAa;IAC1B,MAAM,EAAE;QACJ,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,KAAK,EAAE,WAAW,CAAC;QACnB,iBAAiB,EAAE,MAAM,GAAG,IAAI,CAAC;QACjC,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;KACjC,CAAC;CACL;AAOD,MAAM,CAAC,OAAO,OAAO,SAAU,SAAQ,SAAS;IAC5C,OAAO,CAAC,UAAU,CAAqB;IACvC,OAAO,CAAC,WAAW,CAA6B;IAChD,OAAO,CAAC,iBAAiB,CAAqB;IAC9C,OAAO,CAAC,mBAAmB,CAAqB;IAGjC,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAiCrC,OAAO,CAAC,mCAAmC;YASvB,aAAa;YAoInB,8BAA8B;IAc5C,OAAO,CAAC,uBAAuB;IA0BnB,aAAa,CAAC,IAAI,EAAE,SAAS,CAAC,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;CA0LxE"}
|
||||
Vendored
+18
@@ -0,0 +1,18 @@
|
||||
import Extension from "./extension";
|
||||
export declare const loadTopicGetSetRegex: () => void;
|
||||
interface ParsedTopic {
|
||||
ID: string;
|
||||
endpoint: string | undefined;
|
||||
attribute: string;
|
||||
type: "get" | "set";
|
||||
}
|
||||
export default class Publish extends Extension {
|
||||
start(): Promise<void>;
|
||||
parseTopic(topic: string): ParsedTopic | undefined;
|
||||
parseMessage(parsedTopic: ParsedTopic, data: eventdata.MQTTMessage): KeyValue | undefined;
|
||||
updateMessageHomeAssistant(message: KeyValue, entityState: KeyValue): void;
|
||||
onMQTTMessage(data: eventdata.MQTTMessage): Promise<void>;
|
||||
private getDefinitionConverters;
|
||||
}
|
||||
export {};
|
||||
//# sourceMappingURL=publish.d.ts.map
|
||||
Vendored
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"publish.d.ts","sourceRoot":"","sources":["../../lib/extension/publish.ts"],"names":[],"mappings":"AAUA,OAAO,SAAS,MAAM,aAAa,CAAC;AAIpC,eAAO,MAAM,oBAAoB,QAAO,IAEvC,CAAC;AAMF,UAAU,WAAW;IACjB,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAC;IAC7B,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,KAAK,GAAG,KAAK,CAAC;CACvB;AAED,MAAM,CAAC,OAAO,OAAO,OAAQ,SAAQ,SAAS;IAE3B,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAIrC,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,WAAW,GAAG,SAAS;IAwBlD,YAAY,CAAC,WAAW,EAAE,WAAW,EAAE,IAAI,EAAE,SAAS,CAAC,WAAW,GAAG,QAAQ,GAAG,SAAS;IAgBzF,0BAA0B,CAAC,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,QAAQ,GAAG,IAAI;IAiB9D,aAAa,CAAC,IAAI,EAAE,SAAS,CAAC,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;IAkNrE,OAAO,CAAC,uBAAuB;CAOlC"}
|
||||
Vendored
+13
@@ -0,0 +1,13 @@
|
||||
import Extension from "./extension";
|
||||
export default class Receive extends Extension {
|
||||
private elapsed;
|
||||
private debouncers;
|
||||
private throttlers;
|
||||
start(): Promise<void>;
|
||||
onPublishEntityState(data: eventdata.PublishEntityState): void;
|
||||
publishDebounce(device: Device, payload: KeyValue, time: number, debounceIgnore: string[] | undefined): void;
|
||||
publishThrottle(device: Device, payload: KeyValue, time: number): Promise<void>;
|
||||
isPayloadConflicted(newPayload: KeyValue, oldPayload: KeyValue, debounceIgnore: string[] | undefined): boolean;
|
||||
onDeviceMessage(data: eventdata.DeviceMessage): Promise<void>;
|
||||
}
|
||||
//# sourceMappingURL=receive.d.ts.map
|
||||
Vendored
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"receive.d.ts","sourceRoot":"","sources":["../../lib/extension/receive.ts"],"names":[],"mappings":"AAYA,OAAO,SAAS,MAAM,aAAa,CAAC;AAIpC,MAAM,CAAC,OAAO,OAAO,OAAQ,SAAQ,SAAS;IAE1C,OAAO,CAAC,OAAO,CAA6B;IAC5C,OAAO,CAAC,UAAU,CAAqE;IACvF,OAAO,CAAC,UAAU,CAAoD;IAGvD,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAK/B,oBAAoB,CAAC,IAAI,EAAE,SAAS,CAAC,kBAAkB,GAAG,IAAI;IAkBpE,eAAe,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,EAAE,GAAG,SAAS,GAAG,IAAI;IA4BtG,eAAe,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAkBrF,mBAAmB,CAAC,UAAU,EAAE,QAAQ,EAAE,UAAU,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,EAAE,GAAG,SAAS,GAAG,OAAO;IAYlG,eAAe,CAAC,IAAI,EAAE,SAAS,CAAC,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC;CAqF5E"}
|
||||
Vendored
+25
@@ -0,0 +1,25 @@
|
||||
import type { CustomClusters } from "zigbee-herdsman/dist/zspec/zcl/definition/tstype";
|
||||
import * as zhc from "zigbee-herdsman-converters";
|
||||
export default class Device {
|
||||
zh: zh.Device;
|
||||
definition?: zhc.Definition;
|
||||
private _definitionModelID?;
|
||||
get ieeeAddr(): string;
|
||||
get ID(): string;
|
||||
get options(): DeviceOptionsWithId;
|
||||
get name(): string;
|
||||
get isSupported(): boolean;
|
||||
get customClusters(): CustomClusters;
|
||||
get otaExtraMetas(): zhc.Ota.ExtraMetas;
|
||||
get interviewed(): boolean;
|
||||
constructor(device: zh.Device);
|
||||
exposes(): zhc.Expose[];
|
||||
resolveDefinition(ignoreCache?: boolean): Promise<void>;
|
||||
ensureInSettings(): void;
|
||||
endpoint(key?: string | number): zh.Endpoint | undefined;
|
||||
endpointName(endpoint: zh.Endpoint): string | undefined;
|
||||
getEndpointNames(): string[];
|
||||
isDevice(): this is Device;
|
||||
isGroup(): this is Group;
|
||||
}
|
||||
//# sourceMappingURL=device.d.ts.map
|
||||
Vendored
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"device.d.ts","sourceRoot":"","sources":["../../lib/model/device.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,kDAAkD,CAAC;AAIrF,OAAO,KAAK,GAAG,MAAM,4BAA4B,CAAC;AAalD,MAAM,CAAC,OAAO,OAAO,MAAM;IAChB,EAAE,EAAE,EAAE,CAAC,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,GAAG,CAAC,UAAU,CAAC;IACnC,OAAO,CAAC,kBAAkB,CAAC,CAAS;IAEpC,IAAI,QAAQ,IAAI,MAAM,CAErB;IAED,IAAI,EAAE,IAAI,MAAM,CAEf;IACD,IAAI,OAAO,IAAI,mBAAmB,CAGjC;IACD,IAAI,IAAI,IAAI,MAAM,CAEjB;IACD,IAAI,WAAW,IAAI,OAAO,CAEzB;IACD,IAAI,cAAc,IAAI,cAAc,CAEnC;IACD,IAAI,aAAa,IAAI,GAAG,CAAC,GAAG,CAAC,UAAU,CAEtC;IACD,IAAI,WAAW,IAAI,OAAO,CAEzB;gBAEW,MAAM,EAAE,EAAE,CAAC,MAAM;IAI7B,OAAO,IAAI,GAAG,CAAC,MAAM,EAAE;IAajB,iBAAiB,CAAC,WAAW,UAAQ,GAAG,OAAO,CAAC,IAAI,CAAC;IAO3D,gBAAgB,IAAI,IAAI;IAMxB,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,EAAE,CAAC,QAAQ,GAAG,SAAS;IA8BxD,YAAY,CAAC,QAAQ,EAAE,EAAE,CAAC,QAAQ,GAAG,MAAM,GAAG,SAAS;IAgBvD,gBAAgB,IAAI,MAAM,EAAE;IAY5B,QAAQ,IAAI,IAAI,IAAI,MAAM;IAI1B,OAAO,IAAI,IAAI,IAAI,KAAK;CAG3B"}
|
||||
Vendored
+15
@@ -0,0 +1,15 @@
|
||||
import type * as zhc from "zigbee-herdsman-converters";
|
||||
export default class Group {
|
||||
zh: zh.Group;
|
||||
private resolveDevice;
|
||||
get ID(): number;
|
||||
get options(): GroupOptions;
|
||||
get name(): string;
|
||||
constructor(group: zh.Group, resolveDevice: (ieeeAddr: string) => Device | undefined);
|
||||
hasMember(device: Device): boolean;
|
||||
membersDevices(): Generator<Device>;
|
||||
membersDefinitions(): zhc.Definition[];
|
||||
isDevice(): this is Device;
|
||||
isGroup(): this is Group;
|
||||
}
|
||||
//# sourceMappingURL=group.d.ts.map
|
||||
Vendored
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"group.d.ts","sourceRoot":"","sources":["../../lib/model/group.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,GAAG,MAAM,4BAA4B,CAAC;AAIvD,MAAM,CAAC,OAAO,OAAO,KAAK;IACf,EAAE,EAAE,EAAE,CAAC,KAAK,CAAC;IACpB,OAAO,CAAC,aAAa,CAA2C;IAGhE,IAAI,EAAE,IAAI,MAAM,CAEf;IACD,IAAI,OAAO,IAAI,YAAY,CAG1B;IACD,IAAI,IAAI,IAAI,MAAM,CAEjB;gBAEW,KAAK,EAAE,EAAE,CAAC,KAAK,EAAE,aAAa,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,MAAM,GAAG,SAAS;IAKpF,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO;IAIjC,cAAc,IAAI,SAAS,CAAC,MAAM,CAAC;IAUpC,kBAAkB,IAAI,GAAG,CAAC,UAAU,EAAE;IAYtC,QAAQ,IAAI,IAAI,IAAI,MAAM;IAG1B,OAAO,IAAI,IAAI,IAAI,KAAK;CAG3B"}
|
||||
Vendored
+43
@@ -0,0 +1,43 @@
|
||||
import type { IClientPublishOptions } from "mqtt";
|
||||
export interface MqttPublishOptions {
|
||||
clientOptions: IClientPublishOptions;
|
||||
baseTopic: string;
|
||||
skipLog: boolean;
|
||||
skipReceive: boolean;
|
||||
meta: {
|
||||
isEntityState?: boolean;
|
||||
};
|
||||
}
|
||||
export default class Mqtt {
|
||||
private publishedTopics;
|
||||
private connectionTimer?;
|
||||
private client;
|
||||
private eventBus;
|
||||
private republishRetainedTimer?;
|
||||
private defaultPublishOptions;
|
||||
retainedMessages: {
|
||||
[s: string]: {
|
||||
topic: string;
|
||||
payload: string;
|
||||
options: MqttPublishOptions;
|
||||
};
|
||||
};
|
||||
get info(): {
|
||||
version: 3 | 4 | 5 | undefined;
|
||||
server: string;
|
||||
};
|
||||
get stats(): {
|
||||
connected: boolean;
|
||||
queued: number;
|
||||
};
|
||||
constructor(eventBus: EventBus);
|
||||
connect(): Promise<void>;
|
||||
disconnect(): Promise<void>;
|
||||
subscribe(topic: string): Promise<void>;
|
||||
unsubscribe(topic: string): Promise<void>;
|
||||
private onConnect;
|
||||
onMessage(topic: string, message: Buffer): void;
|
||||
isConnected(): boolean;
|
||||
publish(topic: string, payload: string, options?: Partial<MqttPublishOptions>): Promise<void>;
|
||||
}
|
||||
//# sourceMappingURL=mqtt.d.ts.map
|
||||
Vendored
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"mqtt.d.ts","sourceRoot":"","sources":["../lib/mqtt.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAiB,qBAAqB,EAAa,MAAM,MAAM,CAAC;AAe5E,MAAM,WAAW,kBAAkB;IAC/B,aAAa,EAAE,qBAAqB,CAAC;IACrC,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,OAAO,CAAC;IACjB,WAAW,EAAE,OAAO,CAAC;IACrB,IAAI,EAAE;QAAC,aAAa,CAAC,EAAE,OAAO,CAAA;KAAC,CAAC;CACnC;AAED,MAAM,CAAC,OAAO,OAAO,IAAI;IACrB,OAAO,CAAC,eAAe,CAAqB;IAC5C,OAAO,CAAC,eAAe,CAAC,CAAiB;IACzC,OAAO,CAAC,MAAM,CAAc;IAC5B,OAAO,CAAC,QAAQ,CAAW;IAC3B,OAAO,CAAC,sBAAsB,CAAC,CAAiB;IAChD,OAAO,CAAC,qBAAqB,CAAqB;IAC3C,gBAAgB,EAAE;QAAC,CAAC,CAAC,EAAE,MAAM,GAAG;YAAC,KAAK,EAAE,MAAM,CAAC;YAAC,OAAO,EAAE,MAAM,CAAC;YAAC,OAAO,EAAE,kBAAkB,CAAA;SAAC,CAAA;KAAC,CAAM;IAE3G,IAAI,IAAI;;;MAKP;IAED,IAAI,KAAK;;;MAKR;gBAEW,QAAQ,EAAE,QAAQ;IAWxB,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IA8FxB,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;IAY3B,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAIvC,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;YAI3B,SAAS;IAShB,SAAS,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI;IAc5D,WAAW,IAAI,OAAO;IAIhB,OAAO,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,GAAE,OAAO,CAAC,kBAAkB,CAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAmD1G"}
|
||||
Vendored
+19
@@ -0,0 +1,19 @@
|
||||
declare class State {
|
||||
private readonly eventBus;
|
||||
private readonly zigbee;
|
||||
private readonly state;
|
||||
private readonly file;
|
||||
private timer?;
|
||||
constructor(eventBus: EventBus, zigbee: Zigbee);
|
||||
start(): void;
|
||||
stop(): void;
|
||||
clear(): void;
|
||||
private load;
|
||||
private save;
|
||||
exists(entity: Device | Group): boolean;
|
||||
get(entity: Group | Device): KeyValue;
|
||||
set(entity: Group | Device, update: KeyValue, reason?: string): KeyValue;
|
||||
remove(id: string | number): boolean;
|
||||
}
|
||||
export default State;
|
||||
//# sourceMappingURL=state.d.ts.map
|
||||
Vendored
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"state.d.ts","sourceRoot":"","sources":["../lib/state.ts"],"names":[],"mappings":"AAgCA,cAAM,KAAK;IAMH,OAAO,CAAC,QAAQ,CAAC,QAAQ;IACzB,OAAO,CAAC,QAAQ,CAAC,MAAM;IAN3B,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAwC;IAC9D,OAAO,CAAC,QAAQ,CAAC,IAAI,CAA+B;IACpD,OAAO,CAAC,KAAK,CAAC,CAAiB;gBAGV,QAAQ,EAAE,QAAQ,EAClB,MAAM,EAAE,MAAM;IAMnC,KAAK,IAAI,IAAI;IAOb,IAAI,IAAI,IAAI;IAaZ,KAAK,IAAI,IAAI;IAIb,OAAO,CAAC,IAAI;IAoBZ,OAAO,CAAC,IAAI;IAgBZ,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,KAAK,GAAG,OAAO;IAIvC,GAAG,CAAC,MAAM,EAAE,KAAK,GAAG,MAAM,GAAG,QAAQ;IAIrC,GAAG,CAAC,MAAM,EAAE,KAAK,GAAG,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,QAAQ;IAaxE,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO;CAGvC;AAED,eAAe,KAAK,CAAC"}
|
||||
Vendored
+801
@@ -0,0 +1,801 @@
|
||||
import type * as zigbeeHerdsmanConverter from "zigbee-herdsman-converters";
|
||||
import type { Base } from "zigbee-herdsman-converters/lib/exposes";
|
||||
import type * as zigbeeHerdsman from "zigbee-herdsman/dist";
|
||||
import type { ClusterDefinition, ClusterName, CustomClusters } from "zigbee-herdsman/dist/zspec/zcl/definition/tstype";
|
||||
export type * as ZSpec from "zigbee-herdsman/dist/zspec";
|
||||
export type * as Zcl from "zigbee-herdsman/dist/zspec/zcl";
|
||||
export type * as Zdo from "zigbee-herdsman/dist/zspec/zdo";
|
||||
export type Zigbee2MQTTFeatures = {
|
||||
base: Base;
|
||||
switch: zigbeeHerdsmanConverter.Switch;
|
||||
lock: zigbeeHerdsmanConverter.Lock;
|
||||
binary: zigbeeHerdsmanConverter.Binary;
|
||||
list: zigbeeHerdsmanConverter.List;
|
||||
numeric: zigbeeHerdsmanConverter.Numeric;
|
||||
enum: zigbeeHerdsmanConverter.Enum;
|
||||
text: zigbeeHerdsmanConverter.Text;
|
||||
composite: zigbeeHerdsmanConverter.Composite;
|
||||
light: zigbeeHerdsmanConverter.Light;
|
||||
cover: zigbeeHerdsmanConverter.Cover;
|
||||
fan: zigbeeHerdsmanConverter.Fan;
|
||||
climate: zigbeeHerdsmanConverter.Climate;
|
||||
};
|
||||
import type { UpdatePayload } from "../extension/otaUpdate";
|
||||
import type { LogLevel, schemaJson } from "../util/settings";
|
||||
type KeyValue = Record<string, any>;
|
||||
export interface Zigbee2MQTTDeviceOptions {
|
||||
disabled?: boolean;
|
||||
retention?: number;
|
||||
availability?: boolean | {
|
||||
timeout: number;
|
||||
max_jitter?: number;
|
||||
backoff?: boolean;
|
||||
pause_on_backoff_gt?: number;
|
||||
};
|
||||
optimistic?: boolean;
|
||||
debounce?: number;
|
||||
debounce_ignore?: string[];
|
||||
throttle?: number;
|
||||
filtered_attributes?: string[];
|
||||
filtered_cache?: string[];
|
||||
filtered_optimistic?: string[];
|
||||
icon?: string;
|
||||
homeassistant?: KeyValue;
|
||||
friendly_name: string;
|
||||
description?: string;
|
||||
qos?: 0 | 1 | 2;
|
||||
}
|
||||
export interface Zigbee2MQTTGroupOptions {
|
||||
ID: number;
|
||||
optimistic?: boolean;
|
||||
off_state?: "all_members_off" | "last_member_state";
|
||||
filtered_attributes?: string[];
|
||||
filtered_cache?: string[];
|
||||
filtered_optimistic?: string[];
|
||||
homeassistant?: KeyValue;
|
||||
friendly_name: string;
|
||||
description?: string;
|
||||
qos?: 0 | 1 | 2;
|
||||
}
|
||||
export interface Zigbee2MQTTSettings {
|
||||
version?: number;
|
||||
/** only used internally during startup, removed on successful Z2M start */
|
||||
onboarding?: true;
|
||||
homeassistant: {
|
||||
enabled: boolean;
|
||||
discovery_topic: string;
|
||||
status_topic: string;
|
||||
experimental_event_entities: boolean;
|
||||
legacy_action_sensor: boolean;
|
||||
};
|
||||
availability: {
|
||||
enabled: boolean;
|
||||
active: {
|
||||
timeout: number;
|
||||
max_jitter: number;
|
||||
backoff: boolean;
|
||||
pause_on_backoff_gt: number;
|
||||
};
|
||||
passive: {
|
||||
timeout: number;
|
||||
};
|
||||
};
|
||||
mqtt: {
|
||||
base_topic: string;
|
||||
include_device_information: boolean;
|
||||
force_disable_retain: boolean;
|
||||
version?: 3 | 4 | 5;
|
||||
user?: string;
|
||||
password?: string;
|
||||
server: string;
|
||||
ca?: string;
|
||||
keepalive?: number;
|
||||
key?: string;
|
||||
cert?: string;
|
||||
client_id?: string;
|
||||
reject_unauthorized?: boolean;
|
||||
maximum_packet_size: number;
|
||||
};
|
||||
serial: {
|
||||
disable_led: boolean;
|
||||
port?: string;
|
||||
adapter?: "deconz" | "zstack" | "ezsp" | "zigate" | "ember" | "zboss" | "zoh";
|
||||
baudrate?: number;
|
||||
rtscts?: boolean;
|
||||
};
|
||||
passlist: string[];
|
||||
blocklist: string[];
|
||||
map_options: {
|
||||
graphviz: {
|
||||
colors: {
|
||||
fill: {
|
||||
enddevice: string;
|
||||
coordinator: string;
|
||||
router: string;
|
||||
};
|
||||
font: {
|
||||
coordinator: string;
|
||||
router: string;
|
||||
enddevice: string;
|
||||
};
|
||||
line: {
|
||||
active: string;
|
||||
inactive: string;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
ota: {
|
||||
update_check_interval: number;
|
||||
disable_automatic_update_check: boolean;
|
||||
zigbee_ota_override_index_location?: string;
|
||||
image_block_response_delay?: number;
|
||||
default_maximum_data_size?: number;
|
||||
};
|
||||
frontend: {
|
||||
enabled: boolean;
|
||||
package: "zigbee2mqtt-frontend" | "zigbee2mqtt-windfront";
|
||||
auth_token?: string;
|
||||
host?: string;
|
||||
port: number;
|
||||
base_url: string;
|
||||
url?: string;
|
||||
ssl_cert?: string;
|
||||
ssl_key?: string;
|
||||
notification_filter?: string[];
|
||||
};
|
||||
devices: {
|
||||
[s: string]: Zigbee2MQTTDeviceOptions;
|
||||
};
|
||||
groups: {
|
||||
[s: string]: Omit<Zigbee2MQTTGroupOptions, "ID">;
|
||||
};
|
||||
device_options: KeyValue;
|
||||
advanced: {
|
||||
log_rotation: boolean;
|
||||
log_console_json: boolean;
|
||||
log_symlink_current: boolean;
|
||||
log_output: ("console" | "file" | "syslog")[];
|
||||
log_directory: string;
|
||||
log_file: string;
|
||||
log_level: LogLevel;
|
||||
log_namespaced_levels: Record<string, LogLevel>;
|
||||
log_syslog: KeyValue;
|
||||
log_debug_to_mqtt_frontend: boolean;
|
||||
log_debug_namespace_ignore: string;
|
||||
log_directories_to_keep: number;
|
||||
pan_id: number | "GENERATE";
|
||||
ext_pan_id: number[] | "GENERATE";
|
||||
channel: number;
|
||||
adapter_concurrent?: number;
|
||||
adapter_delay?: number;
|
||||
cache_state: boolean;
|
||||
cache_state_persistent: boolean;
|
||||
cache_state_send_on_startup: boolean;
|
||||
last_seen: "disable" | "ISO_8601" | "ISO_8601_local" | "epoch";
|
||||
elapsed: boolean;
|
||||
network_key: number[] | "GENERATE";
|
||||
timestamp_format: string;
|
||||
output: "json" | "attribute" | "attribute_and_json";
|
||||
transmit_power?: number;
|
||||
};
|
||||
health: {
|
||||
/** in minutes */
|
||||
interval: number;
|
||||
reset_on_check: boolean;
|
||||
};
|
||||
}
|
||||
export interface Zigbee2MQTTScene {
|
||||
id: number;
|
||||
name: string;
|
||||
}
|
||||
export interface Zigbee2MQTTDeviceEndpoint {
|
||||
bindings: Zigbee2MQTTDeviceEndpointBinding[];
|
||||
configured_reportings: Zigbee2MQTTDeviceEndpointConfiguredReporting[];
|
||||
clusters: {
|
||||
input: string[];
|
||||
output: string[];
|
||||
};
|
||||
scenes: Zigbee2MQTTScene[];
|
||||
}
|
||||
export interface Zigbee2MQTTDeviceEndpointBinding {
|
||||
cluster: string;
|
||||
target: Zigbee2MQTTDeviceEndpointBindingTarget;
|
||||
}
|
||||
export type Zigbee2MQTTDeviceEndpointBindingTarget = {
|
||||
type: "endpoint";
|
||||
ieee_address: string;
|
||||
endpoint: number;
|
||||
} | {
|
||||
type: "group";
|
||||
id: number;
|
||||
};
|
||||
export interface Zigbee2MQTTDeviceEndpointConfiguredReporting {
|
||||
cluster: string;
|
||||
attribute: string | number;
|
||||
minimum_report_interval: number;
|
||||
maximum_report_interval: number;
|
||||
reportable_change: number;
|
||||
}
|
||||
export interface Zigbee2MQTTDeviceDefinition {
|
||||
model: string;
|
||||
vendor: string;
|
||||
description: string;
|
||||
exposes: zigbeeHerdsmanConverter.Expose[];
|
||||
supports_ota: boolean;
|
||||
options: zigbeeHerdsmanConverter.Option[];
|
||||
icon: string;
|
||||
}
|
||||
export interface Zigbee2MQTTDevice {
|
||||
ieee_address: zigbeeHerdsman.Models.Device["ieeeAddr"];
|
||||
type: zigbeeHerdsman.Models.Device["type"];
|
||||
network_address: zigbeeHerdsman.Models.Device["networkAddress"];
|
||||
supported: boolean;
|
||||
friendly_name: string;
|
||||
disabled: boolean;
|
||||
description?: string;
|
||||
definition?: Zigbee2MQTTDeviceDefinition;
|
||||
power_source: zigbeeHerdsman.Models.Device["powerSource"];
|
||||
software_build_id: zigbeeHerdsman.Models.Device["softwareBuildID"];
|
||||
date_code: zigbeeHerdsman.Models.Device["dateCode"];
|
||||
model_id: zigbeeHerdsman.Models.Device["modelID"];
|
||||
interviewing: boolean;
|
||||
interview_completed: boolean;
|
||||
interview_state: zigbeeHerdsman.Models.Device["interviewState"];
|
||||
manufacturer: zigbeeHerdsman.Models.Device["manufacturerName"];
|
||||
endpoints: Record<number, Zigbee2MQTTDeviceEndpoint>;
|
||||
}
|
||||
export interface Zigbee2MQTTGroupMember {
|
||||
ieee_address: zigbeeHerdsman.Models.Device["ieeeAddr"];
|
||||
endpoint: number;
|
||||
}
|
||||
export interface Zigbee2MQTTGroup {
|
||||
id: number;
|
||||
friendly_name: "default_bind_group" | string;
|
||||
description?: string;
|
||||
scenes: Zigbee2MQTTScene[];
|
||||
members: Zigbee2MQTTGroupMember[];
|
||||
}
|
||||
export interface Zigbee2MQTTNetworkMap {
|
||||
nodes: {
|
||||
ieeeAddr: string;
|
||||
friendlyName: string;
|
||||
type: string;
|
||||
networkAddress: number;
|
||||
manufacturerName?: string;
|
||||
modelID?: string;
|
||||
failed?: string[];
|
||||
lastSeen?: number;
|
||||
definition?: {
|
||||
model: string;
|
||||
vendor: string;
|
||||
supports: string;
|
||||
description: string;
|
||||
};
|
||||
}[];
|
||||
links: {
|
||||
source: {
|
||||
ieeeAddr: string;
|
||||
networkAddress: number;
|
||||
};
|
||||
target: {
|
||||
ieeeAddr: string;
|
||||
networkAddress: number;
|
||||
};
|
||||
linkquality: number;
|
||||
depth: number;
|
||||
routes: {
|
||||
destinationAddress: number;
|
||||
status: string;
|
||||
nextHop: number;
|
||||
}[];
|
||||
sourceIeeeAddr: string;
|
||||
targetIeeeAddr: string;
|
||||
sourceNwkAddr: number;
|
||||
lqi: number;
|
||||
relationship: number;
|
||||
}[];
|
||||
}
|
||||
/**
|
||||
* Zigbee2MQTT state/request/response API endpoints
|
||||
*/
|
||||
export interface Zigbee2MQTTAPI {
|
||||
"bridge/logging": {
|
||||
message: string;
|
||||
level: LogLevel;
|
||||
namespace: string;
|
||||
};
|
||||
"bridge/state": {
|
||||
state: "online" | "offline";
|
||||
};
|
||||
"bridge/definitions": {
|
||||
clusters: Readonly<Record<ClusterName, Readonly<ClusterDefinition>>>;
|
||||
custom_clusters: Record<string, CustomClusters>;
|
||||
};
|
||||
"bridge/event": {
|
||||
type: "device_leave" | "device_joined" | "device_announce";
|
||||
data: {
|
||||
friendly_name: string;
|
||||
ieee_address: string;
|
||||
};
|
||||
} | {
|
||||
type: "device_interview";
|
||||
data: {
|
||||
friendly_name: string;
|
||||
ieee_address: string;
|
||||
status: "started" | "failed";
|
||||
} | {
|
||||
friendly_name: string;
|
||||
ieee_address: string;
|
||||
status: "successful";
|
||||
supported: boolean;
|
||||
definition: Zigbee2MQTTDeviceDefinition | undefined;
|
||||
};
|
||||
};
|
||||
"bridge/info": {
|
||||
os: {
|
||||
version: string;
|
||||
node_version: string;
|
||||
cpus: string;
|
||||
memory_mb: number;
|
||||
};
|
||||
mqtt: {
|
||||
version: number | undefined;
|
||||
server: string;
|
||||
};
|
||||
version: string;
|
||||
commit: string | undefined;
|
||||
zigbee_herdsman_converters: {
|
||||
version: string;
|
||||
};
|
||||
zigbee_herdsman: {
|
||||
version: string;
|
||||
};
|
||||
coordinator: {
|
||||
ieee_address: string;
|
||||
type: string;
|
||||
meta: {
|
||||
[s: string]: number | string;
|
||||
};
|
||||
};
|
||||
network: {
|
||||
pan_id: number;
|
||||
/** `0x${string}` 8-len */
|
||||
extended_pan_id: string;
|
||||
channel: number;
|
||||
};
|
||||
log_level: "debug" | "info" | "warning" | "error";
|
||||
permit_join: boolean;
|
||||
permit_join_end: number | undefined;
|
||||
restart_required: boolean;
|
||||
config: Zigbee2MQTTSettings;
|
||||
config_schema: typeof schemaJson;
|
||||
};
|
||||
"bridge/health": {
|
||||
/** time of message, msec from epoch, UTC */
|
||||
response_time: number;
|
||||
os: {
|
||||
load_average: number[];
|
||||
memory_used_mb: number;
|
||||
memory_percent: number;
|
||||
};
|
||||
process: {
|
||||
uptime_sec: number;
|
||||
memory_used_mb: number;
|
||||
memory_percent: number;
|
||||
};
|
||||
mqtt: {
|
||||
connected: boolean;
|
||||
queued: number;
|
||||
received: number;
|
||||
published: number;
|
||||
};
|
||||
devices: Record<string, {
|
||||
messages: number;
|
||||
messages_per_sec: number;
|
||||
leave_count: number;
|
||||
network_address_changes: number;
|
||||
}>;
|
||||
};
|
||||
"bridge/devices": Zigbee2MQTTDevice[];
|
||||
"bridge/groups": Zigbee2MQTTGroup[];
|
||||
"bridge/converters": {
|
||||
name: string;
|
||||
code: string;
|
||||
}[];
|
||||
"bridge/extensions": {
|
||||
name: string;
|
||||
code: string;
|
||||
}[];
|
||||
"bridge/request/permit_join": {
|
||||
/** [0-254], 0 meaning disable */
|
||||
time: number;
|
||||
device?: string;
|
||||
} | `${number}`;
|
||||
"bridge/response/permit_join": {
|
||||
/** [0-254], 0 meaning disable */
|
||||
time: number;
|
||||
device?: string;
|
||||
};
|
||||
"bridge/request/health_check": "";
|
||||
"bridge/response/health_check": {
|
||||
/** XXX: currently always returns true */
|
||||
healthy: boolean;
|
||||
};
|
||||
"bridge/request/coordinator_check": "";
|
||||
"bridge/response/coordinator_check": {
|
||||
missing_routers: {
|
||||
ieee_address: string;
|
||||
friendly_name: string;
|
||||
}[];
|
||||
};
|
||||
"bridge/request/restart": "";
|
||||
"bridge/response/restart": Record<string, never>;
|
||||
"bridge/request/networkmap": {
|
||||
type: "raw" | "graphviz" | "plantuml";
|
||||
routes: boolean;
|
||||
} | "raw" | "graphviz" | "plantuml";
|
||||
"bridge/response/networkmap": {
|
||||
type: "raw";
|
||||
routes: boolean;
|
||||
value: Zigbee2MQTTNetworkMap;
|
||||
} | {
|
||||
type: "graphviz" | "plantuml";
|
||||
routes: boolean;
|
||||
value: string;
|
||||
};
|
||||
"bridge/request/extension/save": {
|
||||
name: string;
|
||||
code: string;
|
||||
};
|
||||
"bridge/response/extension/save": Record<string, never>;
|
||||
"bridge/request/extension/remove": {
|
||||
name: string;
|
||||
};
|
||||
"bridge/response/extension/remove": Record<string, never>;
|
||||
"bridge/request/converter/save": {
|
||||
name: string;
|
||||
code: string;
|
||||
};
|
||||
"bridge/response/converter/save": Record<string, never>;
|
||||
"bridge/request/converter/remove": {
|
||||
name: string;
|
||||
};
|
||||
"bridge/response/converter/remove": Record<string, never>;
|
||||
"bridge/request/backup": "";
|
||||
"bridge/response/backup": {
|
||||
/** base64 encoded ZIP archive */
|
||||
zip: string;
|
||||
};
|
||||
"bridge/request/install_code/add": {
|
||||
value: string;
|
||||
};
|
||||
"bridge/response/install_code/add": {
|
||||
value: string;
|
||||
};
|
||||
/**
|
||||
* Applied on-the-fly:
|
||||
* - newSettings.homeassistant
|
||||
* - newSettings.advanced?.log_level
|
||||
* - newSettings.advanced?.log_namespaced_levels
|
||||
* - newSettings.advanced?.log_debug_namespace_ignore
|
||||
*/
|
||||
"bridge/request/options": {
|
||||
options: Record<string, unknown>;
|
||||
};
|
||||
"bridge/response/options": {
|
||||
restart_required: boolean;
|
||||
};
|
||||
"bridge/request/device/bind": {
|
||||
from: string;
|
||||
from_endpoint: string | number | "default";
|
||||
to: string | number;
|
||||
to_endpoint?: string | number;
|
||||
clusters?: string[];
|
||||
skip_disable_reporting?: boolean;
|
||||
};
|
||||
"bridge/response/device/bind": {
|
||||
from: string;
|
||||
from_endpoint: string | number;
|
||||
to: string | number;
|
||||
to_endpoint: string | number | undefined;
|
||||
clusters: string[];
|
||||
failed: string[];
|
||||
};
|
||||
"bridge/request/device/unbind": {
|
||||
from: string;
|
||||
from_endpoint: string | number | "default";
|
||||
to: string | number;
|
||||
to_endpoint?: string | number;
|
||||
clusters?: string[];
|
||||
skip_disable_reporting?: boolean;
|
||||
};
|
||||
"bridge/response/device/unbind": {
|
||||
from: string;
|
||||
from_endpoint: string | number;
|
||||
to: string | number;
|
||||
to_endpoint: string | number | undefined;
|
||||
clusters: string[];
|
||||
failed: string[];
|
||||
};
|
||||
"bridge/request/device/configure": {
|
||||
id: string | number;
|
||||
} | string;
|
||||
"bridge/response/device/configure": {
|
||||
id: string | number;
|
||||
};
|
||||
"bridge/request/device/remove": {
|
||||
id: string;
|
||||
block?: boolean;
|
||||
force?: boolean;
|
||||
};
|
||||
"bridge/response/device/remove": {
|
||||
id: string;
|
||||
block: boolean;
|
||||
force: boolean;
|
||||
};
|
||||
"bridge/request/device/ota_update/check": {
|
||||
id: string;
|
||||
};
|
||||
"bridge/request/device/ota_update/check/downgrade": {
|
||||
id: string;
|
||||
};
|
||||
"bridge/response/device/ota_update/check": {
|
||||
id: string;
|
||||
update_available: boolean;
|
||||
};
|
||||
"bridge/request/device/ota_update/update": {
|
||||
id: string;
|
||||
};
|
||||
"bridge/request/device/ota_update/update/downgrade": {
|
||||
id: string;
|
||||
};
|
||||
"bridge/response/device/ota_update/update": {
|
||||
id: string;
|
||||
from: {
|
||||
software_build_id: string;
|
||||
date_code: string;
|
||||
} | undefined;
|
||||
to: {
|
||||
software_build_id: string;
|
||||
date_code: string;
|
||||
} | undefined;
|
||||
};
|
||||
"bridge/request/device/ota_update/schedule": {
|
||||
id: string;
|
||||
};
|
||||
"bridge/request/device/ota_update/schedule/downgrade": {
|
||||
id: string;
|
||||
};
|
||||
"bridge/response/device/ota_update/schedule": {
|
||||
id: string;
|
||||
};
|
||||
"bridge/request/device/ota_update/unschedule": {
|
||||
id: string;
|
||||
};
|
||||
"bridge/response/device/ota_update/unschedule": {
|
||||
id: string;
|
||||
};
|
||||
"bridge/request/device/interview": {
|
||||
id: string | number;
|
||||
};
|
||||
"bridge/response/device/interview": {
|
||||
id: string | number;
|
||||
};
|
||||
"bridge/request/device/generate_external_definition": {
|
||||
id: string | number;
|
||||
};
|
||||
"bridge/response/device/generate_external_definition": {
|
||||
id: string | number;
|
||||
source: string;
|
||||
};
|
||||
"bridge/request/device/options": {
|
||||
id: string;
|
||||
options: Record<string, unknown>;
|
||||
};
|
||||
"bridge/response/device/options": {
|
||||
id: string;
|
||||
from: Record<string, unknown>;
|
||||
to: Record<string, unknown>;
|
||||
restart_required: boolean;
|
||||
};
|
||||
"bridge/request/device/rename": {
|
||||
last: true;
|
||||
from?: string;
|
||||
to: string;
|
||||
homeassistant_rename?: boolean;
|
||||
} | {
|
||||
last: false | undefined;
|
||||
from: string;
|
||||
to: string;
|
||||
homeassistant_rename?: boolean;
|
||||
};
|
||||
"bridge/response/device/rename": {
|
||||
from: string;
|
||||
to: string;
|
||||
homeassistant_rename: boolean;
|
||||
};
|
||||
"bridge/request/device/configure_reporting": {
|
||||
id: string;
|
||||
endpoint: string | number;
|
||||
cluster: string | number;
|
||||
attribute: string | number | {
|
||||
ID: number;
|
||||
type: number;
|
||||
};
|
||||
minimum_report_interval: number;
|
||||
maximum_report_interval: number;
|
||||
reportable_change: number;
|
||||
option: Record<string, unknown>;
|
||||
};
|
||||
"bridge/response/device/configure_reporting": {
|
||||
id: string;
|
||||
endpoint: string | number;
|
||||
cluster: string | number;
|
||||
attribute: string | number | {
|
||||
ID: number;
|
||||
type: number;
|
||||
};
|
||||
minimum_report_interval: number;
|
||||
maximum_report_interval: number;
|
||||
reportable_change: number;
|
||||
};
|
||||
"bridge/request/group/remove": {
|
||||
id: string;
|
||||
force?: boolean;
|
||||
};
|
||||
"bridge/response/group/remove": {
|
||||
id: string;
|
||||
force: boolean;
|
||||
};
|
||||
"bridge/request/group/add": {
|
||||
friendly_name: string;
|
||||
id?: string;
|
||||
};
|
||||
"bridge/response/group/add": {
|
||||
friendly_name: string;
|
||||
id: number;
|
||||
};
|
||||
"bridge/request/group/rename": {
|
||||
from: string;
|
||||
to: string;
|
||||
homeassistant_rename?: boolean;
|
||||
};
|
||||
"bridge/response/group/rename": {
|
||||
from: string;
|
||||
to: string;
|
||||
homeassistant_rename: boolean;
|
||||
};
|
||||
"bridge/request/group/options": {
|
||||
id: string;
|
||||
options: Record<string, unknown>;
|
||||
};
|
||||
"bridge/response/group/options": {
|
||||
id: string;
|
||||
from: Record<string, unknown>;
|
||||
to: Record<string, unknown>;
|
||||
restart_required: boolean;
|
||||
};
|
||||
"bridge/request/group/members/add": {
|
||||
device: string;
|
||||
group: string;
|
||||
endpoint: string | number | "default";
|
||||
skip_disable_reporting?: boolean;
|
||||
};
|
||||
"bridge/response/group/members/add": {
|
||||
device: string;
|
||||
group: string;
|
||||
endpoint: string | number | "default";
|
||||
};
|
||||
"bridge/request/group/members/remove": {
|
||||
device: string;
|
||||
group: string;
|
||||
endpoint: string | number | "default";
|
||||
skip_disable_reporting?: boolean;
|
||||
};
|
||||
"bridge/response/group/members/remove": {
|
||||
device: string;
|
||||
group: string;
|
||||
endpoint: string | number | "default";
|
||||
};
|
||||
"bridge/request/group/members/remove_all": {
|
||||
device: string;
|
||||
endpoint: string | number | "default";
|
||||
skip_disable_reporting?: boolean;
|
||||
};
|
||||
"bridge/response/group/members/remove_all": {
|
||||
device: string;
|
||||
endpoint: string | number | "default";
|
||||
};
|
||||
"bridge/request/touchlink/factory_reset": {
|
||||
ieee_address: string;
|
||||
channel: number;
|
||||
} | "";
|
||||
"bridge/response/touchlink/factory_reset": {
|
||||
ieee_address: string;
|
||||
channel: number;
|
||||
} | Record<string, never>;
|
||||
"bridge/request/touchlink/scan": "";
|
||||
"bridge/response/touchlink/scan": {
|
||||
found: {
|
||||
ieee_address: string;
|
||||
channel: number;
|
||||
}[];
|
||||
};
|
||||
"bridge/request/touchlink/identify": {
|
||||
ieee_address: string;
|
||||
channel: number;
|
||||
};
|
||||
"bridge/response/touchlink/identify": {
|
||||
ieee_address: string;
|
||||
channel: number;
|
||||
};
|
||||
/**
|
||||
* entity state response
|
||||
*/
|
||||
"{friendlyName}": {
|
||||
[key: string]: unknown;
|
||||
update?: UpdatePayload["update"];
|
||||
};
|
||||
"{friendlyName}/availability": {
|
||||
state: "online" | "offline";
|
||||
};
|
||||
/** entity set request (tries to match endpoint to definition, else uses "default") */
|
||||
"{friendlyNameOrId}/set": {
|
||||
[attribute: string]: {
|
||||
[key: string]: unknown;
|
||||
} | string | boolean;
|
||||
};
|
||||
/** entity set request (tries to match endpoint to definition, else uses "default") */
|
||||
"{friendlyNameOrId}/set/{attribute}": {
|
||||
[key: string]: unknown;
|
||||
};
|
||||
/** entity set request */
|
||||
"{friendlyNameOrId}/{endpoint}/set": {
|
||||
[attribute: string]: {
|
||||
[key: string]: unknown;
|
||||
} | string | boolean;
|
||||
};
|
||||
/** entity set request */
|
||||
"{friendlyNameOrId}/{endpoint}/set/{attribute}": {
|
||||
[key: string]: unknown;
|
||||
};
|
||||
/** entity get request (tries to match endpoint to definition, else uses "default") */
|
||||
"{friendlyNameOrId}/get": {
|
||||
[attribute: string]: {
|
||||
[key: string]: unknown;
|
||||
} | string | boolean;
|
||||
};
|
||||
/** entity get request (tries to match endpoint to definition, else uses "default") */
|
||||
"{friendlyNameOrId}/get/{attribute}": {
|
||||
[key: string]: unknown;
|
||||
};
|
||||
/** entity get request */
|
||||
"{friendlyNameOrId}/{endpoint}/get": {
|
||||
[attribute: string]: {
|
||||
[key: string]: unknown;
|
||||
} | string | boolean;
|
||||
};
|
||||
/** entity get request */
|
||||
"{friendlyNameOrId}/{endpoint}/get/{attribute}": {
|
||||
[key: string]: unknown;
|
||||
};
|
||||
}
|
||||
export type Zigbee2MQTTRequestEndpoints = "bridge/request/permit_join" | "bridge/request/health_check" | "bridge/request/coordinator_check" | "bridge/request/restart" | "bridge/request/networkmap" | "bridge/request/extension/save" | "bridge/request/extension/remove" | "bridge/request/converter/save" | "bridge/request/converter/remove" | "bridge/request/backup" | "bridge/request/install_code/add" | "bridge/request/options" | "bridge/request/device/bind" | "bridge/request/device/unbind" | "bridge/request/device/configure" | "bridge/request/device/remove" | "bridge/request/device/ota_update/check" | "bridge/request/device/ota_update/check/downgrade" | "bridge/request/device/ota_update/update" | "bridge/request/device/ota_update/update/downgrade" | "bridge/request/device/ota_update/schedule" | "bridge/request/device/ota_update/schedule/downgrade" | "bridge/request/device/ota_update/unschedule" | "bridge/request/device/interview" | "bridge/request/device/generate_external_definition" | "bridge/request/device/options" | "bridge/request/device/rename" | "bridge/request/device/configure_reporting" | "bridge/request/group/remove" | "bridge/request/group/add" | "bridge/request/group/rename" | "bridge/request/group/options" | "bridge/request/group/members/add" | "bridge/request/group/members/remove" | "bridge/request/group/members/remove_all" | "bridge/request/touchlink/factory_reset" | "bridge/request/touchlink/scan" | "bridge/request/touchlink/identify" | "{friendlyNameOrId}/set" | "{friendlyNameOrId}/set/{attribute}" | "{friendlyNameOrId}/{endpoint}/set" | "{friendlyNameOrId}/{endpoint}/set/{attribute}" | "{friendlyNameOrId}/get" | "{friendlyNameOrId}/get/{attribute}" | "{friendlyNameOrId}/{endpoint}/get" | "{friendlyNameOrId}/{endpoint}/get/{attribute}";
|
||||
export type Zigbee2MQTTResponseEndpoints = "bridge/response/permit_join" | "bridge/response/health_check" | "bridge/response/coordinator_check" | "bridge/response/restart" | "bridge/response/networkmap" | "bridge/response/extension/save" | "bridge/response/extension/remove" | "bridge/response/converter/save" | "bridge/response/converter/remove" | "bridge/response/backup" | "bridge/response/install_code/add" | "bridge/response/options" | "bridge/response/device/bind" | "bridge/response/device/unbind" | "bridge/response/device/configure" | "bridge/response/device/remove" | "bridge/response/device/ota_update/check" | "bridge/response/device/ota_update/update" | "bridge/response/device/ota_update/schedule" | "bridge/response/device/ota_update/unschedule" | "bridge/response/device/interview" | "bridge/response/device/generate_external_definition" | "bridge/response/device/options" | "bridge/response/device/rename" | "bridge/response/device/configure_reporting" | "bridge/response/group/remove" | "bridge/response/group/add" | "bridge/response/group/rename" | "bridge/response/group/options" | "bridge/response/group/members/add" | "bridge/response/group/members/remove" | "bridge/response/group/members/remove_all" | "bridge/response/touchlink/factory_reset" | "bridge/response/touchlink/scan" | "bridge/response/touchlink/identify";
|
||||
export type Zigbee2MQTTRequest<T extends Zigbee2MQTTRequestEndpoints> = {
|
||||
transaction?: string;
|
||||
} & Zigbee2MQTTAPI[T];
|
||||
export type Zigbee2MQTTResponseOK<T extends Zigbee2MQTTResponseEndpoints> = {
|
||||
status: "ok";
|
||||
data: Zigbee2MQTTAPI[T];
|
||||
transaction?: string;
|
||||
};
|
||||
export type Zigbee2MQTTResponseError = {
|
||||
status: "error";
|
||||
data: Record<string, never>;
|
||||
error: string;
|
||||
transaction?: string;
|
||||
};
|
||||
export type Zigbee2MQTTResponse<T extends Zigbee2MQTTResponseEndpoints> = Zigbee2MQTTResponseOK<T> | Zigbee2MQTTResponseError;
|
||||
//# sourceMappingURL=api.d.ts.map
|
||||
Vendored
+1
File diff suppressed because one or more lines are too long
Vendored
+10
@@ -0,0 +1,10 @@
|
||||
declare function joinPath(file: string): string;
|
||||
declare function getPath(): string;
|
||||
declare function _testReload(): void;
|
||||
declare const _default: {
|
||||
joinPath: typeof joinPath;
|
||||
getPath: typeof getPath;
|
||||
_testReload: typeof _testReload;
|
||||
};
|
||||
export default _default;
|
||||
//# sourceMappingURL=data.d.ts.map
|
||||
Vendored
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"data.d.ts","sourceRoot":"","sources":["../../lib/util/data.ts"],"names":[],"mappings":"AAQA,iBAAS,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEtC;AAED,iBAAS,OAAO,IAAI,MAAM,CAEzB;AAED,iBAAS,WAAW,IAAI,IAAI,CAE3B;;;;;;AAED,wBAAgD"}
|
||||
Vendored
+34
@@ -0,0 +1,34 @@
|
||||
import winston from "winston";
|
||||
import * as settings from "./settings";
|
||||
declare class Logger {
|
||||
private level;
|
||||
private output;
|
||||
private directory;
|
||||
private logger;
|
||||
private fileTransport;
|
||||
private debugNamespaceIgnoreRegex?;
|
||||
private namespacedLevels;
|
||||
private cachedNamespacedLevels;
|
||||
init(): void;
|
||||
get winston(): winston.Logger;
|
||||
addTransport(transport: winston.transport): void;
|
||||
removeTransport(transport: winston.transport): void;
|
||||
getDebugNamespaceIgnore(): string;
|
||||
setDebugNamespaceIgnore(value: string): void;
|
||||
getLevel(): settings.LogLevel;
|
||||
setLevel(level: settings.LogLevel): void;
|
||||
getNamespacedLevels(): Record<string, settings.LogLevel>;
|
||||
setNamespacedLevels(nsLevels: Record<string, settings.LogLevel>): void;
|
||||
private resetCachedNamespacedLevels;
|
||||
private cacheNamespacedLevel;
|
||||
private log;
|
||||
error(messageOrLambda: string | (() => string), namespace?: string): void;
|
||||
warning(messageOrLambda: string | (() => string), namespace?: string): void;
|
||||
info(messageOrLambda: string | (() => string), namespace?: string): void;
|
||||
debug(messageOrLambda: string | (() => string), namespace?: string): void;
|
||||
private cleanup;
|
||||
end(): Promise<void>;
|
||||
}
|
||||
declare const _default: Logger;
|
||||
export default _default;
|
||||
//# sourceMappingURL=logger.d.ts.map
|
||||
Vendored
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../lib/util/logger.ts"],"names":[],"mappings":"AAMA,OAAO,OAAO,MAAM,SAAS,CAAC;AAE9B,OAAO,KAAK,QAAQ,MAAM,YAAY,CAAC;AAIvC,cAAM,MAAM;IAER,OAAO,CAAC,KAAK,CAAoB;IAEjC,OAAO,CAAC,MAAM,CAAW;IAEzB,OAAO,CAAC,SAAS,CAAS;IAE1B,OAAO,CAAC,MAAM,CAAiB;IAE/B,OAAO,CAAC,aAAa,CAA2C;IAChE,OAAO,CAAC,yBAAyB,CAAC,CAAS;IAE3C,OAAO,CAAC,gBAAgB,CAAoC;IAE5D,OAAO,CAAC,sBAAsB,CAAoC;IAE3D,IAAI,IAAI,IAAI;IAyGnB,IAAI,OAAO,IAAI,OAAO,CAAC,MAAM,CAE5B;IAEM,YAAY,CAAC,SAAS,EAAE,OAAO,CAAC,SAAS,GAAG,IAAI;IAIhD,eAAe,CAAC,SAAS,EAAE,OAAO,CAAC,SAAS,GAAG,IAAI;IAInD,uBAAuB,IAAI,MAAM;IAQjC,uBAAuB,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAI5C,QAAQ,IAAI,QAAQ,CAAC,QAAQ;IAI7B,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAC,QAAQ,GAAG,IAAI;IAKxC,mBAAmB,IAAI,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,QAAQ,CAAC;IAIxD,mBAAmB,CAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,QAAQ,CAAC,GAAG,IAAI;IAK7E,OAAO,CAAC,2BAA2B;IAInC,OAAO,CAAC,oBAAoB;IAmB5B,OAAO,CAAC,GAAG;IASJ,KAAK,CAAC,eAAe,EAAE,MAAM,GAAG,CAAC,MAAM,MAAM,CAAC,EAAE,SAAS,SAAQ,GAAG,IAAI;IAIxE,OAAO,CAAC,eAAe,EAAE,MAAM,GAAG,CAAC,MAAM,MAAM,CAAC,EAAE,SAAS,SAAQ,GAAG,IAAI;IAI1E,IAAI,CAAC,eAAe,EAAE,MAAM,GAAG,CAAC,MAAM,MAAM,CAAC,EAAE,SAAS,SAAQ,GAAG,IAAI;IAIvE,KAAK,CAAC,eAAe,EAAE,MAAM,GAAG,CAAC,MAAM,MAAM,CAAC,EAAE,SAAS,SAAQ,GAAG,IAAI;IAS/E,OAAO,CAAC,OAAO;IAsBF,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;CAmBpC;;AAED,wBAA4B"}
|
||||
Vendored
+2
@@ -0,0 +1,2 @@
|
||||
export declare function onboard(): Promise<boolean>;
|
||||
//# sourceMappingURL=onboarding.d.ts.map
|
||||
Vendored
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"onboarding.d.ts","sourceRoot":"","sources":["../../lib/util/onboarding.ts"],"names":[],"mappings":"AAwgBA,wBAAsB,OAAO,IAAI,OAAO,CAAC,OAAO,CAAC,CA0DhD"}
|
||||
Vendored
+10
@@ -0,0 +1,10 @@
|
||||
/**
|
||||
* Handle sd_notify protocol, @see https://www.freedesktop.org/software/systemd/man/latest/sd_notify.html
|
||||
* No-op if running on unsupported platforms or without Type=notify
|
||||
* Soft-fails if improperly setup (this is not necessary for Zigbee2MQTT to function properly)
|
||||
*/
|
||||
export declare function initSdNotify(): Promise<{
|
||||
notifyStopping: () => void;
|
||||
stop: () => void;
|
||||
} | undefined>;
|
||||
//# sourceMappingURL=sd-notify.d.ts.map
|
||||
Vendored
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"sd-notify.d.ts","sourceRoot":"","sources":["../../lib/util/sd-notify.ts"],"names":[],"mappings":"AAMA;;;;GAIG;AACH,wBAAsB,YAAY,IAAI,OAAO,CAAC;IAAC,cAAc,EAAE,MAAM,IAAI,CAAC;IAAC,IAAI,EAAE,MAAM,IAAI,CAAA;CAAC,GAAG,SAAS,CAAC,CA0DxG"}
|
||||
Vendored
+227
@@ -0,0 +1,227 @@
|
||||
import schemaJson from "./settings.schema.json";
|
||||
export { schemaJson };
|
||||
export declare const CURRENT_VERSION = 4;
|
||||
/** NOTE: by order of priority, lower index is lower level (more important) */
|
||||
export declare const LOG_LEVELS: readonly string[];
|
||||
export type LogLevel = "error" | "warning" | "info" | "debug";
|
||||
export declare const defaults: {
|
||||
homeassistant: {
|
||||
enabled: false;
|
||||
discovery_topic: string;
|
||||
status_topic: string;
|
||||
legacy_action_sensor: false;
|
||||
experimental_event_entities: false;
|
||||
};
|
||||
availability: {
|
||||
enabled: false;
|
||||
active: {
|
||||
timeout: number;
|
||||
max_jitter: number;
|
||||
backoff: true;
|
||||
pause_on_backoff_gt: number;
|
||||
};
|
||||
passive: {
|
||||
timeout: number;
|
||||
};
|
||||
};
|
||||
frontend: {
|
||||
enabled: false;
|
||||
package: "zigbee2mqtt-frontend";
|
||||
port: number;
|
||||
base_url: string;
|
||||
};
|
||||
mqtt: {
|
||||
base_topic: string;
|
||||
include_device_information: false;
|
||||
force_disable_retain: false;
|
||||
maximum_packet_size: number;
|
||||
};
|
||||
serial: {
|
||||
disable_led: false;
|
||||
};
|
||||
passlist: never[];
|
||||
blocklist: never[];
|
||||
map_options: {
|
||||
graphviz: {
|
||||
colors: {
|
||||
fill: {
|
||||
enddevice: string;
|
||||
coordinator: string;
|
||||
router: string;
|
||||
};
|
||||
font: {
|
||||
coordinator: string;
|
||||
router: string;
|
||||
enddevice: string;
|
||||
};
|
||||
line: {
|
||||
active: string;
|
||||
inactive: string;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
ota: {
|
||||
update_check_interval: number;
|
||||
disable_automatic_update_check: false;
|
||||
image_block_response_delay: number;
|
||||
default_maximum_data_size: number;
|
||||
};
|
||||
device_options: {};
|
||||
advanced: {
|
||||
log_rotation: true;
|
||||
log_console_json: false;
|
||||
log_symlink_current: false;
|
||||
log_output: ("console" | "file")[];
|
||||
log_directory: string;
|
||||
log_file: string;
|
||||
log_level: "info" | "debug";
|
||||
log_namespaced_levels: {};
|
||||
log_syslog: {};
|
||||
log_debug_to_mqtt_frontend: false;
|
||||
log_debug_namespace_ignore: string;
|
||||
log_directories_to_keep: number;
|
||||
pan_id: number;
|
||||
ext_pan_id: number[];
|
||||
channel: number;
|
||||
adapter_concurrent: undefined;
|
||||
adapter_delay: undefined;
|
||||
cache_state: true;
|
||||
cache_state_persistent: true;
|
||||
cache_state_send_on_startup: true;
|
||||
last_seen: "disable";
|
||||
elapsed: false;
|
||||
network_key: number[];
|
||||
timestamp_format: string;
|
||||
output: "json";
|
||||
};
|
||||
health: {
|
||||
interval: number;
|
||||
reset_on_check: false;
|
||||
};
|
||||
};
|
||||
export declare function writeMinimalDefaults(): void;
|
||||
export declare function setOnboarding(value: boolean): void;
|
||||
export declare function write(): void;
|
||||
export declare function validate(): string[];
|
||||
/**
|
||||
* Get the settings actually written in the yaml.
|
||||
* Env vars are applied on top.
|
||||
* Defaults merged on startup are not included.
|
||||
*/
|
||||
export declare function getPersistedSettings(): Partial<Settings>;
|
||||
export declare function get(): Settings;
|
||||
export declare function set(path: string[], value: string | number | boolean | KeyValue): void;
|
||||
export declare function apply(settings: Record<string, unknown>, throwOnError?: boolean): boolean;
|
||||
export declare function getGroup(IDorName: string | number): GroupOptions | undefined;
|
||||
export declare function getDevice(IDorName: string): DeviceOptionsWithId | undefined;
|
||||
export declare function addDevice(id: string): DeviceOptionsWithId;
|
||||
export declare function blockDevice(id: string): void;
|
||||
export declare function removeDevice(IDorName: string): void;
|
||||
export declare function addGroup(name: string, id?: string): GroupOptions;
|
||||
export declare function removeGroup(IDorName: string | number): void;
|
||||
export declare function changeEntityOptions(IDorName: string, newOptions: KeyValue): boolean;
|
||||
export declare function changeFriendlyName(IDorName: string, newName: string): void;
|
||||
export declare function reRead(): void;
|
||||
export declare const testing: {
|
||||
write: typeof write;
|
||||
clear: () => void;
|
||||
defaults: {
|
||||
homeassistant: {
|
||||
enabled: false;
|
||||
discovery_topic: string;
|
||||
status_topic: string;
|
||||
legacy_action_sensor: false;
|
||||
experimental_event_entities: false;
|
||||
};
|
||||
availability: {
|
||||
enabled: false;
|
||||
active: {
|
||||
timeout: number;
|
||||
max_jitter: number;
|
||||
backoff: true;
|
||||
pause_on_backoff_gt: number;
|
||||
};
|
||||
passive: {
|
||||
timeout: number;
|
||||
};
|
||||
};
|
||||
frontend: {
|
||||
enabled: false;
|
||||
package: "zigbee2mqtt-frontend";
|
||||
port: number;
|
||||
base_url: string;
|
||||
};
|
||||
mqtt: {
|
||||
base_topic: string;
|
||||
include_device_information: false;
|
||||
force_disable_retain: false;
|
||||
maximum_packet_size: number;
|
||||
};
|
||||
serial: {
|
||||
disable_led: false;
|
||||
};
|
||||
passlist: never[];
|
||||
blocklist: never[];
|
||||
map_options: {
|
||||
graphviz: {
|
||||
colors: {
|
||||
fill: {
|
||||
enddevice: string;
|
||||
coordinator: string;
|
||||
router: string;
|
||||
};
|
||||
font: {
|
||||
coordinator: string;
|
||||
router: string;
|
||||
enddevice: string;
|
||||
};
|
||||
line: {
|
||||
active: string;
|
||||
inactive: string;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
ota: {
|
||||
update_check_interval: number;
|
||||
disable_automatic_update_check: false;
|
||||
image_block_response_delay: number;
|
||||
default_maximum_data_size: number;
|
||||
};
|
||||
device_options: {};
|
||||
advanced: {
|
||||
log_rotation: true;
|
||||
log_console_json: false;
|
||||
log_symlink_current: false;
|
||||
log_output: ("console" | "file")[];
|
||||
log_directory: string;
|
||||
log_file: string;
|
||||
log_level: "info" | "debug";
|
||||
log_namespaced_levels: {};
|
||||
log_syslog: {};
|
||||
log_debug_to_mqtt_frontend: false;
|
||||
log_debug_namespace_ignore: string;
|
||||
log_directories_to_keep: number;
|
||||
pan_id: number;
|
||||
ext_pan_id: number[];
|
||||
channel: number;
|
||||
adapter_concurrent: undefined;
|
||||
adapter_delay: undefined;
|
||||
cache_state: true;
|
||||
cache_state_persistent: true;
|
||||
cache_state_send_on_startup: true;
|
||||
last_seen: "disable";
|
||||
elapsed: false;
|
||||
network_key: number[];
|
||||
timestamp_format: string;
|
||||
output: "json";
|
||||
};
|
||||
health: {
|
||||
interval: number;
|
||||
reset_on_check: false;
|
||||
};
|
||||
};
|
||||
CURRENT_VERSION: number;
|
||||
};
|
||||
//# sourceMappingURL=settings.d.ts.map
|
||||
Vendored
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"settings.d.ts","sourceRoot":"","sources":["../../lib/util/settings.ts"],"names":[],"mappings":"AAQA,OAAO,UAAU,MAAM,wBAAwB,CAAC;AAIhD,OAAO,EAAC,UAAU,EAAC,CAAC;AAGpB,eAAO,MAAM,eAAe,IAAI,CAAC;AACjC,8EAA8E;AAC9E,eAAO,MAAM,UAAU,EAAE,SAAS,MAAM,EAAmD,CAAC;AAC5F,MAAM,MAAM,QAAQ,GAAG,OAAO,GAAG,SAAS,GAAG,MAAM,GAAG,OAAO,CAAC;AAY9D,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyFiB,CAAC;AAmCvC,wBAAgB,oBAAoB,IAAI,IAAI,CA8B3C;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,OAAO,GAAG,IAAI,CAclD;AAED,wBAAgB,KAAK,IAAI,IAAI,CAuD5B;AAED,wBAAgB,QAAQ,IAAI,MAAM,EAAE,CA+DnC;AA+GD;;;;GAIG;AACH,wBAAgB,oBAAoB,IAAI,OAAO,CAAC,QAAQ,CAAC,CAMxD;AAED,wBAAgB,GAAG,IAAI,QAAQ,CAO9B;AAED,wBAAgB,GAAG,CAAC,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
||||
* - Add
|
||||
* - Remove
|
||||
*
|
||||
* Should allow the most flexibility whenever combination of migrations is necessary (e.g. Transfer + Change)
|
||||
*/
|
||||
export declare function migrateIfNecessary(): void;
|
||||
//# sourceMappingURL=settingsMigration.d.ts.map
|
||||
Vendored
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"settingsMigration.d.ts","sourceRoot":"","sources":["../../lib/util/settingsMigration.ts"],"names":[],"mappings":"AAmeA;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,IAAI,IAAI,CAgGzC"}
|
||||
Vendored
+94
@@ -0,0 +1,94 @@
|
||||
import type * as zhc from "zigbee-herdsman-converters";
|
||||
import type { Zigbee2MQTTAPI, Zigbee2MQTTResponse, Zigbee2MQTTResponseEndpoints, Zigbee2MQTTScene } from "../types/api";
|
||||
declare function capitalize(s: string): string;
|
||||
export declare function getZigbee2MQTTVersion(includeCommitHash?: boolean): Promise<{
|
||||
commitHash?: string;
|
||||
version: string;
|
||||
}>;
|
||||
declare function getDependencyVersion(depend: string): Promise<{
|
||||
version: string;
|
||||
}>;
|
||||
declare function formatDate(time: number, type: "ISO_8601" | "ISO_8601_local" | "epoch" | "relative"): string | number;
|
||||
declare function objectIsEmpty(object: object): boolean;
|
||||
declare function objectHasProperties(object: {
|
||||
[s: string]: unknown;
|
||||
}, properties: string[]): boolean;
|
||||
declare function equalsPartial(object: KeyValue, expected: KeyValue): boolean;
|
||||
declare function getObjectProperty<T>(object: KeyValue, key: string, defaultValue: NoInfer<T>): T;
|
||||
declare function getResponse<T extends Zigbee2MQTTResponseEndpoints>(request: KeyValue | string, data: Zigbee2MQTTAPI[T], error?: string): Zigbee2MQTTResponse<T>;
|
||||
declare function parseJSON(value: string, fallback: string): KeyValue | string;
|
||||
/**
|
||||
* Delete all keys from passed object that have null/undefined values.
|
||||
*
|
||||
* @param {KeyValue} obj Object to process (in-place)
|
||||
* @param {string[]} [ignoreKeys] Recursively ignore these keys in the object (keep null/undefined values).
|
||||
*/
|
||||
declare function removeNullPropertiesFromObject(obj: KeyValue, ignoreKeys?: string[]): void;
|
||||
declare function toNetworkAddressHex(value: number): string;
|
||||
declare function getAllFiles(path_: string): string[];
|
||||
declare function validateFriendlyName(name: string, throwFirstError?: boolean): string[];
|
||||
declare function sleep(seconds: number): Promise<void>;
|
||||
declare function sanitizeImageParameter(parameter: string): string;
|
||||
declare function isAvailabilityEnabledForEntity(entity: Device | Group, settings: Settings): boolean;
|
||||
declare function isZHEndpoint(obj: unknown): obj is zh.Endpoint;
|
||||
declare function flatten<Type>(arr: Type[][]): Type[];
|
||||
declare function arrayUnique<Type>(arr: Type[]): Type[];
|
||||
declare function isZHGroup(obj: unknown): obj is zh.Group;
|
||||
export declare const hours: (hours: number) => number;
|
||||
export declare const minutes: (minutes: number) => number;
|
||||
export declare const seconds: (seconds: number) => number;
|
||||
declare function publishLastSeen(data: eventdata.LastSeenChanged, settings: Settings, allowMessageEmitted: boolean, publishEntityState: PublishEntityState): Promise<void>;
|
||||
declare function filterProperties(filter: string[] | undefined, data: KeyValue): void;
|
||||
export declare function isNumericExpose(expose: zhc.Expose): expose is zhc.Numeric;
|
||||
export declare function assertEnumExpose(expose: zhc.Expose): asserts expose is zhc.Enum;
|
||||
export declare function assertNumericExpose(expose: zhc.Expose): asserts expose is zhc.Numeric;
|
||||
export declare function assertBinaryExpose(expose: zhc.Expose): asserts expose is zhc.Binary;
|
||||
export declare function isEnumExpose(expose: zhc.Expose): expose is zhc.Enum;
|
||||
export declare function isBinaryExpose(expose: zhc.Expose): expose is zhc.Binary;
|
||||
export declare function isLightExpose(expose: zhc.Expose): expose is zhc.Light;
|
||||
export declare function assertString(value: unknown, property: string): asserts value is string;
|
||||
declare function getScenes(entity: zh.Endpoint | zh.Group): Zigbee2MQTTScene[];
|
||||
declare function deviceNotCoordinator(device: zh.Device): boolean;
|
||||
declare function matchBase64File(value: string | undefined): {
|
||||
extension: string;
|
||||
data: string;
|
||||
} | false;
|
||||
declare function saveBase64DeviceIcon(base64Match: {
|
||||
extension: string;
|
||||
data: string;
|
||||
}): string;
|
||||
declare const _default: {
|
||||
matchBase64File: typeof matchBase64File;
|
||||
saveBase64DeviceIcon: typeof saveBase64DeviceIcon;
|
||||
capitalize: typeof capitalize;
|
||||
getZigbee2MQTTVersion: typeof getZigbee2MQTTVersion;
|
||||
getDependencyVersion: typeof getDependencyVersion;
|
||||
formatDate: typeof formatDate;
|
||||
objectIsEmpty: typeof objectIsEmpty;
|
||||
objectHasProperties: typeof objectHasProperties;
|
||||
equalsPartial: typeof equalsPartial;
|
||||
getObjectProperty: typeof getObjectProperty;
|
||||
getResponse: typeof getResponse;
|
||||
parseJSON: typeof parseJSON;
|
||||
removeNullPropertiesFromObject: typeof removeNullPropertiesFromObject;
|
||||
toNetworkAddressHex: typeof toNetworkAddressHex;
|
||||
isZHEndpoint: typeof isZHEndpoint;
|
||||
isZHGroup: typeof isZHGroup;
|
||||
hours: (hours: number) => number;
|
||||
minutes: (minutes: number) => number;
|
||||
seconds: (seconds: number) => number;
|
||||
validateFriendlyName: typeof validateFriendlyName;
|
||||
sleep: typeof sleep;
|
||||
sanitizeImageParameter: typeof sanitizeImageParameter;
|
||||
isAvailabilityEnabledForEntity: typeof isAvailabilityEnabledForEntity;
|
||||
publishLastSeen: typeof publishLastSeen;
|
||||
getAllFiles: typeof getAllFiles;
|
||||
filterProperties: typeof filterProperties;
|
||||
flatten: typeof flatten;
|
||||
arrayUnique: typeof arrayUnique;
|
||||
getScenes: typeof getScenes;
|
||||
deviceNotCoordinator: typeof deviceNotCoordinator;
|
||||
noop: () => void;
|
||||
};
|
||||
export default _default;
|
||||
//# sourceMappingURL=utils.d.ts.map
|
||||
Vendored
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../lib/util/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,GAAG,MAAM,4BAA4B,CAAC;AAEvD,OAAO,KAAK,EAAC,cAAc,EAAE,mBAAm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,EAAE,MAAM,GAAG,SAAS,GAAG;IAAC,SAAS,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAC,GAAG,KAAK,CAS7F;AAED,iBAAS,oBAAoB,CAAC,WAAW,EAAE;IAAC,SAAS,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAC,GAAG,MAAM,CAOpF;;;;;;;;;;;;;;;;;;mBA5G4B,MAAM,KAAG,MAAM;uBACX,MAAM,KAAG,MAAM;uBACf,MAAM,KAAG,MAAM;;;;;;;;;;;;gBA6G/B,IAAI;;AAErB,wBAgCE"}
|
||||
Vendored
+17
@@ -0,0 +1,17 @@
|
||||
import { YAMLException } from "js-yaml";
|
||||
export declare class YAMLFileException extends YAMLException {
|
||||
file: string;
|
||||
constructor(error: YAMLException, file: string);
|
||||
}
|
||||
declare function read(file: string): KeyValue;
|
||||
declare function readIfExists(file: string, fallback?: KeyValue): KeyValue;
|
||||
declare function writeIfChanged(file: string, content: KeyValue): void;
|
||||
declare function updateIfChanged(file: string, key: string, value: KeyValue): void;
|
||||
declare const _default: {
|
||||
read: typeof read;
|
||||
readIfExists: typeof readIfExists;
|
||||
updateIfChanged: typeof updateIfChanged;
|
||||
writeIfChanged: typeof writeIfChanged;
|
||||
};
|
||||
export default _default;
|
||||
//# sourceMappingURL=yaml.d.ts.map
|
||||
Vendored
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"yaml.d.ts","sourceRoot":"","sources":["../../lib/util/yaml.ts"],"names":[],"mappings":"AAIA,OAAa,EAAC,aAAa,EAAC,MAAM,SAAS,CAAC;AAE5C,qBAAa,iBAAkB,SAAQ,aAAa;IAChD,IAAI,EAAE,MAAM,CAAC;gBAED,KAAK,EAAE,aAAa,EAAE,IAAI,EAAE,MAAM;CASjD;AAED,iBAAS,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,QAAQ,CAYpC;AAED,iBAAS,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,GAAE,QAAa,GAAG,QAAQ,CAErE;AAED,iBAAS,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,GAAG,IAAI,CAM7D;AAED,iBAAS,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,GAAG,IAAI,CAMzE;;;;;;;AAED,wBAAqE"}
|
||||
Vendored
+54
@@ -0,0 +1,54 @@
|
||||
import type { StartResult } from "zigbee-herdsman/dist/adapter/tstype";
|
||||
import Device from "./model/device";
|
||||
import Group from "./model/group";
|
||||
export default class Zigbee {
|
||||
private herdsman;
|
||||
private eventBus;
|
||||
private groupLookup;
|
||||
private deviceLookup;
|
||||
private coordinatorIeeeAddr;
|
||||
constructor(eventBus: EventBus);
|
||||
start(): Promise<StartResult>;
|
||||
private logDeviceInterview;
|
||||
private generateNetworkKey;
|
||||
private generateExtPanID;
|
||||
private generatePanID;
|
||||
getCoordinatorVersion(): Promise<zh.CoordinatorVersion>;
|
||||
isStopping(): boolean;
|
||||
backup(): Promise<void>;
|
||||
coordinatorCheck(): Promise<{
|
||||
missingRouters: Device[];
|
||||
}>;
|
||||
getNetworkParameters(): Promise<zh.NetworkParameters>;
|
||||
stop(): Promise<void>;
|
||||
getPermitJoin(): boolean;
|
||||
getPermitJoinEnd(): number | undefined;
|
||||
permitJoin(time: number, device?: Device): Promise<void>;
|
||||
resolveDevicesDefinitions(ignoreCache?: boolean): Promise<void>;
|
||||
private resolveDevice;
|
||||
private resolveGroup;
|
||||
resolveEntity(key: string | number | zh.Device): Device | Group | undefined;
|
||||
resolveEntityAndEndpoint(id: string): {
|
||||
ID: string;
|
||||
entity: Device | Group | undefined;
|
||||
endpointID?: string;
|
||||
endpoint?: zh.Endpoint;
|
||||
};
|
||||
firstCoordinatorEndpoint(): zh.Endpoint;
|
||||
devicesAndGroupsIterator(devicePredicate?: (value: zh.Device) => boolean, groupPredicate?: (value: zh.Group) => boolean): Generator<Device | Group>;
|
||||
groupsIterator(predicate?: (value: zh.Group) => boolean): Generator<Group>;
|
||||
devicesIterator(predicate?: (value: zh.Device) => boolean): Generator<Device>;
|
||||
private acceptJoiningDeviceHandler;
|
||||
touchlinkFactoryResetFirst(): Promise<boolean>;
|
||||
touchlinkFactoryReset(ieeeAddr: string, channel: number): Promise<boolean>;
|
||||
addInstallCode(installCode: string): Promise<void>;
|
||||
touchlinkIdentify(ieeeAddr: string, channel: number): Promise<void>;
|
||||
touchlinkScan(): Promise<{
|
||||
ieeeAddr: string;
|
||||
channel: number;
|
||||
}[]>;
|
||||
createGroup(id: number): Group;
|
||||
deviceByNetworkAddress(networkAddress: number): Device | undefined;
|
||||
groupByID(id: number): Group | undefined;
|
||||
}
|
||||
//# sourceMappingURL=zigbee.d.ts.map
|
||||
Vendored
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"zigbee.d.ts","sourceRoot":"","sources":["../lib/zigbee.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,qCAAqC,CAAC;AASrE,OAAO,MAAM,MAAM,gBAAgB,CAAC;AACpC,OAAO,KAAK,MAAM,eAAe,CAAC;AAQlC,MAAM,CAAC,OAAO,OAAO,MAAM;IAEvB,OAAO,CAAC,QAAQ,CAAa;IAC7B,OAAO,CAAC,QAAQ,CAAW;IAC3B,OAAO,CAAC,WAAW,CAA2C;IAC9D,OAAO,CAAC,YAAY,CAAgD;IACpE,OAAO,CAAC,mBAAmB,CAAU;gBAEzB,QAAQ,EAAE,QAAQ;IAIxB,KAAK,IAAI,OAAO,CAAC,WAAW,CAAC;IAoInC,OAAO,CAAC,kBAAkB;IAsB1B,OAAO,CAAC,kBAAkB;IAM1B,OAAO,CAAC,gBAAgB;IAMxB,OAAO,CAAC,aAAa;IAMf,qBAAqB,IAAI,OAAO,CAAC,EAAE,CAAC,kBAAkB,CAAC;IAI7D,UAAU,IAAI,OAAO;IAIf,MAAM,IAAI,OAAO,CAAC,I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C,MAAM,KAAK,OAAO,GAAG,SAAS,CAAC,MAAM,CAAC;YAQ1D,0BAA0B;IA0BxC,0BAA0B,IAAI,OAAO,CAAC,OAAO,CAAC;IAI9C,qBAAqB,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAI1E,cAAc,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAIlD,iBAAiB,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAInE,aAAa,IAAI,OAAO,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAC,EAAE,CAAC;IAIrE,WAAW,CAAC,EAAE,EAAE,MAAM,GAAG,KAAK;IAM9B,sBAAsB,CAAC,cAAc,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS;IAKlE,SAAS,CAAC,EAAE,EAAE,MAAM,GAAG,KAAK,GAAG,SAAS;CAG3C"}
|
||||
@@ -23,6 +23,7 @@
|
||||
],
|
||||
"scripts": {
|
||||
"build": "tsc && node index.js writehash",
|
||||
"build:types": "pnpm run clean && tsc --project tsconfig.types.json",
|
||||
"build:watch": "tsc --watch",
|
||||
"check": "biome check",
|
||||
"check:w": "biome check --write",
|
||||
|
||||
Reference in New Issue
Block a user