PyNetioConf 0.3.0b1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,173 @@
1
+ Metadata-Version: 2.4
2
+ Name: PyNetioConf
3
+ Version: 0.3.0b1
4
+ Summary: Universal module to control and configure all NETIO devices
5
+ Keywords: NETIO
6
+ Author: NETIO products a.s.
7
+ Author-email: NETIO products a.s. <support@netio.eu>
8
+ License-Expression: MIT
9
+ License-File: LICENSE
10
+ Classifier: Programming Language :: Python :: 3
11
+ Classifier: Programming Language :: Python :: 3.10
12
+ Classifier: Programming Language :: Python :: 3.11
13
+ Classifier: Programming Language :: Python :: 3.12
14
+ Classifier: Programming Language :: Python :: 3.13
15
+ Classifier: Programming Language :: Python :: 3.14
16
+ Classifier: Operating System :: OS Independent
17
+ Classifier: Intended Audience :: Developers
18
+ Classifier: Natural Language :: English
19
+ Classifier: Development Status :: 4 - Beta
20
+ Requires-Dist: websocket-client
21
+ Requires-Dist: requests
22
+ Requires-Dist: urllib3
23
+ Requires-Dist: typing-extensions>=4.4.0 ; python_full_version < '3.12'
24
+ Maintainer: Jakub Šperl
25
+ Maintainer-email: Jakub Šperl <jsperl@netio.eu>
26
+ Requires-Python: >=3.10
27
+ Project-URL: Homepage, https://netio-products.com/
28
+ Project-URL: Repository, https://github.com/netioproducts/PyNetioConf
29
+ Project-URL: Issues, https://github.com/netioproducts/PyNetioConf/issues
30
+ Project-URL: Changelog, https://github.com/netioproducts/PyNetioConf/blob/main/CHANGELOG.md
31
+ Description-Content-Type: text/markdown
32
+
33
+ # PyNetioConf
34
+
35
+ A Python module for configuring, controlling and monitoring NETIO devices with a unified API no matter which device
36
+ or firmware version you're using.
37
+
38
+ ## Warning
39
+
40
+ This module is currently under development and is not ready for production use. There might be breaking changes
41
+ happening with relative frequency until the official release. The module is tested internally and should work
42
+ correctly, but should still be considered beta release.
43
+
44
+ Currently, the module supports control and many configuration options on ESP devices running the 2.x.x through 5.x.x
45
+ firmware versions.
46
+ NOTE: Even though this library uses an API that supports older firmware versions such as 3.2.6, they are no longer
47
+ supported as firmware versions and any bugs on deprecated firmware versions won't be fixed.
48
+
49
+ ## Installation
50
+
51
+ ### Git
52
+
53
+ - Clone this repository and install the module from the cloned folder:
54
+
55
+ ```bash
56
+ git clone https://github.com/netioproducts/PyNetioConf.git
57
+ cd PyNetioConf
58
+
59
+ # with uv: creates a .venv in the project folder and installs the module into it in editable mode
60
+ uv sync
61
+
62
+ # or with pip: if you can't or don't want to install site-wide packages, create a virtual environment first
63
+ python3 -m venv pnc_venv
64
+ source pnc_venv/bin/activate
65
+ pip3 install -e .
66
+ ```
67
+
68
+ - To update, run `git pull` in the `PyNetioConf` directory. Since the package is installed in editable mode, the
69
+ changes are picked up straight away, but to be sure you can rerun `uv sync` (or `pip3 install -e .`).
70
+
71
+ ### Manual
72
+
73
+ - Alternatively if you don't have git installed, you can download the code as a ZIP file from GitHub by clicking the
74
+ green "Code" button.
75
+ - After downloading the code, extract it to a directory and open that location in the terminal.
76
+ - Once in the target directory run `uv sync`, or `pip3 install -e .` if you use pip.
77
+ - With pip, if this produces an error or you wish to keep site-wide packages separate, create a virtual
78
+ environment first: `python3 -m venv pnc_venv && source pnc_venv/bin/activate` then run `pip3 install -e .`
79
+
80
+ ### PyPI
81
+
82
+ ```bash
83
+ # with uv
84
+ uv add PyNetioConf
85
+
86
+ # or with pip
87
+ pip install PyNetioConf
88
+ ```
89
+
90
+ While only beta versions are published, this installs the latest beta. Once a stable version is released,
91
+ installers will prefer it, and betas will need to be requested explicitly with
92
+ `uv add --prerelease=allow PyNetioConf` or `pip install --pre PyNetioConf`.
93
+
94
+ ## Usage
95
+
96
+ ### Development
97
+
98
+ - After installing the pip package, you can easily use the library in your projects. To start off, you need to
99
+ connect to the device, for that you need to create a `NetioManager` class instance which will handle any devices
100
+ you connect to and their user sessions.
101
+
102
+ ```python
103
+ from PyNetioConf import NetioManager
104
+
105
+ nm = NetioManager()
106
+ # The NetioManager instance handles all the devices and their sessions, preventing any session crowding and
107
+ # collisions in case of multiple device instances
108
+
109
+ device = nm.init_device("powerpdu-8qs.netio-products.com", "demo", "demo")
110
+
111
+ # You can now control and configure the device using its class methods
112
+ # To check all the available methods check the NETIODevice class documentation.
113
+ device.set_output(1, False)
114
+
115
+ # While some cases should be universally available on all device versions, some featuers require
116
+ # certain firmware versions or user permissions, to be sure consult the NETIODevice class documentation.*
117
+
118
+ # To avoid any problems, encapsulate your logic in a try/except block
119
+ from PyNetioConf.exceptions import FeatureNotSupported
120
+
121
+ try:
122
+ # MQTT certificate auth is only available on version 5.0.x or later
123
+ device.upload_mqtt_ca_certificate("certificate_string")
124
+ except FeatureNotSupported as e:
125
+ print("Device doesn't support MQTT cert authentication.")
126
+
127
+ # or
128
+
129
+ try:
130
+ device.set_output(1, True)
131
+ except PermissionError as e:
132
+ print("Logged in account doesn't have permissions to alter output states.")
133
+ ```
134
+
135
+ _Note: Currently the firmware version and permission requirements might be missing and will be added over time. In
136
+ the meantime please check method implementations for your specific version in `esp_xxx_device.py` files_.
137
+
138
+ - To see sample usage of the package functions see: `examples/*`
139
+
140
+ ### Using pre-made scripts
141
+
142
+ - This repository contains some common usage scenarios as pre-made example scripts, if you are only looking for
143
+ specific use-case and don't intend to develop using this library this section goes over the usage of those scripts.
144
+ - All the pre-made scripts are located in `./examples/` and to use them you will need to have
145
+ installed the library as described in the Installation section of the readme.
146
+ - Once you have the library installed you can choose whichever script you want to use and open the file in any text
147
+ editor.
148
+ - In the editor you change any necessary constants (variables in UPPER_CASE) such as: `USERNAME` and `PASSWORD`
149
+ - For this example let's say I want to update the firmware using the `update_firmware.py` script:
150
+ - First I follow the comments in the file and set all my constants to the ones of my device.
151
+ - ```python
152
+ DEVICE_IP = "192.168.1.17"
153
+ USERNAME = "admin"
154
+ PASSWORD = "admin"
155
+ FIRMWARE_PATH = "/home/user/Downloads/release503.package"
156
+ - Then I run the file with python from the `PyNetioConf` directory: `python3 examples/update_firmware.py`
157
+ (with uv, run it as `uv run examples/update_firmware.py`)
158
+ - If I did all the steps correctly I should see an output simillar to the following:
159
+ - ```
160
+ TODO
161
+ - To use any of the other scripts, follow the comments in the file for instructions and then run it the same way
162
+ as this script.
163
+
164
+ ## Documentation
165
+
166
+ Documentation is currently provided for functions as docstrings in the source code. Different forms of documentation
167
+ are being worked on and will be provided as the library matures.
168
+
169
+ ## Issues and Suggestions
170
+
171
+ If you find a bug or an issue, or have a suggestion, please use the GitHub issue tracker and create a new issue, before
172
+ doing so, check if your issue isn't listed already. If reporting a bug please turn on logging DEBUG level and include
173
+ the output in the report.
@@ -0,0 +1,20 @@
1
+ PyNetioConf/ESPCore/__init__.py,sha256=ul4IZjUWTH2eI5U8kG0dYqptSuWH6ctEG2EnOCaiYiA,208
2
+ PyNetioConf/ESPCore/esp_200_device.py,sha256=8lT6LPCoyONvyp-OgK1JYHdqR-VOmtkUDDL0BezInxo,594
3
+ PyNetioConf/ESPCore/esp_300_device.py,sha256=StsnZL_qcFtNHG2VIjdnoXwQzyRiGk7yNOoCWza9Quo,604
4
+ PyNetioConf/ESPCore/esp_400_device.py,sha256=nzUSA3bCXsWFbmCrBY2W5VaccowMpCn18pA4J9EqHTc,604
5
+ PyNetioConf/ESPCore/esp_500_device.py,sha256=vnOXgJAUD4usN8bIPq-iZJhkEkiTcv1yA3y4ctwLpdw,69979
6
+ PyNetioConf/ESPCore/esp_520_device.py,sha256=0TiFswmIg8TmE6tkHXAI0QEn8UwQv-X3VahCbJdIlkI,12340
7
+ PyNetioConf/ESPCore/esp_5beta_device.py,sha256=Pif_vA_4aMkG2jn5DfogW5tWG8j1FhhqPdfdwrs1S_U,9736
8
+ PyNetioConf/ESPCore/esp_api.py,sha256=5GyMi2idaP4Mhaou0mhN1q90DbSuWu1FQScCaYc0ENM,13266
9
+ PyNetioConf/ESPCore/esp_device.py,sha256=rwk3S7NhLEZsYTIoLTuUNFJOKOdaDIxSd-2rAj9c6dU,56794
10
+ PyNetioConf/ESPCore/esp_device_init.py,sha256=FfH2xYIXMt9OYAU3qpFswBeg95sC_7dCbuamQ14hz1Q,11496
11
+ PyNetioConf/ESPCore/ws_api.py,sha256=gIWJt56WQpltlQrevYekV2l0yoV2CAcpsQAtiMG_JJ0,14210
12
+ PyNetioConf/NetioManager.py,sha256=K20SOyaeofQ658TrgAaRHpH_gr2zHlVyC7yFDoNADvs,6117
13
+ PyNetioConf/__init__.py,sha256=S-V9TMLSXfyzT4Oba5GMx53IO8jZ9G0jqgsAtQ1NUo4,39
14
+ PyNetioConf/constants.py,sha256=arqfLlG6csuj2EaaAiWTwbw6rDzhJ-ddNDAGFZJg4ig,380
15
+ PyNetioConf/exceptions.py,sha256=iQ-2BwtkZXe4gLJtiupbJ1M4x1TlG6WA8dxh8fdsYLA,1411
16
+ PyNetioConf/netio_device.py,sha256=cZWqSVVZYPlOO6ngruKgcIm_XCg6eqNocDWlCsK7nhM,50043
17
+ pynetioconf-0.3.0b1.dist-info/licenses/LICENSE,sha256=ssh2dbpePFVcla1ZFVMXfsxYgaeGXCfgjFTIaBhcAyw,1071
18
+ pynetioconf-0.3.0b1.dist-info/WHEEL,sha256=cmC5s21ojypbVslldL7IJq3hjZH-tINy4rziKePFsG0,81
19
+ pynetioconf-0.3.0b1.dist-info/METADATA,sha256=lIc3mCTv5ttnTJjAHqz3JUCdPZnJbOVblGpKolSAJWE,7454
20
+ pynetioconf-0.3.0b1.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: uv 0.12.23
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024 NETIO products
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.