From bb855f8f94fff453bb0a4e57e7b411f37edc30aa Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 16 Jun 2025 19:00:59 +0000 Subject: [PATCH] Update --- LICENSE | 674 +++++++++++++++++ dist/controller.d.ts | 27 + dist/controller.d.ts.map | 1 + dist/eventBus.d.ts | 69 ++ dist/eventBus.d.ts.map | 1 + dist/extension/availability.d.ts | 34 + dist/extension/availability.d.ts.map | 1 + dist/extension/bind.d.ts | 14 + dist/extension/bind.d.ts.map | 1 + dist/extension/bridge.d.ts | 57 ++ dist/extension/bridge.d.ts.map | 1 + dist/extension/configure.d.ts | 14 + dist/extension/configure.d.ts.map | 1 + dist/extension/extension.d.ts | 34 + dist/extension/extension.d.ts.map | 1 + dist/extension/externalConverters.d.ts | 10 + dist/extension/externalConverters.d.ts.map | 1 + dist/extension/externalExtensions.d.ts | 10 + dist/extension/externalExtensions.d.ts.map | 1 + dist/extension/externalJS.d.ts | 32 + dist/extension/externalJS.d.ts.map | 1 + dist/extension/frontend.d.ts | 21 + dist/extension/frontend.d.ts.map | 1 + dist/extension/groups.d.ts | 12 + dist/extension/groups.d.ts.map | 1 + dist/extension/health.d.ts | 8 + dist/extension/health.d.ts.map | 1 + dist/extension/homeassistant.d.ts | 83 +++ dist/extension/homeassistant.d.ts.map | 1 + dist/extension/networkMap.d.ts | 15 + dist/extension/networkMap.d.ts.map | 1 + dist/extension/onEvent.d.ts | 10 + dist/extension/onEvent.d.ts.map | 1 + dist/extension/otaUpdate.d.ts | 25 + dist/extension/otaUpdate.d.ts.map | 1 + dist/extension/publish.d.ts | 18 + dist/extension/publish.d.ts.map | 1 + dist/extension/receive.d.ts | 13 + dist/extension/receive.d.ts.map | 1 + dist/model/device.d.ts | 25 + dist/model/device.d.ts.map | 1 + dist/model/group.d.ts | 15 + dist/model/group.d.ts.map | 1 + dist/mqtt.d.ts | 43 ++ dist/mqtt.d.ts.map | 1 + dist/state.d.ts | 19 + dist/state.d.ts.map | 1 + dist/types/api.d.ts | 801 +++++++++++++++++++++ dist/types/api.d.ts.map | 1 + dist/util/data.d.ts | 10 + dist/util/data.d.ts.map | 1 + dist/util/logger.d.ts | 34 + dist/util/logger.d.ts.map | 1 + dist/util/onboarding.d.ts | 2 + dist/util/onboarding.d.ts.map | 1 + dist/util/sd-notify.d.ts | 10 + dist/util/sd-notify.d.ts.map | 1 + dist/util/settings.d.ts | 227 ++++++ dist/util/settings.d.ts.map | 1 + dist/util/settingsMigration.d.ts | 11 + dist/util/settingsMigration.d.ts.map | 1 + dist/util/utils.d.ts | 94 +++ dist/util/utils.d.ts.map | 1 + dist/util/yaml.d.ts | 17 + dist/util/yaml.d.ts.map | 1 + dist/zigbee.d.ts | 54 ++ dist/zigbee.d.ts.map | 1 + package.json | 1 + 68 files changed, 2576 insertions(+) create mode 100644 LICENSE create mode 100644 dist/controller.d.ts create mode 100644 dist/controller.d.ts.map create mode 100644 dist/eventBus.d.ts create mode 100644 dist/eventBus.d.ts.map create mode 100644 dist/extension/availability.d.ts create mode 100644 dist/extension/availability.d.ts.map create mode 100644 dist/extension/bind.d.ts create mode 100644 dist/extension/bind.d.ts.map create mode 100644 dist/extension/bridge.d.ts create mode 100644 dist/extension/bridge.d.ts.map create mode 100644 dist/extension/configure.d.ts create mode 100644 dist/extension/configure.d.ts.map create mode 100644 dist/extension/extension.d.ts create mode 100644 dist/extension/extension.d.ts.map create mode 100644 dist/extension/externalConverters.d.ts create mode 100644 dist/extension/externalConverters.d.ts.map create mode 100644 dist/extension/externalExtensions.d.ts create mode 100644 dist/extension/externalExtensions.d.ts.map create mode 100644 dist/extension/externalJS.d.ts create mode 100644 dist/extension/externalJS.d.ts.map create mode 100644 dist/extension/frontend.d.ts create mode 100644 dist/extension/frontend.d.ts.map create mode 100644 dist/extension/groups.d.ts create mode 100644 dist/extension/groups.d.ts.map create mode 100644 dist/extension/health.d.ts create mode 100644 dist/extension/health.d.ts.map create mode 100644 dist/extension/homeassistant.d.ts create mode 100644 dist/extension/homeassistant.d.ts.map create mode 100644 dist/extension/networkMap.d.ts create mode 100644 dist/extension/networkMap.d.ts.map create mode 100644 dist/extension/onEvent.d.ts create mode 100644 dist/extension/onEvent.d.ts.map create mode 100644 dist/extension/otaUpdate.d.ts create mode 100644 dist/extension/otaUpdate.d.ts.map create mode 100644 dist/extension/publish.d.ts create mode 100644 dist/extension/publish.d.ts.map create mode 100644 dist/extension/receive.d.ts create mode 100644 dist/extension/receive.d.ts.map create mode 100644 dist/model/device.d.ts create mode 100644 dist/model/device.d.ts.map create mode 100644 dist/model/group.d.ts create mode 100644 dist/model/group.d.ts.map create mode 100644 dist/mqtt.d.ts create mode 100644 dist/mqtt.d.ts.map create mode 100644 dist/state.d.ts create mode 100644 dist/state.d.ts.map create mode 100644 dist/types/api.d.ts create mode 100644 dist/types/api.d.ts.map create mode 100644 dist/util/data.d.ts create mode 100644 dist/util/data.d.ts.map create mode 100644 dist/util/logger.d.ts create mode 100644 dist/util/logger.d.ts.map create mode 100644 dist/util/onboarding.d.ts create mode 100644 dist/util/onboarding.d.ts.map create mode 100644 dist/util/sd-notify.d.ts create mode 100644 dist/util/sd-notify.d.ts.map create mode 100644 dist/util/settings.d.ts create mode 100644 dist/util/settings.d.ts.map create mode 100644 dist/util/settingsMigration.d.ts create mode 100644 dist/util/settingsMigration.d.ts.map create mode 100644 dist/util/utils.d.ts create mode 100644 dist/util/utils.d.ts.map create mode 100644 dist/util/yaml.d.ts create mode 100644 dist/util/yaml.d.ts.map create mode 100644 dist/zigbee.d.ts create mode 100644 dist/zigbee.d.ts.map diff --git a/LICENSE b/LICENSE new file mode 100644 index 00000000..9cecc1d4 --- /dev/null +++ b/LICENSE @@ -0,0 +1,674 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + 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 . + +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 +. + + 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 +. diff --git a/dist/controller.d.ts b/dist/controller.d.ts new file mode 100644 index 00000000..40dc2ff8 --- /dev/null +++ b/dist/controller.d.ts @@ -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; + readonly extensionArgs: ConstructorParameters; + private sdNotify; + constructor(restartCallback: () => Promise, exitCallback: (code: number, restart: boolean) => Promise); + start(): Promise; + enableDisableExtension(enable: boolean, name: string): Promise; + getExtension(name: string): Extension | undefined; + addExtension(extension: Extension): Promise; + removeExtension(extension: Extension): Promise; + private startExtension; + private stopExtension; + stop(restart?: boolean): Promise; + exit(code: number, restart?: boolean): Promise; + onZigbeeAdapterDisconnected(): Promise; + publishEntityState(entity: Group | Device, payload: KeyValue, stateChangeReason?: StateChangeReason): Promise; + iteratePayloadAttributeOutput(topicRoot: string, payload: KeyValue, options: Partial): Promise; +} +//# sourceMappingURL=controller.d.ts.map \ No newline at end of file diff --git a/dist/controller.d.ts.map b/dist/controller.d.ts.map new file mode 100644 index 00000000..be85ffc1 --- /dev/null +++ b/dist/controller.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"controller.d.ts","sourceRoot":"","sources":["../lib/controller.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,SAAS,MAAM,uBAAuB,CAAC;AAwBnD,OAA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,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"} \ No newline at end of file diff --git a/dist/eventBus.d.ts b/dist/eventBus.d.ts new file mode 100644 index 00000000..3ce4699e --- /dev/null +++ b/dist/eventBus.d.ts @@ -0,0 +1,69 @@ +type ListenerKey = object; +type Stats = { + devices: Map; + 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 \ No newline at end of file diff --git a/dist/eventBus.d.ts.map b/dist/eventBus.d.ts.map new file mode 100644 index 00000000..c02e09bc --- /dev/null +++ b/dist/eventBus.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"eventBus.d.ts","sourceRoot":"","sources":["../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AAM,IAAI,GAAG,IAAI;IAI9D,iBAAiB,CAAC,IAAI,EAAE,SAAS,CAAC,aAAa,GAAG,IAAI;IAGtD,eAAe,CAAC,GAAG,EAAE,WAAW,EAAE,QAAQ,EAAE,CAAC,IAAI,EAAE,SAAS,CAAC,aAAa,KAAK,IAAI,GAAG,IAAI;IAI1F,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,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"} \ No newline at end of file diff --git a/dist/extension/availability.d.ts b/dist/extension/availability.d.ts new file mode 100644 index 00000000..b56304f5 --- /dev/null +++ b/dist/extension/availability.d.ts @@ -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; + private publishAvailabilityForAllEntities; + private publishAvailability; + private onLastSeenChanged; + stop(): Promise; + private retrieveState; +} +//# sourceMappingURL=availability.d.ts.map \ No newline at end of file diff --git a/dist/extension/availability.d.ts.map b/dist/extension/availability.d.ts.map new file mode 100644 index 00000000..d7cf68b9 --- /dev/null +++ b/dist/extension/availability.d.ts.map @@ -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"} \ No newline at end of file diff --git a/dist/extension/bind.d.ts b/dist/extension/bind.d.ts new file mode 100644 index 00000000..516ccfd1 --- /dev/null +++ b/dist/extension/bind.d.ts @@ -0,0 +1,14 @@ +import Extension from "./extension"; +export default class Bind extends Extension { + private pollDebouncers; + start(): Promise; + private parseMQTTMessage; + private onMQTTMessage; + private publishResponse; + onGroupMembersChanged(data: eventdata.GroupMembersChanged): Promise; + getSetupReportingEndpoints(bind: zh.Bind, coordinatorEp: zh.Endpoint): zh.Endpoint[]; + setupReporting(binds: zh.Bind[]): Promise; + disableUnnecessaryReportings(target: zh.Group | zh.Endpoint): Promise; + poll(data: eventdata.DeviceMessage): Promise; +} +//# sourceMappingURL=bind.d.ts.map \ No newline at end of file diff --git a/dist/extension/bind.d.ts.map b/dist/extension/bind.d.ts.map new file mode 100644 index 00000000..c9653fc5 --- /dev/null +++ b/dist/extension/bind.d.ts.map @@ -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"} \ No newline at end of file diff --git a/dist/extension/bridge.d.ts b/dist/extension/bridge.d.ts new file mode 100644 index 00000000..03ae3a85 --- /dev/null +++ b/dist/extension/bridge.d.ts @@ -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; + stop(): Promise; + onMQTTMessage(data: eventdata.MQTTMessage): Promise; + /** + * Requests + */ + deviceOptions(message: KeyValue | string): Promise>; + groupOptions(message: KeyValue | string): Promise>; + bridgeOptions(message: KeyValue | string): Promise>; + deviceRemove(message: string | KeyValue): Promise>; + groupRemove(message: string | KeyValue): Promise>; + healthCheck(message: string | KeyValue): Promise>; + coordinatorCheck(message: string | KeyValue): Promise>; + groupAdd(message: string | KeyValue): Promise>; + deviceRename(message: string | KeyValue): Promise>; + groupRename(message: string | KeyValue): Promise>; + restart(message: string | KeyValue): Promise>; + backup(message: string | KeyValue): Promise>; + installCodeAdd(message: KeyValue | string): Promise>; + permitJoin(message: KeyValue | string): Promise>; + touchlinkIdentify(message: KeyValue | string): Promise>; + touchlinkFactoryReset(message: KeyValue | string): Promise>; + touchlinkScan(message: KeyValue | string): Promise>; + /** + * Utils + */ + changeEntityOptions(entityType: T, message: KeyValue | string): Promise>; + deviceConfigureReporting(message: string | KeyValue): Promise>; + deviceInterview(message: string | KeyValue): Promise>; + deviceGenerateExternalDefinition(message: string | KeyValue): Promise>; + renameEntity(entityType: T, message: string | KeyValue): Promise>; + removeEntity(entityType: T, message: string | KeyValue): Promise>; + getEntity(type: "group", id: string): Group; + getEntity(type: "device", id: string): Device; + getEntity(type: "group" | "device", id: string): Device | Group; + publishInfo(): Promise; + publishDevices(): Promise; + publishGroups(): Promise; + publishDefinitions(): Promise; + getDefinitionPayload(device: Device): Zigbee2MQTTDevice["definition"] | undefined; +} +//# sourceMappingURL=bridge.d.ts.map \ No newline at end of file diff --git a/dist/extension/bridge.d.ts.map b/dist/extension/bridge.d.ts.map new file mode 100644 index 00000000..96bb7fdc --- /dev/null +++ b/dist/extension/bridge.d.ts.map @@ -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,MAAM,iBAAiB,CAAC;AAKrC,OAAO,SAAS,MAAM,aAAa,CAAC;AAIpC,MAAM,CAAC,OAAO,OAAO,MAAO,SAAQ,SAAS;;IAGzC,OAAO,CAAC,kBAAkB,CAA0C;IACpE,OAAO,CAAC,qBAAqB,CAAqB;IAClD,OAAO,CAAC,+BAA+B,CAAqB;IAC5D,OAAO,CAAC,kBAAkB,CAAyB;IACnD,OAAO,CAAC,eAAe,CAAS;IAChC,OAAO,CAAC,wBAAwB,CAAC,CAAS;IAC1C,OAAO,CAAC,wBAAwB,CAAC,CAAS;IAC1C,OAAO,CAAC,YAAY,CAAqB;IACzC,OAAO,CAAC,aAAa,CAqBnB;IAEa,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IA0ItB,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAKxB,aAAa,CAAC,IAAI,EAAE,SAAS,CAAC,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;IAyBrE;;OAEG;IAES,aAAa,CAAC,OAAO,EAAE,QAAQ,GAAG,MAAM,GA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C;IAsChH,YAAY,CAAC,CAAC,SAAS,QAAQ,GAAG,OAAO,EAC3C,UAAU,EAAE,CAAC,EACb,OAAO,EAAE,MAAM,GAAG,QAAQ,GAC3B,OAAO,CAAC,mBAAmB,CAAC,CAAC,SAAS,QAAQ,GAAG,+BAA+B,GAAG,8BAA8B,CAAC,CAAC;IA8EtH,SAAS,CAAC,IAAI,EAAE,OAAO,EAAE,EAAE,EAAE,MAAM,GAAG,KAAK;IAC3C,SAAS,CAAC,IAAI,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,GAAG,MAAM;IAC7C,SAAS,CAAC,IAAI,EAAE,OAAO,GAAG,QAAQ,EAAE,EAAE,EAAE,MAAM,GAAG,MAAM,GAAG,KAAK;IASzD,WAAW,IAAI,OAAO,CAAC,IAAI,CAAC;IAmC5B,cAAc,IAAI,OAAO,CAAC,IAAI,CAAC;IA8D/B,aAAa,IAAI,OAAO,CAAC,IAAI,CAAC;IAsB9B,kBAAkB,IAAI,OAAO,CAAC,IAAI,CAAC;IAazC,oBAAoB,CAAC,MAAM,EAAE,MAAM,GAAG,iBAAiB,CAAC,YAAY,CAAC,GAAG,SAAS;CA4BpF"} \ No newline at end of file diff --git a/dist/extension/configure.d.ts b/dist/extension/configure.d.ts new file mode 100644 index 00000000..4001c64e --- /dev/null +++ b/dist/extension/configure.d.ts @@ -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; + private configure; +} +//# sourceMappingURL=configure.d.ts.map \ No newline at end of file diff --git a/dist/extension/configure.d.ts.map b/dist/extension/configure.d.ts.map new file mode 100644 index 00000000..62c1f7e9 --- /dev/null +++ b/dist/extension/configure.d.ts.map @@ -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"} \ No newline at end of file diff --git a/dist/extension/extension.d.ts b/dist/extension/extension.d.ts new file mode 100644 index 00000000..e59cdba3 --- /dev/null +++ b/dist/extension/extension.d.ts @@ -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; + protected restartCallback: () => Promise; + protected addExtension: (extension: Extension) => Promise; + /** + * 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, restartCallback: () => Promise, addExtension: (extension: Extension) => Promise); + /** + * Is called once the extension has to start + */ + start(): Promise; + /** + * Is called once the extension has to stop + */ + stop(): Promise; + adjustMessageBeforePublish(_entity: Group | Device, _message: KeyValue): void; +} +export default Extension; +//# sourceMappingURL=extension.d.ts.map \ No newline at end of file diff --git a/dist/extension/extension.d.ts.map b/dist/extension/extension.d.ts.map new file mode 100644 index 00000000..9cd002b7 --- /dev/null +++ b/dist/extension/extension.d.ts.map @@ -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"} \ No newline at end of file diff --git a/dist/extension/externalConverters.d.ts b/dist/extension/externalConverters.d.ts new file mode 100644 index 00000000..e4da5838 --- /dev/null +++ b/dist/extension/externalConverters.d.ts @@ -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 { + constructor(zigbee: Zigbee, mqtt: Mqtt, state: State, publishEntityState: PublishEntityState, eventBus: EventBus, enableDisableExtension: (enable: boolean, name: string) => Promise, restartCallback: () => Promise, addExtension: (extension: Extension) => Promise); + protected removeJS(name: string, _mod: TModule): Promise; + protected loadJS(name: string, mod: TModule, newName?: string): Promise; +} +export {}; +//# sourceMappingURL=externalConverters.d.ts.map \ No newline at end of file diff --git a/dist/extension/externalConverters.d.ts.map b/dist/extension/externalConverters.d.ts.map new file mode 100644 index 00000000..7acf2dca --- /dev/null +++ b/dist/extension/externalConverters.d.ts.map @@ -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"} \ No newline at end of file diff --git a/dist/extension/externalExtensions.d.ts b/dist/extension/externalExtensions.d.ts new file mode 100644 index 00000000..ea3ebc2b --- /dev/null +++ b/dist/extension/externalExtensions.d.ts @@ -0,0 +1,10 @@ +import type Extension from "./extension"; +import ExternalJSExtension from "./externalJS"; +type TModule = new (...args: ConstructorParameters) => Extension; +export default class ExternalExtensions extends ExternalJSExtension { + constructor(zigbee: Zigbee, mqtt: Mqtt, state: State, publishEntityState: PublishEntityState, eventBus: EventBus, enableDisableExtension: (enable: boolean, name: string) => Promise, restartCallback: () => Promise, addExtension: (extension: Extension) => Promise); + protected removeJS(_name: string, mod: TModule): Promise; + protected loadJS(name: string, mod: TModule, newName?: string): Promise; +} +export {}; +//# sourceMappingURL=externalExtensions.d.ts.map \ No newline at end of file diff --git a/dist/extension/externalExtensions.d.ts.map b/dist/extension/externalExtensions.d.ts.map new file mode 100644 index 00000000..7690b677 --- /dev/null +++ b/dist/extension/externalExtensions.d.ts.map @@ -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"} \ No newline at end of file diff --git a/dist/extension/externalJS.d.ts b/dist/extension/externalJS.d.ts new file mode 100644 index 00000000..43b653ff --- /dev/null +++ b/dist/extension/externalJS.d.ts @@ -0,0 +1,32 @@ +import Extension from "./extension"; +export default abstract class ExternalJSExtension 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, restartCallback: () => Promise, addExtension: (extension: Extension) => Promise, 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; + private getFilePath; + protected getFileCode(name: string): string; + protected getFiles(): Generator<{ + name: string; + code: string; + }>; + onMQTTMessage(data: eventdata.MQTTMessage): Promise; + protected abstract removeJS(name: string, mod: M): Promise; + protected abstract loadJS(name: string, mod: M, newName?: string): Promise; + private remove; + private save; + private loadFiles; + private publishExternalJS; + private importFile; +} +//# sourceMappingURL=externalJS.d.ts.map \ No newline at end of file diff --git a/dist/extension/externalJS.d.ts.map b/dist/extension/externalJS.d.ts.map new file mode 100644 index 00000000..8b71b164 --- /dev/null +++ b/dist/extension/externalJS.d.ts.map @@ -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"} \ No newline at end of file diff --git a/dist/extension/frontend.d.ts b/dist/extension/frontend.d.ts new file mode 100644 index 00000000..b4dc6a11 --- /dev/null +++ b/dist/extension/frontend.d.ts @@ -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, restartCallback: () => Promise, addExtension: (extension: Extension) => Promise); + start(): Promise; + stop(): Promise; + private onRequest; + private onUpgrade; + private onWebSocketConnection; + private onMQTTPublishMessageOrEntityState; +} +export default Frontend; +//# sourceMappingURL=frontend.d.ts.map \ No newline at end of file diff --git a/dist/extension/frontend.d.ts.map b/dist/extension/frontend.d.ts.map new file mode 100644 index 00000000..250d3fdf --- /dev/null +++ b/dist/extension/frontend.d.ts.map @@ -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"} \ No newline at end of file diff --git a/dist/extension/groups.d.ts b/dist/extension/groups.d.ts new file mode 100644 index 00000000..337a611a --- /dev/null +++ b/dist/extension/groups.d.ts @@ -0,0 +1,12 @@ +import Extension from "./extension"; +export default class Groups extends Extension { + private lastOptimisticState; + start(): Promise; + onStateChange(data: eventdata.StateChange): Promise; + private shouldPublishPayloadForGroup; + private areAllMembersOffOrClosed; + private parseMQTTMessage; + private onMQTTMessage; + private publishResponse; +} +//# sourceMappingURL=groups.d.ts.map \ No newline at end of file diff --git a/dist/extension/groups.d.ts.map b/dist/extension/groups.d.ts.map new file mode 100644 index 00000000..fa6112b9 --- /dev/null +++ b/dist/extension/groups.d.ts.map @@ -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"} \ No newline at end of file diff --git a/dist/extension/health.d.ts b/dist/extension/health.d.ts new file mode 100644 index 00000000..abaa51ca --- /dev/null +++ b/dist/extension/health.d.ts @@ -0,0 +1,8 @@ +import Extension from "./extension"; +export default class Health extends Extension { + #private; + start(): Promise; + stop(): Promise; + clearStats(): void; +} +//# sourceMappingURL=health.d.ts.map \ No newline at end of file diff --git a/dist/extension/health.d.ts.map b/dist/extension/health.d.ts.map new file mode 100644 index 00000000..dd6fe814 --- /dev/null +++ b/dist/extension/health.d.ts.map @@ -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"} \ No newline at end of file diff --git a/dist/extension/homeassistant.d.ts b/dist/extension/homeassistant.d.ts new file mode 100644 index 00000000..fc155577 --- /dev/null +++ b/dist/extension/homeassistant.d.ts @@ -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, restartCallback: () => Promise, addExtension: (extension: Extension) => Promise); + start(): Promise; + private getDiscovered; + private exposeToConfig; + onEntityRemoved(data: eventdata.EntityRemoved): Promise; + onGroupMembersChanged(data: eventdata.GroupMembersChanged): Promise; + onPublishEntityState(data: eventdata.PublishEntityState): Promise; + onEntityRenamed(data: eventdata.EntityRenamed): Promise; + private getConfigs; + private discover; + private onMQTTMessage; + onZigbeeEvent(data: { + device: Device; + }): Promise; + onScenesChanged(data: eventdata.ScenesChanged): Promise; + 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 \ No newline at end of file diff --git a/dist/extension/homeassistant.d.ts.map b/dist/extension/homeassistant.d.ts.map new file mode 100644 index 00000000..db27acc5 --- /dev/null +++ b/dist/extension/homeassistant.d.ts.map @@ -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,sBAAsB,CAAS;IACvC,OAAO,CAAC,eAAe,CAAS;IAChC,OAAO,CAAC,0BAA0B,CAAS;IAC3C,OAAO,CAAC,gBAAgB,CAAmB;IAE3C,QAAQ,CAAC,OAAO,EAAE;QACd,EAAE,CAAC,EAAE,MAAM,CAAC;QACZ,aAAa,CAAC,EAAE,QAAQ,CAAC;KAC5B,CAAC;IAGF,IAAI,EAAE,IAAI,MAAM,CAEf;IACD,IAAI,IAAI,IAAI,MAAM,CAEjB;IACD,IAAI,eAAe,IAAI,MAAM,CAE5B;IACD,IAAI,eAAe,IAAI,MAAM,CAE5B;IACD,IAAI,OAAO,IAAI,cAAc,EAAE,C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AAoB,CAAC,IAAI,EAAE,SAAS,CAAC,kBAAkB,GAAG,OAAO,CAAC,IAAI,CAAC;IAkEvE,eAAe,CAAC,IAAI,EAAE,SAAS,CAAC,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC;IA4BzE,OAAO,CAAC,UAAU;YA8HJ,QAAQ;YAmQF,aAAa;IA+DrB,aAAa,CAAC,IAAI,EAAE;QAAC,MAAM,EAAE,MAAM,CAAA;KAAC,GAAG,OAAO,CAAC,IAAI,CAAC;IAMpD,eAAe,CAAC,IAAI,EAAE,SAAS,CAAC,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC;IAwBzE,OAAO,CAAC,gBAAgB;IAgDf,0BAA0B,CAAC,MAAM,EAAE,MAAM,GAAG,KAAK,GAAG,MAAM,EAAE,OAAO,EAAE,QAAQ,GAAG,IAAI;IAsB7F,OAAO,CAAC,mBAAmB;IAQ3B,OAAO,CAAC,iBAAiB;YAKX,4BAA4B;IA2C1C,OAAO,CAAC,eAAe;IA0IvB,gBAAgB,CAAC,MAAM,EAAE,MAAM,GAAG,UAAU;IA0B5C,OAAO,CAAC,WAAW;IAWnB,OAAO,CAAC,uBAAuB;IAI/B,OAAO,CAAC,oBAAoB;IAI5B,OAAO,CAAC,sBAAsB;CA0BjC;AAED,eAAe,aAAa,CAAC"} \ No newline at end of file diff --git a/dist/extension/networkMap.d.ts b/dist/extension/networkMap.d.ts new file mode 100644 index 00000000..5caf47c7 --- /dev/null +++ b/dist/extension/networkMap.d.ts @@ -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; + onMQTTMessage(data: eventdata.MQTTMessage): Promise; + raw(topology: Zigbee2MQTTNetworkMap): Zigbee2MQTTNetworkMap; + graphviz(topology: Zigbee2MQTTNetworkMap): string; + plantuml(topology: Zigbee2MQTTNetworkMap): string; + networkScan(includeRoutes: boolean): Promise; +} +//# sourceMappingURL=networkMap.d.ts.map \ No newline at end of file diff --git a/dist/extension/networkMap.d.ts.map b/dist/extension/networkMap.d.ts.map new file mode 100644 index 00000000..fdf8a208 --- /dev/null +++ b/dist/extension/networkMap.d.ts.map @@ -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"} \ No newline at end of file diff --git a/dist/extension/onEvent.d.ts b/dist/extension/onEvent.d.ts new file mode 100644 index 00000000..36094cf3 --- /dev/null +++ b/dist/extension/onEvent.d.ts @@ -0,0 +1,10 @@ +import Extension from "./extension"; +/** + * This extension calls the zigbee-herdsman-converters onEvent. + */ +export default class OnEvent extends Extension { + start(): Promise; + stop(): Promise; + private callOnEvent; +} +//# sourceMappingURL=onEvent.d.ts.map \ No newline at end of file diff --git a/dist/extension/onEvent.d.ts.map b/dist/extension/onEvent.d.ts.map new file mode 100644 index 00000000..971f83ca --- /dev/null +++ b/dist/extension/onEvent.d.ts.map @@ -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"} \ No newline at end of file diff --git a/dist/extension/otaUpdate.d.ts b/dist/extension/otaUpdate.d.ts new file mode 100644 index 00000000..71308138 --- /dev/null +++ b/dist/extension/otaUpdate.d.ts @@ -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; + private removeProgressAndRemainingFromState; + private onZigbeeEvent; + private readSoftwareBuildIDAndDateCode; + private getEntityPublishPayload; + onMQTTMessage(data: eventdata.MQTTMessage): Promise; +} +export {}; +//# sourceMappingURL=otaUpdate.d.ts.map \ No newline at end of file diff --git a/dist/extension/otaUpdate.d.ts.map b/dist/extension/otaUpdate.d.ts.map new file mode 100644 index 00000000..b31e0eb9 --- /dev/null +++ b/dist/extension/otaUpdate.d.ts.map @@ -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"} \ No newline at end of file diff --git a/dist/extension/publish.d.ts b/dist/extension/publish.d.ts new file mode 100644 index 00000000..efb5d9ac --- /dev/null +++ b/dist/extension/publish.d.ts @@ -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; + parseTopic(topic: string): ParsedTopic | undefined; + parseMessage(parsedTopic: ParsedTopic, data: eventdata.MQTTMessage): KeyValue | undefined; + updateMessageHomeAssistant(message: KeyValue, entityState: KeyValue): void; + onMQTTMessage(data: eventdata.MQTTMessage): Promise; + private getDefinitionConverters; +} +export {}; +//# sourceMappingURL=publish.d.ts.map \ No newline at end of file diff --git a/dist/extension/publish.d.ts.map b/dist/extension/publish.d.ts.map new file mode 100644 index 00000000..a6663a8a --- /dev/null +++ b/dist/extension/publish.d.ts.map @@ -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"} \ No newline at end of file diff --git a/dist/extension/receive.d.ts b/dist/extension/receive.d.ts new file mode 100644 index 00000000..fd742c16 --- /dev/null +++ b/dist/extension/receive.d.ts @@ -0,0 +1,13 @@ +import Extension from "./extension"; +export default class Receive extends Extension { + private elapsed; + private debouncers; + private throttlers; + start(): Promise; + onPublishEntityState(data: eventdata.PublishEntityState): void; + publishDebounce(device: Device, payload: KeyValue, time: number, debounceIgnore: string[] | undefined): void; + publishThrottle(device: Device, payload: KeyValue, time: number): Promise; + isPayloadConflicted(newPayload: KeyValue, oldPayload: KeyValue, debounceIgnore: string[] | undefined): boolean; + onDeviceMessage(data: eventdata.DeviceMessage): Promise; +} +//# sourceMappingURL=receive.d.ts.map \ No newline at end of file diff --git a/dist/extension/receive.d.ts.map b/dist/extension/receive.d.ts.map new file mode 100644 index 00000000..ed9ca4d2 --- /dev/null +++ b/dist/extension/receive.d.ts.map @@ -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"} \ No newline at end of file diff --git a/dist/model/device.d.ts b/dist/model/device.d.ts new file mode 100644 index 00000000..8f105c03 --- /dev/null +++ b/dist/model/device.d.ts @@ -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; + 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 \ No newline at end of file diff --git a/dist/model/device.d.ts.map b/dist/model/device.d.ts.map new file mode 100644 index 00000000..9ab5bdb6 --- /dev/null +++ b/dist/model/device.d.ts.map @@ -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"} \ No newline at end of file diff --git a/dist/model/group.d.ts b/dist/model/group.d.ts new file mode 100644 index 00000000..608161e3 --- /dev/null +++ b/dist/model/group.d.ts @@ -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; + membersDefinitions(): zhc.Definition[]; + isDevice(): this is Device; + isGroup(): this is Group; +} +//# sourceMappingURL=group.d.ts.map \ No newline at end of file diff --git a/dist/model/group.d.ts.map b/dist/model/group.d.ts.map new file mode 100644 index 00000000..a86dfd7b --- /dev/null +++ b/dist/model/group.d.ts.map @@ -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"} \ No newline at end of file diff --git a/dist/mqtt.d.ts b/dist/mqtt.d.ts new file mode 100644 index 00000000..21fd7143 --- /dev/null +++ b/dist/mqtt.d.ts @@ -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; + disconnect(): Promise; + subscribe(topic: string): Promise; + unsubscribe(topic: string): Promise; + private onConnect; + onMessage(topic: string, message: Buffer): void; + isConnected(): boolean; + publish(topic: string, payload: string, options?: Partial): Promise; +} +//# sourceMappingURL=mqtt.d.ts.map \ No newline at end of file diff --git a/dist/mqtt.d.ts.map b/dist/mqtt.d.ts.map new file mode 100644 index 00000000..8a691b14 --- /dev/null +++ b/dist/mqtt.d.ts.map @@ -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"} \ No newline at end of file diff --git a/dist/state.d.ts b/dist/state.d.ts new file mode 100644 index 00000000..9f8c11cb --- /dev/null +++ b/dist/state.d.ts @@ -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 \ No newline at end of file diff --git a/dist/state.d.ts.map b/dist/state.d.ts.map new file mode 100644 index 00000000..8f921645 --- /dev/null +++ b/dist/state.d.ts.map @@ -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"} \ No newline at end of file diff --git a/dist/types/api.d.ts b/dist/types/api.d.ts new file mode 100644 index 00000000..e82d9976 --- /dev/null +++ b/dist/types/api.d.ts @@ -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; +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; + }; + 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; + 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; +} +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>>; + custom_clusters: Record; + }; + "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; + }; + "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; + "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; + "bridge/request/extension/remove": { + name: string; + }; + "bridge/response/extension/remove": Record; + "bridge/request/converter/save": { + name: string; + code: string; + }; + "bridge/response/converter/save": Record; + "bridge/request/converter/remove": { + name: string; + }; + "bridge/response/converter/remove": Record; + "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; + }; + "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; + }; + "bridge/response/device/options": { + id: string; + from: Record; + to: Record; + 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; + }; + "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; + }; + "bridge/response/group/options": { + id: string; + from: Record; + to: Record; + 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; + "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 = { + transaction?: string; +} & Zigbee2MQTTAPI[T]; +export type Zigbee2MQTTResponseOK = { + status: "ok"; + data: Zigbee2MQTTAPI[T]; + transaction?: string; +}; +export type Zigbee2MQTTResponseError = { + status: "error"; + data: Record; + error: string; + transaction?: string; +}; +export type Zigbee2MQTTResponse = Zigbee2MQTTResponseOK | Zigbee2MQTTResponseError; +//# sourceMappingURL=api.d.ts.map \ No newline at end of file diff --git a/dist/types/api.d.ts.map b/dist/types/api.d.ts.map new file mode 100644 index 00000000..f15ce197 --- /dev/null +++ b/dist/types/api.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../lib/types/api.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,uBAAuB,MAAM,4BAA4B,CAAC;AAC3E,OAAO,KAAK,EAAC,IAAI,EAAC,MAAM,wCAAwC,CAAC;AACjE,OAAO,KAAK,KAAK,cAAc,MAAM,sBAAsB,CAAC;AAC5D,OAAO,KAAK,EAAC,iBAAiB,EAAE,WAAW,EAAE,cAAc,EAAC,MAAM,kDAAkD,CAAC;AAErH,YAAY,KAAK,KAAK,MAAM,4BAA4B,CAAC;AACzD,YAAY,KAAK,GAAG,MAAM,gCAAgC,CAAC;AAC3D,YAAY,KAAK,GAAG,MAAM,gCAAgC,CAAC;AAE3D,MAAM,MAAM,mBAAmB,GAAG;IAC9B,IAAI,EAAE,IAAI,CAAC;IACX,MAAM,EAAE,uBAAuB,CAAC,MAAM,CAAC;IACvC,IAAI,EAAE,uBAAuB,CAAC,IAAI,CAAC;IACnC,MAAM,EAAE,uBAAuB,CAAC,MAAM,CAAC;IACvC,IAAI,EAAE,uBAAuB,CAAC,IAAI,CAAC;IACnC,OAAO,EAAE,uBAAuB,CAAC,OAAO,CAAC;IACzC,IAAI,EAAE,uBAAuB,CAAC,IAAI,CAAC;IACnC,IAAI,EAAE,uBAAuB,CAAC,IAAI,CAAC;IACnC,SAAS,EAAE,uBAAuB,CAAC,SAAS,CAAC;IAC7C,KAAK,EAAE,uBAAuB,CAAC,KAAK,CAAC;IACrC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M,qBAAqB,CAAC,CAAC,SAAS,4BAA4B,IAAI;IACxE,MAAM,EAAE,IAAI,CAAC;IACb,IAAI,EAAE,cAAc,CAAC,CAAC,CAAC,CAAC;IACxB,WAAW,CAAC,EAAE,MAAM,CAAC;CACxB,CAAC;AAEF,MAAM,MAAM,wBAAwB,GAAG;IACnC,MAAM,EAAE,OAAO,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;CACxB,CAAC;AAEF,MAAM,MAAM,mBAAmB,CAAC,CAAC,SAAS,4BAA4B,IAAI,qBAAqB,CAAC,CAAC,CAAC,GAAG,wBAAwB,CAAC"} \ No newline at end of file diff --git a/dist/util/data.d.ts b/dist/util/data.d.ts new file mode 100644 index 00000000..ae25d917 --- /dev/null +++ b/dist/util/data.d.ts @@ -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 \ No newline at end of file diff --git a/dist/util/data.d.ts.map b/dist/util/data.d.ts.map new file mode 100644 index 00000000..3ced8d7c --- /dev/null +++ b/dist/util/data.d.ts.map @@ -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"} \ No newline at end of file diff --git a/dist/util/logger.d.ts b/dist/util/logger.d.ts new file mode 100644 index 00000000..6f3b85fc --- /dev/null +++ b/dist/util/logger.d.ts @@ -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; + setNamespacedLevels(nsLevels: Record): 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; +} +declare const _default: Logger; +export default _default; +//# sourceMappingURL=logger.d.ts.map \ No newline at end of file diff --git a/dist/util/logger.d.ts.map b/dist/util/logger.d.ts.map new file mode 100644 index 00000000..5acb821a --- /dev/null +++ b/dist/util/logger.d.ts.map @@ -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"} \ No newline at end of file diff --git a/dist/util/onboarding.d.ts b/dist/util/onboarding.d.ts new file mode 100644 index 00000000..66578802 --- /dev/null +++ b/dist/util/onboarding.d.ts @@ -0,0 +1,2 @@ +export declare function onboard(): Promise; +//# sourceMappingURL=onboarding.d.ts.map \ No newline at end of file diff --git a/dist/util/onboarding.d.ts.map b/dist/util/onboarding.d.ts.map new file mode 100644 index 00000000..2721e1ef --- /dev/null +++ b/dist/util/onboarding.d.ts.map @@ -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"} \ No newline at end of file diff --git a/dist/util/sd-notify.d.ts b/dist/util/sd-notify.d.ts new file mode 100644 index 00000000..66ca5967 --- /dev/null +++ b/dist/util/sd-notify.d.ts @@ -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 \ No newline at end of file diff --git a/dist/util/sd-notify.d.ts.map b/dist/util/sd-notify.d.ts.map new file mode 100644 index 00000000..b38bca04 --- /dev/null +++ b/dist/util/sd-notify.d.ts.map @@ -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"} \ No newline at end of file diff --git a/dist/util/settings.d.ts b/dist/util/settings.d.ts new file mode 100644 index 00000000..d21ca61e --- /dev/null +++ b/dist/util/settings.d.ts @@ -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; +export declare function get(): Settings; +export declare function set(path: string[], value: string | number | boolean | KeyValue): void; +export declare function apply(settings: Record, 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 \ No newline at end of file diff --git a/dist/util/settings.d.ts.map b/dist/util/settings.d.ts.map new file mode 100644 index 00000000..608a2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AG,mBAAmB,GAAG,SAAS,CAe3E;AAWD,wBAAgB,SAAS,CAAC,EAAE,EAAE,MAAM,GAAG,mBAAmB,CAgBzD;AAED,wBAAgB,WAAW,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,CAQ5C;AAED,wBAAgB,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAKnD;AAED,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,CAAC,EAAE,MAAM,GAAG,YAAY,CAiChE;AAED,wBAAgB,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAO3D;AAED,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,QAAQ,GAAG,OAAO,CAiCnF;AAED,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI,CAwB1E;AAED,wBAAgB,MAAM,IAAI,IAAI,CAK7B;AAED,eAAO,MAAM,OAAO;;iBAEL,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAMlB,CAAC"} \ No newline at end of file diff --git a/dist/util/settingsMigration.d.ts b/dist/util/settingsMigration.d.ts new file mode 100644 index 00000000..8f8ff6d5 --- /dev/null +++ b/dist/util/settingsMigration.d.ts @@ -0,0 +1,11 @@ +/** + * Order of execution: + * - Transfer + * - Change + * - 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 \ No newline at end of file diff --git a/dist/util/settingsMigration.d.ts.map b/dist/util/settingsMigration.d.ts.map new file mode 100644 index 00000000..7f95cb30 --- /dev/null +++ b/dist/util/settingsMigration.d.ts.map @@ -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"} \ No newline at end of file diff --git a/dist/util/utils.d.ts b/dist/util/utils.d.ts new file mode 100644 index 00000000..f605d9a3 --- /dev/null +++ b/dist/util/utils.d.ts @@ -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(object: KeyValue, key: string, defaultValue: NoInfer): T; +declare function getResponse(request: KeyValue | string, data: Zigbee2MQTTAPI[T], error?: string): Zigbee2MQTTResponse; +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; +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(arr: Type[][]): Type[]; +declare function arrayUnique(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; +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 \ No newline at end of file diff --git a/dist/util/utils.d.ts.map b/dist/util/utils.d.ts.map new file mode 100644 index 00000000..383739b3 --- /dev/null +++ b/dist/util/utils.d.ts.map @@ -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,mBAAmB,EAAE,4BAA4B,EAAE,gBAAgB,EAAC,MAAM,cAAc,CAAC;AA+BtH,iBAAS,UAAU,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAErC;AAED,wBAAsB,qBAAqB,CAAC,iBAAiB,UAAO,GAAG,OAAO,CAAC;IAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAC,CAAC,CAwBrH;AAED,iBAAe,oBAAoB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAC,CAAC,CAG9E;AAED,iBAAS,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,GAAG,gBAAgB,GAAG,OAAO,GAAG,UAAU,GAAG,MAAM,GAAG,MAAM,CAiB7G;AAED,iBAAS,aAAa,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAK9C;AAED,iBAAS,mBAAmB,CAAC,MAAM,EAAE;IAAC,CAAC,CAAC,EAAE,MAAM,GAA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AE,GAAG,CAAC,MAAM,GAAG,MAAM,IAAI,GAAG,CAAC,IAAI,CAEnE;AAED,wBAAgB,cAAc,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,GAAG,MAAM,IAAI,GAAG,CAAC,MAAM,CAEvE;AAED,wBAAgB,aAAa,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,GAAG,MAAM,IAAI,GAAG,CAAC,KAAK,CAErE;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,KAAK,IAAI,MAAM,CAItF;AAED,iBAAS,SAAS,CAAC,MAAM,EAAE,EAAE,CAAC,QAAQ,GAAG,EAAE,CAAC,KAAK,GAAG,gBAAgB,EAAE,CAiBrE;AAED,iBAAS,oBAAoB,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,GAAG,OAAO,CAExD;AAED,iBAAS,eAAe,CAAC,KAAK,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"} \ No newline at end of file diff --git a/dist/util/yaml.d.ts b/dist/util/yaml.d.ts new file mode 100644 index 00000000..5e6d306e --- /dev/null +++ b/dist/util/yaml.d.ts @@ -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 \ No newline at end of file diff --git a/dist/util/yaml.d.ts.map b/dist/util/yaml.d.ts.map new file mode 100644 index 00000000..7e2a848c --- /dev/null +++ b/dist/util/yaml.d.ts.map @@ -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"} \ No newline at end of file diff --git a/dist/zigbee.d.ts b/dist/zigbee.d.ts new file mode 100644 index 00000000..492623e7 --- /dev/null +++ b/dist/zigbee.d.ts @@ -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; + private logDeviceInterview; + private generateNetworkKey; + private generateExtPanID; + private generatePanID; + getCoordinatorVersion(): Promise; + isStopping(): boolean; + backup(): Promise; + coordinatorCheck(): Promise<{ + missingRouters: Device[]; + }>; + getNetworkParameters(): Promise; + stop(): Promise; + getPermitJoin(): boolean; + getPermitJoinEnd(): number | undefined; + permitJoin(time: number, device?: Device): Promise; + resolveDevicesDefinitions(ignoreCache?: boolean): Promise; + 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; + groupsIterator(predicate?: (value: zh.Group) => boolean): Generator; + devicesIterator(predicate?: (value: zh.Device) => boolean): Generator; + private acceptJoiningDeviceHandler; + touchlinkFactoryResetFirst(): Promise; + touchlinkFactoryReset(ieeeAddr: string, channel: number): Promise; + addInstallCode(installCode: string): Promise; + touchlinkIdentify(ieeeAddr: string, channel: number): Promise; + 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 \ No newline at end of file diff --git a/dist/zigbee.d.ts.map b/dist/zigbee.d.ts.map new file mode 100644 index 00000000..a81b543f --- /dev/null +++ b/dist/zigbee.d.ts.map @@ -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,CA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AAC;IAiCnI,wBAAwB,IAAI,EAAE,CAAC,QAAQ;IAItC,wBAAwB,CACrB,eAAe,CAAC,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,MAAM,KAAK,OAAO,EAC/C,cAAc,CAAC,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,KAAK,OAAO,GAC9C,SAAS,CAAC,MAAM,GAAG,KAAK,CAAC;IAY3B,cAAc,CAAC,SAAS,CAAC,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,KAAK,OAAO,GAAG,SAAS,CAAC,KAAK,CAAC;IAO1E,eAAe,CAAC,SAAS,CAAC,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,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"} \ No newline at end of file diff --git a/package.json b/package.json index ddbf31d0..d54db621 100644 --- a/package.json +++ b/package.json @@ -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",