pax_global_header00006660000000000000000000000064141073747750014531gustar00rootroot0000000000000052 comment=b19d1a2fe6768b8467d941f243aff312ace9221d home-assistant-libs-aioeagle-b19d1a2/000077500000000000000000000000001410737477500175705ustar00rootroot00000000000000home-assistant-libs-aioeagle-b19d1a2/.github/000077500000000000000000000000001410737477500211305ustar00rootroot00000000000000home-assistant-libs-aioeagle-b19d1a2/.github/dependabot.yml000066400000000000000000000002101410737477500237510ustar00rootroot00000000000000version: 2 updates: - package-ecosystem: pip directory: "/" schedule: interval: weekly open-pull-requests-limit: 10 home-assistant-libs-aioeagle-b19d1a2/.github/release-drafter.yml000066400000000000000000000000541410737477500247170ustar00rootroot00000000000000template: | ## What's Changed $CHANGES home-assistant-libs-aioeagle-b19d1a2/.github/workflows/000077500000000000000000000000001410737477500231655ustar00rootroot00000000000000home-assistant-libs-aioeagle-b19d1a2/.github/workflows/pythonpublish.yml000066400000000000000000000015151410737477500266220ustar00rootroot00000000000000# 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@v2 - name: Set up Python uses: actions/setup-python@v1 with: python-version: '3.x' - name: Install dependencies run: | python -m pip install --upgrade pip pip install setuptools wheel twine - name: Build and publish env: TWINE_USERNAME: __token__ TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }} run: | python setup.py sdist bdist_wheel twine upload dist/* home-assistant-libs-aioeagle-b19d1a2/.github/workflows/release-drafter.yml000066400000000000000000000005061410737477500267560ustar00rootroot00000000000000name: 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@v5 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} home-assistant-libs-aioeagle-b19d1a2/.github/workflows/test.yml000066400000000000000000000014601410737477500246700ustar00rootroot00000000000000# 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@v2 - name: Set up Python 3.8 uses: actions/setup-python@v1 with: python-version: 3.8 - 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 home-assistant-libs-aioeagle-b19d1a2/.gitignore000066400000000000000000000001101410737477500215500ustar00rootroot00000000000000*.py[cod] venv pip-selfcheck.json pyvenv.cfg *.egg-info .DS_Store .idea home-assistant-libs-aioeagle-b19d1a2/LICENSE000066400000000000000000000261221410737477500206000ustar00rootroot00000000000000 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. home-assistant-libs-aioeagle-b19d1a2/MANIFEST.in000066400000000000000000000000731410737477500213260ustar00rootroot00000000000000include README.md include requirements.txt include LICENSE home-assistant-libs-aioeagle-b19d1a2/README.md000066400000000000000000000022521410737477500210500ustar00rootroot00000000000000# 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. home-assistant-libs-aioeagle-b19d1a2/aioeagle/000077500000000000000000000000001410737477500213365ustar00rootroot00000000000000home-assistant-libs-aioeagle-b19d1a2/aioeagle/__init__.py000066400000000000000000000002671410737477500234540ustar00rootroot00000000000000"""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 home-assistant-libs-aioeagle-b19d1a2/aioeagle/electric_meter.py000066400000000000000000000066301410737477500247030ustar00rootroot00000000000000from .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"" home-assistant-libs-aioeagle-b19d1a2/aioeagle/errors.py000066400000000000000000000001671410737477500232300ustar00rootroot00000000000000class EagleError(Exception): """Base error.""" class BadAuth(EagleError): """Authentication not accepted.""" home-assistant-libs-aioeagle-b19d1a2/aioeagle/hub.py000066400000000000000000000041271410737477500224720ustar00rootroot00000000000000"""EAGLE-200 hub.""" from __future__ import annotations import asyncio import logging from time import time from aiohttp import ClientSession, BasicAuth 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 = BasicAuth(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: await asyncio.sleep(wait_time) async with self.session.post( f"http://{self.host}/cgi-bin/post_manager", auth=self.auth, headers={"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 home-assistant-libs-aioeagle-b19d1a2/aioeagle/util.py000066400000000000000000000016011410737477500226630ustar00rootroot00000000000000def 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 home-assistant-libs-aioeagle-b19d1a2/data.txt000066400000000000000000000353241410737477500212510ustar00rootroot00000000000000{'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'}} home-assistant-libs-aioeagle-b19d1a2/example.py000066400000000000000000000014071410737477500215770ustar00rootroot00000000000000import asyncio import sys from pprint import pprint import aiohttp from aioeagle import EagleHub 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]} ") 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 home-assistant-libs-aioeagle-b19d1a2/requirements-test.txt000066400000000000000000000000341410737477500240260ustar00rootroot00000000000000flake8==3.9.2 black==21.7b0 home-assistant-libs-aioeagle-b19d1a2/requirements.txt000066400000000000000000000000221410737477500230460ustar00rootroot00000000000000aiohttp xmltodict home-assistant-libs-aioeagle-b19d1a2/setup.cfg000066400000000000000000000004031410737477500214060ustar00rootroot00000000000000[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 home-assistant-libs-aioeagle-b19d1a2/setup.py000066400000000000000000000015471410737477500213110ustar00rootroot00000000000000from setuptools import setup long_description = open("README.md").read() setup( name="aioeagle", version="1.1.0", license="Apache License 2.0", url="https://github.com/home-assistant-libs/aioeagle", author="Paulus Schoutsen", author_email="paulus@paulusschoutsen.nl", description="Python module to talk to Rainforest EAGLE-200.", long_description=long_description, long_description_content_type="text/markdown", packages=["aioeagle"], zip_safe=True, platforms="any", install_requires=list(val.strip() for val in open("requirements.txt")), classifiers=[ "Intended Audience :: Developers", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 3", "Topic :: Software Development :: Libraries :: Python Modules", ], )