From 5c410a35bab3653c153e5349a8359b96ce29e3e7 Mon Sep 17 00:00:00 2001 From: CoprDistGit Date: Wed, 10 May 2023 06:39:20 +0000 Subject: automatic import of python-konnected --- .gitignore | 1 + python-konnected.spec | 304 ++++++++++++++++++++++++++++++++++++++++++++++++++ sources | 1 + 3 files changed, 306 insertions(+) create mode 100644 python-konnected.spec create mode 100644 sources diff --git a/.gitignore b/.gitignore index e69de29..86ad714 100644 --- a/.gitignore +++ b/.gitignore @@ -0,0 +1 @@ +/konnected-1.2.0.tar.gz diff --git a/python-konnected.spec b/python-konnected.spec new file mode 100644 index 0000000..58c8150 --- /dev/null +++ b/python-konnected.spec @@ -0,0 +1,304 @@ +%global _empty_manifest_terminate_build 0 +Name: python-konnected +Version: 1.2.0 +Release: 1 +Summary: An async Python library for interacting with Konnected home automation controllers (see https://konnected.io) +License: MIT +URL: https://github.com/konnected-io/konnected-py +Source0: https://mirrors.nju.edu.cn/pypi/web/packages/36/5e/fbecfc52432d7c819fc8a4424ca32a2fe08b8e9338548705785c06efb769/konnected-1.2.0.tar.gz +BuildArch: noarch + +Requires: python3-aiohttp + +%description +## Konnected Python library + +This is a simple Python library to talk to a Konnected device. Konnected is an open-source software for ESP8266 devices +that enables simple wired binary sensors and actuators to talk to home automation frameworks such as Home Assistant and +SmartThings. The most popular use case for Konnected is to connected a wired home alarm system to your Smart Home hub. + +This library was written to support Home Assistant integration. + +For more information see [konnected.io](https://konnected.io) + +## Usage + +``` + +import aiohttp +import asyncio +import konnected + +async def fetch(session, url): + async with session.get(url) as response: + return await response.text() + +async def main(): + async with aiohttp.ClientSession() as session: + k = konnected.Client('192.168.86.10', '17000', session) + + # Sync settings to the device + + print(await k.put_settings(sensors=[{"pin":1}], actuators=[], auth_token='secureToken', endpoint='http://example.com')) + # True + + # Get status of each input pin + + print(await k.get_device()) + # [{'state': 0, 'pin': 1}, {'state': 1, 'pin': 2}] + + # Get status of a single input pin + + print(await k.get_device(2)) + # [{'state': 1, 'pin': 2}] + + # Actuate an output pin + + print(await k.put_device(pin=8, state=1)) + # {'state': 1, 'pin': 8} + + # Get status of each input zone + + print(await k.get_zone()) + # [{'state': 0, 'zone': 1}, {'state': 1, 'zone': 2}] + + # Get status of a single input zone + + print(await k.get_zone(2)) + # [{'state': 1, 'zone': 2}] + + # Actuate an output zone + + print(await k.put_zone(zone=8, state=1)) + # {'state': 1, 'zone': 8} + + # Get device status + + await k.get_status() + # {'mac': '2c:3a:e8:43:8a:38', 'gw': '192.168.86.1', 'hwVersion': '2.0.5', 'rssi': -31, 'nm': '255.255.255.0', 'ip': '192.168.86.10', 'actuators': [{'trigger': 1, 'pin': 8}], 'port': 12426, 'uptime': 2349, 'heap': 23904, 'swVersion': '2.1.3', 'sensors': [{'state': 0, 'pin': 1}]} + +if __name__ == '__main__': + loop = asyncio.get_event_loop() + loop.run_until_complete(main()) + +``` + +## Python version + +This library was designed to work with Python 3.5 and above. + + + + +%package -n python3-konnected +Summary: An async Python library for interacting with Konnected home automation controllers (see https://konnected.io) +Provides: python-konnected +BuildRequires: python3-devel +BuildRequires: python3-setuptools +BuildRequires: python3-pip +%description -n python3-konnected +## Konnected Python library + +This is a simple Python library to talk to a Konnected device. Konnected is an open-source software for ESP8266 devices +that enables simple wired binary sensors and actuators to talk to home automation frameworks such as Home Assistant and +SmartThings. The most popular use case for Konnected is to connected a wired home alarm system to your Smart Home hub. + +This library was written to support Home Assistant integration. + +For more information see [konnected.io](https://konnected.io) + +## Usage + +``` + +import aiohttp +import asyncio +import konnected + +async def fetch(session, url): + async with session.get(url) as response: + return await response.text() + +async def main(): + async with aiohttp.ClientSession() as session: + k = konnected.Client('192.168.86.10', '17000', session) + + # Sync settings to the device + + print(await k.put_settings(sensors=[{"pin":1}], actuators=[], auth_token='secureToken', endpoint='http://example.com')) + # True + + # Get status of each input pin + + print(await k.get_device()) + # [{'state': 0, 'pin': 1}, {'state': 1, 'pin': 2}] + + # Get status of a single input pin + + print(await k.get_device(2)) + # [{'state': 1, 'pin': 2}] + + # Actuate an output pin + + print(await k.put_device(pin=8, state=1)) + # {'state': 1, 'pin': 8} + + # Get status of each input zone + + print(await k.get_zone()) + # [{'state': 0, 'zone': 1}, {'state': 1, 'zone': 2}] + + # Get status of a single input zone + + print(await k.get_zone(2)) + # [{'state': 1, 'zone': 2}] + + # Actuate an output zone + + print(await k.put_zone(zone=8, state=1)) + # {'state': 1, 'zone': 8} + + # Get device status + + await k.get_status() + # {'mac': '2c:3a:e8:43:8a:38', 'gw': '192.168.86.1', 'hwVersion': '2.0.5', 'rssi': -31, 'nm': '255.255.255.0', 'ip': '192.168.86.10', 'actuators': [{'trigger': 1, 'pin': 8}], 'port': 12426, 'uptime': 2349, 'heap': 23904, 'swVersion': '2.1.3', 'sensors': [{'state': 0, 'pin': 1}]} + +if __name__ == '__main__': + loop = asyncio.get_event_loop() + loop.run_until_complete(main()) + +``` + +## Python version + +This library was designed to work with Python 3.5 and above. + + + + +%package help +Summary: Development documents and examples for konnected +Provides: python3-konnected-doc +%description help +## Konnected Python library + +This is a simple Python library to talk to a Konnected device. Konnected is an open-source software for ESP8266 devices +that enables simple wired binary sensors and actuators to talk to home automation frameworks such as Home Assistant and +SmartThings. The most popular use case for Konnected is to connected a wired home alarm system to your Smart Home hub. + +This library was written to support Home Assistant integration. + +For more information see [konnected.io](https://konnected.io) + +## Usage + +``` + +import aiohttp +import asyncio +import konnected + +async def fetch(session, url): + async with session.get(url) as response: + return await response.text() + +async def main(): + async with aiohttp.ClientSession() as session: + k = konnected.Client('192.168.86.10', '17000', session) + + # Sync settings to the device + + print(await k.put_settings(sensors=[{"pin":1}], actuators=[], auth_token='secureToken', endpoint='http://example.com')) + # True + + # Get status of each input pin + + print(await k.get_device()) + # [{'state': 0, 'pin': 1}, {'state': 1, 'pin': 2}] + + # Get status of a single input pin + + print(await k.get_device(2)) + # [{'state': 1, 'pin': 2}] + + # Actuate an output pin + + print(await k.put_device(pin=8, state=1)) + # {'state': 1, 'pin': 8} + + # Get status of each input zone + + print(await k.get_zone()) + # [{'state': 0, 'zone': 1}, {'state': 1, 'zone': 2}] + + # Get status of a single input zone + + print(await k.get_zone(2)) + # [{'state': 1, 'zone': 2}] + + # Actuate an output zone + + print(await k.put_zone(zone=8, state=1)) + # {'state': 1, 'zone': 8} + + # Get device status + + await k.get_status() + # {'mac': '2c:3a:e8:43:8a:38', 'gw': '192.168.86.1', 'hwVersion': '2.0.5', 'rssi': -31, 'nm': '255.255.255.0', 'ip': '192.168.86.10', 'actuators': [{'trigger': 1, 'pin': 8}], 'port': 12426, 'uptime': 2349, 'heap': 23904, 'swVersion': '2.1.3', 'sensors': [{'state': 0, 'pin': 1}]} + +if __name__ == '__main__': + loop = asyncio.get_event_loop() + loop.run_until_complete(main()) + +``` + +## Python version + +This library was designed to work with Python 3.5 and above. + + + + +%prep +%autosetup -n konnected-1.2.0 + +%build +%py3_build + +%install +%py3_install +install -d -m755 %{buildroot}/%{_pkgdocdir} +if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi +if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi +if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi +if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi +pushd %{buildroot} +if [ -d usr/lib ]; then + find usr/lib -type f -printf "/%h/%f\n" >> filelist.lst +fi +if [ -d usr/lib64 ]; then + find usr/lib64 -type f -printf "/%h/%f\n" >> filelist.lst +fi +if [ -d usr/bin ]; then + find usr/bin -type f -printf "/%h/%f\n" >> filelist.lst +fi +if [ -d usr/sbin ]; then + find usr/sbin -type f -printf "/%h/%f\n" >> filelist.lst +fi +touch doclist.lst +if [ -d usr/share/man ]; then + find usr/share/man -type f -printf "/%h/%f.gz\n" >> doclist.lst +fi +popd +mv %{buildroot}/filelist.lst . +mv %{buildroot}/doclist.lst . + +%files -n python3-konnected -f filelist.lst +%dir %{python3_sitelib}/* + +%files help -f doclist.lst +%{_docdir}/* + +%changelog +* Wed May 10 2023 Python_Bot - 1.2.0-1 +- Package Spec generated diff --git a/sources b/sources new file mode 100644 index 0000000..63961a9 --- /dev/null +++ b/sources @@ -0,0 +1 @@ +fd6b1fdd25e8be80148e2424d3e02e9a konnected-1.2.0.tar.gz -- cgit v1.2.3