pax_global_header00006660000000000000000000000064152424103570014515gustar00rootroot0000000000000052 comment=6e8ebbc5b3d711b64248ab4447b851c7b9f3cd11 aioeagle-1.1.1/000077500000000000000000000000001524241035700132635ustar00rootroot00000000000000aioeagle-1.1.1/.github/000077500000000000000000000000001524241035700146235ustar00rootroot00000000000000aioeagle-1.1.1/.github/dependabot.yml000066400000000000000000000004101524241035700174460ustar00rootroot00000000000000version: 2 updates: - package-ecosystem: "github-actions" directory: "/" schedule: interval: daily open-pull-requests-limit: 10 - package-ecosystem: pip directory: "/" schedule: interval: weekly open-pull-requests-limit: 10 aioeagle-1.1.1/.github/release-drafter.yml000066400000000000000000000002221524241035700204070ustar00rootroot00000000000000categories: - title: "⬆️ Dependencies" collapse-after: 1 labels: - "dependencies" template: | ## What's Changed $CHANGES aioeagle-1.1.1/.github/workflows/000077500000000000000000000000001524241035700166605ustar00rootroot00000000000000aioeagle-1.1.1/.github/workflows/pythonpublish.yml000066400000000000000000000014701524241035700223150ustar00rootroot00000000000000# This workflows will upload a Python Package using Twine when a release is created # For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries name: Upload Python Package on: release: types: [published] jobs: deploy: runs-on: ubuntu-latest steps: - uses: actions/checkout@v7.0.1 - name: Set up Python uses: actions/setup-python@v7.0.0 with: python-version: '3.x' - name: Install dependencies run: | python -m pip install --upgrade pip pip install build twine - name: Build and publish env: TWINE_USERNAME: __token__ TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }} run: | python -m build twine upload dist/* aioeagle-1.1.1/.github/workflows/release-drafter.yml000066400000000000000000000005121524241035700224460ustar00rootroot00000000000000name: Release Drafter on: push: branches: - main jobs: update_release_draft: runs-on: ubuntu-latest steps: # Drafts your next Release notes as Pull Requests are merged into "master" - uses: release-drafter/release-drafter@v7.7.0 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} aioeagle-1.1.1/.github/workflows/test.yml000066400000000000000000000014741524241035700203700ustar00rootroot00000000000000# This workflow will install Python dependencies, run tests and lint with a single version of Python # For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions name: Run Tests on: push: branches: [main] pull_request: branches: [main] jobs: build: runs-on: ubuntu-latest steps: - uses: actions/checkout@v7.0.1 - name: Set up Python 3.13 uses: actions/setup-python@v7.0.0 with: python-version: "3.13" - name: Install dependencies run: | pip install -r requirements.txt pip install -r requirements-test.txt - name: Lint with flake8 run: | flake8 aioeagle - name: Check formatting with black run: | black aioeagle --check aioeagle-1.1.1/.gitignore000066400000000000000000000001101524241035700152430ustar00rootroot00000000000000*.py[cod] venv pip-selfcheck.json pyvenv.cfg *.egg-info .DS_Store .idea aioeagle-1.1.1/AI_POLICY.md000066400000000000000000000074711524241035700151660ustar00rootroot00000000000000# Open Home Foundation - AI Policy We support using AI (i.e., LLMs) as tools when contributing to Open Home Foundation projects. However, you are responsible for any contributions you submit, and we are responsible for any contributions we merge and release. We hold a high bar for all contributions to our projects. Our maintainers dedicate their time and expertise to reviewing contributions. Submitting AI-generated content that you have not personally reviewed and understood wastes that time and will not be accepted. ## Autonomous agents **We do not allow autonomous agents to be used for contributing to our projects.** We will close any pull requests or issues that we believe were created autonomously, and may mark automated comments as spam. This includes contributions that bypass the provided issue or pull request templates. ## Communication on issues, pull requests, and code reviews We don't mind if you use AI tools to help you write. However, do not have tools post unreviewed content on your behalf. Keep responses to the minimum needed to communicate your intent. We may hide any comments that we believe are unreviewed AI output. If you are opening a pull request, we expect you to be able to explain the proposed changes in your own words. This includes the pull request description and responses to questions. If you use AI to help generate the pull request summary, you must review it for technical accuracy. **Do not use AI to generate answers to questions from maintainers.** You should understand and be able to explain your own work. Using AI to improve grammar or clarity is fine, but the substance of your responses must be your own. If you wish to include context from an interaction with AI in your comments, it must be in a quote block (e.g., using `>`) and disclosed as such. It must be accompanied by your own commentary explaining the relevance and implications of the context. Do not share long snippets. ## Non-native English speakers We understand that AI is useful when communicating as a non-native English speaker. Using AI to improve the grammar or clarity of text you have written yourself is fine. If you are using AI to translate your comments, please ensure the translation accurately reflects your intent. Including your original text in a details block shows the effort behind your contribution, helps maintainers verify the translation if needed, and keeps the conversation readable. ## Code and documentation contributions AI can be a helpful tool for writing code and documentation. However, due to the foundational open source nature of our projects, we require a human in the loop who understands the work produced by AI. All contributions must be reviewed and understood by the contributor before submission. You should be able to explain every change in a pull request you submit. Pull requests that appear to be unreviewed AI output will be closed without review. ## Our use of AI Some of our projects use AI tools to assist with code reviews, issue triaging, reporting, and other project management tasks. These tools may leave comments on pull requests or issues. As with any automated tooling, these comments are not always correct. If an AI tool leaves a comment on your contribution, treat it as you would any other review comment. If you believe it is incorrect, say so; a brief explanation is sufficient. Maintainers always have the final say. If in doubt, ask a maintainer. ## Enforcement Contributions that do not follow this policy will be closed. Repeated violations may result in being blocked from contributing to OHF projects. If you believe your contribution was closed in error, you are welcome to reach out to a maintainer to discuss. --- The canonical version of this policy is published at . In case of differences, the published version applies. aioeagle-1.1.1/LICENSE000066400000000000000000000261221524241035700142730ustar00rootroot00000000000000 Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. Copyright 2018 Paulus Schoutsen Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. aioeagle-1.1.1/README.md000066400000000000000000000022521524241035700145430ustar00rootroot00000000000000# Aioeagle ## Asynchronous library to control Rainforest EAGLE-200 Requires Python 3.8+ and uses asyncio and aiohttp. ```python import asyncio from pprint import pprint import aiohttp from aioeagle import EagleHub CLOUD_ID = "123456" INSTALL_CODE = "abcdefghijklmn" async def main(): async with aiohttp.ClientSession() as session: await run(session) async def run(websession): hub = EagleHub(websession, CLOUD_ID, INSTALL_CODE) devices = await hub.get_device_list() if len(devices) == 0: print("No devices found") return device = devices[0] pprint(device.details) print() pprint(await device.get_device_query(device.ENERGY_AND_POWER_VARIABLES)) asyncio.run(main()) ``` ## Testing locally ```bash python3 example.py ``` ## Timeouts Aioeagle does not specify any timeouts for any requests. You will need to specify them in your own code. We recommend the `async_timeout` package: ```python import async_timeout with async_timeout.timeout(10): devices = await hub.get_device_list() ``` ## Contribution guidelines Object hierarchy and property/method names should match the EAGLE-200 API. aioeagle-1.1.1/aioeagle/000077500000000000000000000000001524241035700150315ustar00rootroot00000000000000aioeagle-1.1.1/aioeagle/__init__.py000066400000000000000000000002671524241035700171470ustar00rootroot00000000000000"""Package to control EAGLE-200 devices.""" from .hub import EagleHub # noqa: F401 from .errors import * # noqa: F403, F401 from .electric_meter import ElectricMeter # noqa: F401 aioeagle-1.1.1/aioeagle/electric_meter.py000066400000000000000000000066301524241035700203760ustar00rootroot00000000000000from .util import xmltodict_ensure_list, create_command class ElectricMeter: """Represent an electric meter. {'ConnectionStatus': 'Connected', 'HardwareAddress': '0x00abcd123', 'LastContact': '0x611d885a', 'Manufacturer': 'Generic', 'ModelId': 'electric_meter', 'Name': 'Power Meter', 'NetworkAddress': '0x0000', 'Protocol': 'Zigbee'} """ # Bug in the API is causing CurrentSummationDelivered not # to be returned. So just fetch all (default behavior) ENERGY_AND_POWER_VARIABLES = [ "zigbee:InstantaneousDemand", "zigbee:CurrentSummationDelivered", "zigbee:CurrentSummationReceived", ] @classmethod def create_instance(cls, hub, hardware_address): """Create a new electric meter.""" return cls( { "HardwareAddress": hardware_address, }, hub.make_request, ) def __init__(self, details, make_request): """Initialize the electric meter.""" self.details = details self.make_request = make_request @property def is_connected(self) -> bool: """Return connection status.""" return self.details["ConnectionStatus"] == "Connected" @property def connection_status(self) -> str: return self.details["ConnectionStatus"] @property def hardware_address(self) -> str: return self.details["HardwareAddress"] @property def last_contact(self) -> str: return self.details["LastContact"] @property def manufacturer(self) -> str: return self.details["Manufacturer"] @property def model_id(self) -> str: return self.details["ModelId"] @property def name(self) -> str: return self.details["Name"] @property def network_address(self) -> str: return self.details["NetworkAddress"] @property def protocol(self) -> str: return self.details["Protocol"] def create_command(self, command, extra_data={}): """Create command targeting this device.""" return create_command( command, {"DeviceDetails": {"HardwareAddress": self.hardware_address}, **extra_data}, ) async def get_device_details(self): data = await self.make_request( self.create_command( "device_details", ) ) return xmltodict_ensure_list(data["Device"]["Components"], "Component") async def get_device_query(self, variables=None): """Query data.""" if variables is None: components = {"All": "Y"} else: components = { "Component": { "Name": "Main", "Variables": [{"Variable": {"Name": var}} for var in variables], } } data = await self.make_request( self.create_command( "device_query", {"Components": components}, ) ) self.details = data["Device"]["DeviceDetails"] result = {} for component in xmltodict_ensure_list( data["Device"]["Components"], "Component" ): for variable in component["Variables"]["Variable"]: result[variable["Name"]] = variable return result def __repr__(self) -> str: return f"" aioeagle-1.1.1/aioeagle/errors.py000066400000000000000000000001671524241035700167230ustar00rootroot00000000000000class EagleError(Exception): """Base error.""" class BadAuth(EagleError): """Authentication not accepted.""" aioeagle-1.1.1/aioeagle/hub.py000066400000000000000000000044511524241035700161650ustar00rootroot00000000000000"""EAGLE-200 hub.""" from __future__ import annotations import asyncio import logging from time import time from aiohttp import ClientSession, encode_basic_auth import xmltodict from .electric_meter import ElectricMeter from .errors import BadAuth from .util import create_command, xmltodict_ensure_list _LOGGER = logging.getLogger(__name__) class EagleHub: """EAGLE-200 hub.""" def __init__( self, session: ClientSession, cloud_id: str, install_code: str, *, host: str | None = None, ) -> None: """Initialize hub.""" self.session = session if host is None: self.host = f"eagle-{cloud_id}.local" else: self.host = host self.cloud_id = cloud_id self.install_code = install_code self.devices = [] self.auth_header = encode_basic_auth(cloud_id, install_code) self.next_request = time() async def make_request(self, command_xml: str): """Make a request.""" wait_time = self.next_request - time() if wait_time > 0: _LOGGER.debug("Sleeping %s", wait_time) await asyncio.sleep(wait_time) url = f"http://{self.host}/cgi-bin/post_manager" _LOGGER.debug("Sending to %s: %s", url, command_xml) async with self.session.post( url, headers={ "Authorization": self.auth_header, "content-type": "text/xml", }, data=command_xml, ) as response: # Wait a second until the next request self.next_request = time() + 1 if response.status == 401: raise BadAuth text = await response.text() return xmltodict.parse(text, dict_constructor=dict) async def get_device_list(self) -> list[ElectricMeter]: """Get a list of devices.""" response = await self.make_request(create_command("device_list")) result = [] for device in xmltodict_ensure_list(response["DeviceList"], "Device"): if device["ModelId"] == "electric_meter": result.append(ElectricMeter(device, self.make_request)) else: _LOGGER.debug(f"Skipping unknown device {device['ModelId']}") return result aioeagle-1.1.1/aioeagle/util.py000066400000000000000000000016011524241035700163560ustar00rootroot00000000000000def xmltodict_ensure_list(value, key): """Make sure response is a list xmltodict doesn't know schema's so doesn't know something should be a list or not. """ if value is None: return [] value = value[key] if isinstance(value, list): return value return [value] def create_command(command, extra_data={}): """Create a basic command string This is used to create a command string that can be used to send to the device. """ return dicttoxml( { "Command": { "Name": command, **extra_data, }, }, ) def dicttoxml(value): if isinstance(value, dict): return "".join(f"<{key}>{dicttoxml(val)}" for key, val in value.items()) if isinstance(value, list): return "".join(dicttoxml(val) for val in value) return value aioeagle-1.1.1/data.txt000066400000000000000000000353241524241035700147440ustar00rootroot00000000000000{'zigbee:Block1Threshold': {'Description': 'the block threshold values for a ' 'given period (typically the ' 'billing cycle)', 'Name': 'zigbee:Block1Threshold', 'Units': 'kWh', 'Value': None}, 'zigbee:Block2Threshold': {'Description': 'the block threshold values for a ' 'given period (typically the ' 'billing cycle)', 'Name': 'zigbee:Block2Threshold', 'Units': 'kWh', 'Value': None}, 'zigbee:Block3Threshold': {'Description': 'the block threshold values for a ' 'given period (typically the ' 'billing cycle)', 'Name': 'zigbee:Block3Threshold', 'Units': 'kWh', 'Value': None}, 'zigbee:Block4Threshold': {'Description': 'the block threshold values for a ' 'given period (typically the ' 'billing cycle)', 'Name': 'zigbee:Block4Threshold', 'Units': 'kWh', 'Value': None}, 'zigbee:Block5Threshold': {'Description': 'the block threshold values for a ' 'given period (typically the ' 'billing cycle)', 'Name': 'zigbee:Block5Threshold', 'Units': 'kWh', 'Value': None}, 'zigbee:Block6Threshold': {'Description': 'the block threshold values for a ' 'given period (typically the ' 'billing cycle)', 'Name': 'zigbee:Block6Threshold', 'Units': 'kWh', 'Value': None}, 'zigbee:Block7Threshold': {'Description': 'the block threshold values for a ' 'given period (typically the ' 'billing cycle)', 'Name': 'zigbee:Block7Threshold', 'Units': 'kWh', 'Value': None}, 'zigbee:Block8Threshold': {'Description': 'the block threshold values for a ' 'given period (typically the ' 'billing cycle)', 'Name': 'zigbee:Block8Threshold', 'Units': 'kWh', 'Value': None}, 'zigbee:BlockPeriodDuration': {'Description': 'The current block tariff ' 'period duration in minutes', 'Name': 'zigbee:BlockPeriodDuration', 'Units': 'min', 'Value': '0'}, 'zigbee:BlockPeriodNumberOfBlocks': {'Description': None, 'Name': 'zigbee:BlockPeriodNumberOfBlocks', 'Units': None, 'Value': '0'}, 'zigbee:CurrentBillingPeriodDuration': {'Description': 'The current billing ' 'period duration in ' 'minutes', 'Name': 'zigbee:CurrentBillingPeriodDuration', 'Units': 'min', 'Value': '60215213'}, 'zigbee:CurrentBillingPeriodStart': {'Description': 'The start time of the ' 'current billing period', 'Name': 'zigbee:CurrentBillingPeriodStart', 'Units': None, 'Value': '1628739302'}, 'zigbee:CurrentBlockPeriodConsumptionDelivered': {'Description': 'The most ' 'recent ' 'summed ' 'value of ' 'Energy, Gas ' 'or Water ' 'delivered ' 'and ' 'consumed in ' 'the ' 'premises ' 'during the ' 'Block ' 'Tariff ' 'Period', 'Name': 'zigbee:CurrentBlockPeriodConsumptionDelivered', 'Units': 'kWh', 'Value': '0.000000'}, 'zigbee:CurrentSummationDelivered': {'Description': 'Summation Delivered to ' 'Home', 'Name': 'zigbee:CurrentSummationDelivered', 'Units': 'kWh', 'Value': '2853.662000'}, 'zigbee:CurrentSummationReceived': {'Description': 'Summation Recieved from ' 'Home', 'Name': 'zigbee:CurrentSummationReceived', 'Units': 'kWh', 'Value': '0.000000'}, 'zigbee:Divisor': {'Description': 'Divisor applied to demand and summation ' 'values', 'Name': 'zigbee:Divisor', 'Units': None, 'Value': '1000'}, 'zigbee:InstantaneousDemand': {'Description': 'Instantaneous Demand', 'Name': 'zigbee:InstantaneousDemand', 'Units': 'kW', 'Value': '1.965000'}, 'zigbee:Message': {'Description': 'Message from utility to customer', 'Name': 'zigbee:Message', 'Units': None, 'Value': None}, 'zigbee:MessageConfirmationRequired': {'Description': 'Indicates if the ' 'message requires user ' 'confirmation', 'Name': 'zigbee:MessageConfirmationRequired', 'Units': None, 'Value': 'false'}, 'zigbee:MessageConfirmed': {'Description': 'Indicates if the message has ' 'received user confirmation', 'Name': 'zigbee:MessageConfirmed', 'Units': None, 'Value': 'false'}, 'zigbee:MessageDurationInMinutes': {'Description': 'Duration of current price', 'Name': 'zigbee:MessageDurationInMinutes', 'Units': 'min', 'Value': None}, 'zigbee:MessageId': {'Description': 'Message unique ID', 'Name': 'zigbee:MessageId', 'Units': None, 'Value': None}, 'zigbee:MessagePriority': {'Description': 'Message priority', 'Name': 'zigbee:MessagePriority', 'Units': None, 'Value': None}, 'zigbee:MessageStartTime': {'Description': 'Start time for current message', 'Name': 'zigbee:MessageStartTime', 'Units': None, 'Value': None}, 'zigbee:Multiplier': {'Description': 'Multiplier applied to demand and ' 'summation values', 'Name': 'zigbee:Multiplier', 'Units': None, 'Value': '1'}, 'zigbee:NoTierBlock1Price': {'Description': 'The price of Energy, Gas, or ' 'Water delivered to the premises ' 'at a specific price tier', 'Name': 'zigbee:NoTierBlock1Price', 'Units': 'USD/kWh', 'Value': None}, 'zigbee:NoTierBlock2Price': {'Description': 'The price of Energy, Gas, or ' 'Water delivered to the premises ' 'at a specific price tier', 'Name': 'zigbee:NoTierBlock2Price', 'Units': 'USD/kWh', 'Value': None}, 'zigbee:NoTierBlock3Price': {'Description': 'The price of Energy, Gas, or ' 'Water delivered to the premises ' 'at a specific price tier', 'Name': 'zigbee:NoTierBlock3Price', 'Units': 'USD/kWh', 'Value': None}, 'zigbee:NoTierBlock4Price': {'Description': 'The price of Energy, Gas, or ' 'Water delivered to the premises ' 'at a specific price tier', 'Name': 'zigbee:NoTierBlock4Price', 'Units': 'USD/kWh', 'Value': None}, 'zigbee:NoTierBlock5Price': {'Description': 'The price of Energy, Gas, or ' 'Water delivered to the premises ' 'at a specific price tier', 'Name': 'zigbee:NoTierBlock5Price', 'Units': 'USD/kWh', 'Value': None}, 'zigbee:NoTierBlock6Price': {'Description': 'The price of Energy, Gas, or ' 'Water delivered to the premises ' 'at a specific price tier', 'Name': 'zigbee:NoTierBlock6Price', 'Units': 'USD/kWh', 'Value': None}, 'zigbee:NoTierBlock7Price': {'Description': 'The price of Energy, Gas, or ' 'Water delivered to the premises ' 'at a specific price tier', 'Name': 'zigbee:NoTierBlock7Price', 'Units': 'USD/kWh', 'Value': None}, 'zigbee:NoTierBlock8Price': {'Description': 'The price of Energy, Gas, or ' 'Water delivered to the premises ' 'at a specific price tier', 'Name': 'zigbee:NoTierBlock8Price', 'Units': 'USD/kWh', 'Value': None}, 'zigbee:Price': {'Description': 'Price of electricity', 'Name': 'zigbee:Price', 'Units': None, 'Value': 'invalid'}, 'zigbee:PriceCurrency': {'Description': 'The local unit of currency used in ' 'the price field', 'Name': 'zigbee:PriceCurrency', 'Units': None, 'Value': 'USD'}, 'zigbee:PriceDuration': {'Description': 'Amount of time in minutes after the ' 'Start Time during which the price ' 'signal is valid', 'Name': 'zigbee:PriceDuration', 'Units': 'min', 'Value': '0'}, 'zigbee:PriceRateLabel': {'Description': 'Active priuce rate label', 'Name': 'zigbee:PriceRateLabel', 'Units': None, 'Value': None}, 'zigbee:PriceStartTime': {'Description': 'The time at which the price signal ' 'becomes valid', 'Name': 'zigbee:PriceStartTime', 'Units': None, 'Value': '946684800'}, 'zigbee:PriceTier': {'Description': 'The current Price Tier', 'Name': 'zigbee:PriceTier', 'Units': None, 'Value': '0'}, 'zigbee:PriceTrailingDigits': {'Description': 'Indicates the number of digits ' 'to the right of the decimal ' 'point', 'Name': 'zigbee:PriceTrailingDigits', 'Units': None, 'Value': '255'}, 'zigbee:StartOfBlockPeriod': {'Description': 'The start time of the current ' 'block tariff period', 'Name': 'zigbee:StartOfBlockPeriod', 'Units': None, 'Value': '946684800'}, 'zigbee:ThresholdDivisor': {'Description': 'Provides a value to divide the ' 'result of applying the threshold ' 'multiplier attribute to Block ' 'Threshold values', 'Name': 'zigbee:ThresholdDivisor', 'Units': None, 'Value': '1'}, 'zigbee:ThresholdMultiplier': {'Description': 'Provides a value to be ' 'multiplied against Threshold ' 'attributes', 'Name': 'zigbee:ThresholdMultiplier', 'Units': None, 'Value': '1'}} aioeagle-1.1.1/example.py000066400000000000000000000015161524241035700152730ustar00rootroot00000000000000import asyncio import sys from pprint import pprint import logging import aiohttp from aioeagle import EagleHub logging.basicConfig(level=logging.DEBUG) async def main(): async with aiohttp.ClientSession() as session: await run(session) async def run(websession): if len(sys.argv) < 3: print(f"Usage: {sys.argv[0]} [ip_address]") return kwargs = {} if len(sys.argv) > 3: kwargs["host"] = sys.argv[3] hub = EagleHub(websession, sys.argv[1], sys.argv[2], **kwargs) devices = await hub.get_device_list() if len(devices) == 0: print("No devices found") return device = devices[0] pprint(device.details) print() pprint(await device.get_device_query()) try: asyncio.run(main()) except KeyboardInterrupt: pass aioeagle-1.1.1/pyproject.toml000066400000000000000000000013221524241035700161750ustar00rootroot00000000000000[build-system] build-backend = "setuptools.build_meta" requires = ["setuptools>=77.0"] [project] name = "aioeagle" version = "1.1.1" license = "Apache-2.0" description = "Python module to talk to Rainforest EAGLE-200." readme = "README.md" authors = [{ name = "Paulus Schoutsen", email = "paulus@paulusschoutsen.nl" }] requires-python = ">=3.10" classifiers = [ "Intended Audience :: Developers", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 3", "Topic :: Software Development :: Libraries :: Python Modules", ] dependencies = [ "aiohttp>=3.14.0", "xmltodict", ] [project.urls] "Source code" = "https://github.com/home-assistant-libs/aioeagle" aioeagle-1.1.1/requirements-test.txt000066400000000000000000000000341524241035700175210ustar00rootroot00000000000000flake8==7.1.2 black==24.8.0 aioeagle-1.1.1/requirements.txt000066400000000000000000000000321524241035700165420ustar00rootroot00000000000000aiohttp>=3.14.0 xmltodict aioeagle-1.1.1/setup.cfg000066400000000000000000000004031524241035700151010ustar00rootroot00000000000000[flake8] # To work with Black max-line-length = 88 # E501: line too long # W503: Line break occurred before a binary operator # E203: Whitespace before ':' # D202 No blank lines allowed after function docstring ignore = E501, W503, E203, D202