PyNetioConf 0.3.0b1__tar.gz
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.
- pynetioconf-0.3.0b1/LICENSE +21 -0
- pynetioconf-0.3.0b1/PKG-INFO +173 -0
- pynetioconf-0.3.0b1/README.md +141 -0
- pynetioconf-0.3.0b1/pyproject.toml +52 -0
- pynetioconf-0.3.0b1/pyproject.toml.orig +50 -0
- pynetioconf-0.3.0b1/src/PyNetioConf/ESPCore/__init__.py +5 -0
- pynetioconf-0.3.0b1/src/PyNetioConf/ESPCore/esp_200_device.py +16 -0
- pynetioconf-0.3.0b1/src/PyNetioConf/ESPCore/esp_300_device.py +16 -0
- pynetioconf-0.3.0b1/src/PyNetioConf/ESPCore/esp_400_device.py +16 -0
- pynetioconf-0.3.0b1/src/PyNetioConf/ESPCore/esp_500_device.py +1826 -0
- pynetioconf-0.3.0b1/src/PyNetioConf/ESPCore/esp_520_device.py +348 -0
- pynetioconf-0.3.0b1/src/PyNetioConf/ESPCore/esp_5beta_device.py +263 -0
- pynetioconf-0.3.0b1/src/PyNetioConf/ESPCore/esp_api.py +383 -0
- pynetioconf-0.3.0b1/src/PyNetioConf/ESPCore/esp_device.py +1516 -0
- pynetioconf-0.3.0b1/src/PyNetioConf/ESPCore/esp_device_init.py +328 -0
- pynetioconf-0.3.0b1/src/PyNetioConf/ESPCore/ws_api.py +391 -0
- pynetioconf-0.3.0b1/src/PyNetioConf/NetioManager.py +183 -0
- pynetioconf-0.3.0b1/src/PyNetioConf/__init__.py +1 -0
- pynetioconf-0.3.0b1/src/PyNetioConf/constants.py +12 -0
- pynetioconf-0.3.0b1/src/PyNetioConf/exceptions.py +56 -0
- pynetioconf-0.3.0b1/src/PyNetioConf/netio_device.py +1727 -0
|
@@ -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.
|
|
@@ -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,141 @@
|
|
|
1
|
+
# PyNetioConf
|
|
2
|
+
|
|
3
|
+
A Python module for configuring, controlling and monitoring NETIO devices with a unified API no matter which device
|
|
4
|
+
or firmware version you're using.
|
|
5
|
+
|
|
6
|
+
## Warning
|
|
7
|
+
|
|
8
|
+
This module is currently under development and is not ready for production use. There might be breaking changes
|
|
9
|
+
happening with relative frequency until the official release. The module is tested internally and should work
|
|
10
|
+
correctly, but should still be considered beta release.
|
|
11
|
+
|
|
12
|
+
Currently, the module supports control and many configuration options on ESP devices running the 2.x.x through 5.x.x
|
|
13
|
+
firmware versions.
|
|
14
|
+
NOTE: Even though this library uses an API that supports older firmware versions such as 3.2.6, they are no longer
|
|
15
|
+
supported as firmware versions and any bugs on deprecated firmware versions won't be fixed.
|
|
16
|
+
|
|
17
|
+
## Installation
|
|
18
|
+
|
|
19
|
+
### Git
|
|
20
|
+
|
|
21
|
+
- Clone this repository and install the module from the cloned folder:
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
git clone https://github.com/netioproducts/PyNetioConf.git
|
|
25
|
+
cd PyNetioConf
|
|
26
|
+
|
|
27
|
+
# with uv: creates a .venv in the project folder and installs the module into it in editable mode
|
|
28
|
+
uv sync
|
|
29
|
+
|
|
30
|
+
# or with pip: if you can't or don't want to install site-wide packages, create a virtual environment first
|
|
31
|
+
python3 -m venv pnc_venv
|
|
32
|
+
source pnc_venv/bin/activate
|
|
33
|
+
pip3 install -e .
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
- To update, run `git pull` in the `PyNetioConf` directory. Since the package is installed in editable mode, the
|
|
37
|
+
changes are picked up straight away, but to be sure you can rerun `uv sync` (or `pip3 install -e .`).
|
|
38
|
+
|
|
39
|
+
### Manual
|
|
40
|
+
|
|
41
|
+
- Alternatively if you don't have git installed, you can download the code as a ZIP file from GitHub by clicking the
|
|
42
|
+
green "Code" button.
|
|
43
|
+
- After downloading the code, extract it to a directory and open that location in the terminal.
|
|
44
|
+
- Once in the target directory run `uv sync`, or `pip3 install -e .` if you use pip.
|
|
45
|
+
- With pip, if this produces an error or you wish to keep site-wide packages separate, create a virtual
|
|
46
|
+
environment first: `python3 -m venv pnc_venv && source pnc_venv/bin/activate` then run `pip3 install -e .`
|
|
47
|
+
|
|
48
|
+
### PyPI
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
# with uv
|
|
52
|
+
uv add PyNetioConf
|
|
53
|
+
|
|
54
|
+
# or with pip
|
|
55
|
+
pip install PyNetioConf
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
While only beta versions are published, this installs the latest beta. Once a stable version is released,
|
|
59
|
+
installers will prefer it, and betas will need to be requested explicitly with
|
|
60
|
+
`uv add --prerelease=allow PyNetioConf` or `pip install --pre PyNetioConf`.
|
|
61
|
+
|
|
62
|
+
## Usage
|
|
63
|
+
|
|
64
|
+
### Development
|
|
65
|
+
|
|
66
|
+
- After installing the pip package, you can easily use the library in your projects. To start off, you need to
|
|
67
|
+
connect to the device, for that you need to create a `NetioManager` class instance which will handle any devices
|
|
68
|
+
you connect to and their user sessions.
|
|
69
|
+
|
|
70
|
+
```python
|
|
71
|
+
from PyNetioConf import NetioManager
|
|
72
|
+
|
|
73
|
+
nm = NetioManager()
|
|
74
|
+
# The NetioManager instance handles all the devices and their sessions, preventing any session crowding and
|
|
75
|
+
# collisions in case of multiple device instances
|
|
76
|
+
|
|
77
|
+
device = nm.init_device("powerpdu-8qs.netio-products.com", "demo", "demo")
|
|
78
|
+
|
|
79
|
+
# You can now control and configure the device using its class methods
|
|
80
|
+
# To check all the available methods check the NETIODevice class documentation.
|
|
81
|
+
device.set_output(1, False)
|
|
82
|
+
|
|
83
|
+
# While some cases should be universally available on all device versions, some featuers require
|
|
84
|
+
# certain firmware versions or user permissions, to be sure consult the NETIODevice class documentation.*
|
|
85
|
+
|
|
86
|
+
# To avoid any problems, encapsulate your logic in a try/except block
|
|
87
|
+
from PyNetioConf.exceptions import FeatureNotSupported
|
|
88
|
+
|
|
89
|
+
try:
|
|
90
|
+
# MQTT certificate auth is only available on version 5.0.x or later
|
|
91
|
+
device.upload_mqtt_ca_certificate("certificate_string")
|
|
92
|
+
except FeatureNotSupported as e:
|
|
93
|
+
print("Device doesn't support MQTT cert authentication.")
|
|
94
|
+
|
|
95
|
+
# or
|
|
96
|
+
|
|
97
|
+
try:
|
|
98
|
+
device.set_output(1, True)
|
|
99
|
+
except PermissionError as e:
|
|
100
|
+
print("Logged in account doesn't have permissions to alter output states.")
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
_Note: Currently the firmware version and permission requirements might be missing and will be added over time. In
|
|
104
|
+
the meantime please check method implementations for your specific version in `esp_xxx_device.py` files_.
|
|
105
|
+
|
|
106
|
+
- To see sample usage of the package functions see: `examples/*`
|
|
107
|
+
|
|
108
|
+
### Using pre-made scripts
|
|
109
|
+
|
|
110
|
+
- This repository contains some common usage scenarios as pre-made example scripts, if you are only looking for
|
|
111
|
+
specific use-case and don't intend to develop using this library this section goes over the usage of those scripts.
|
|
112
|
+
- All the pre-made scripts are located in `./examples/` and to use them you will need to have
|
|
113
|
+
installed the library as described in the Installation section of the readme.
|
|
114
|
+
- Once you have the library installed you can choose whichever script you want to use and open the file in any text
|
|
115
|
+
editor.
|
|
116
|
+
- In the editor you change any necessary constants (variables in UPPER_CASE) such as: `USERNAME` and `PASSWORD`
|
|
117
|
+
- For this example let's say I want to update the firmware using the `update_firmware.py` script:
|
|
118
|
+
- First I follow the comments in the file and set all my constants to the ones of my device.
|
|
119
|
+
- ```python
|
|
120
|
+
DEVICE_IP = "192.168.1.17"
|
|
121
|
+
USERNAME = "admin"
|
|
122
|
+
PASSWORD = "admin"
|
|
123
|
+
FIRMWARE_PATH = "/home/user/Downloads/release503.package"
|
|
124
|
+
- Then I run the file with python from the `PyNetioConf` directory: `python3 examples/update_firmware.py`
|
|
125
|
+
(with uv, run it as `uv run examples/update_firmware.py`)
|
|
126
|
+
- If I did all the steps correctly I should see an output simillar to the following:
|
|
127
|
+
- ```
|
|
128
|
+
TODO
|
|
129
|
+
- To use any of the other scripts, follow the comments in the file for instructions and then run it the same way
|
|
130
|
+
as this script.
|
|
131
|
+
|
|
132
|
+
## Documentation
|
|
133
|
+
|
|
134
|
+
Documentation is currently provided for functions as docstrings in the source code. Different forms of documentation
|
|
135
|
+
are being worked on and will be provided as the library matures.
|
|
136
|
+
|
|
137
|
+
## Issues and Suggestions
|
|
138
|
+
|
|
139
|
+
If you find a bug or an issue, or have a suggestion, please use the GitHub issue tracker and create a new issue, before
|
|
140
|
+
doing so, check if your issue isn't listed already. If reporting a bug please turn on logging DEBUG level and include
|
|
141
|
+
the output in the report.
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "PyNetioConf"
|
|
3
|
+
version = "0.3.0b1"
|
|
4
|
+
requires-python = ">= 3.10"
|
|
5
|
+
description = "Universal module to control and configure all NETIO devices"
|
|
6
|
+
readme = "README.md"
|
|
7
|
+
license = "MIT"
|
|
8
|
+
license-files = ["LICENSE"]
|
|
9
|
+
keywords = ["NETIO"]
|
|
10
|
+
classifiers = [
|
|
11
|
+
"Programming Language :: Python :: 3",
|
|
12
|
+
"Programming Language :: Python :: 3.10",
|
|
13
|
+
"Programming Language :: Python :: 3.11",
|
|
14
|
+
"Programming Language :: Python :: 3.12",
|
|
15
|
+
"Programming Language :: Python :: 3.13",
|
|
16
|
+
"Programming Language :: Python :: 3.14",
|
|
17
|
+
"Operating System :: OS Independent",
|
|
18
|
+
"Intended Audience :: Developers",
|
|
19
|
+
"Natural Language :: English",
|
|
20
|
+
"Development Status :: 4 - Beta",
|
|
21
|
+
]
|
|
22
|
+
dependencies = [
|
|
23
|
+
"websocket-client",
|
|
24
|
+
"requests",
|
|
25
|
+
"urllib3",
|
|
26
|
+
"typing-extensions>=4.4.0; python_version < '3.12'",
|
|
27
|
+
]
|
|
28
|
+
|
|
29
|
+
[[project.authors]]
|
|
30
|
+
name = "NETIO products a.s."
|
|
31
|
+
email = "support@netio.eu"
|
|
32
|
+
|
|
33
|
+
[[project.maintainers]]
|
|
34
|
+
name = "Jakub Šperl"
|
|
35
|
+
email = "jsperl@netio.eu"
|
|
36
|
+
|
|
37
|
+
[project.urls]
|
|
38
|
+
Homepage = "https://netio-products.com/"
|
|
39
|
+
Repository = "https://github.com/netioproducts/PyNetioConf"
|
|
40
|
+
Issues = "https://github.com/netioproducts/PyNetioConf/issues"
|
|
41
|
+
Changelog = "https://github.com/netioproducts/PyNetioConf/blob/main/CHANGELOG.md"
|
|
42
|
+
|
|
43
|
+
[build-system]
|
|
44
|
+
requires = ["uv_build>=0.12.22,<0.13"]
|
|
45
|
+
build-backend = "uv_build"
|
|
46
|
+
|
|
47
|
+
[tool.uv.build-backend]
|
|
48
|
+
module-name = "PyNetioConf"
|
|
49
|
+
source-exclude = [
|
|
50
|
+
".venv",
|
|
51
|
+
"devhelpers",
|
|
52
|
+
]
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "PyNetioConf"
|
|
3
|
+
version = "0.3.0b1"
|
|
4
|
+
requires-python = ">= 3.10"
|
|
5
|
+
authors = [
|
|
6
|
+
{ name = "NETIO products a.s.", email = "support@netio.eu" }
|
|
7
|
+
]
|
|
8
|
+
maintainers = [
|
|
9
|
+
{ name = "Jakub Šperl", email = "jsperl@netio.eu" }
|
|
10
|
+
]
|
|
11
|
+
|
|
12
|
+
description = "Universal module to control and configure all NETIO devices"
|
|
13
|
+
readme = "README.md"
|
|
14
|
+
license = "MIT"
|
|
15
|
+
license-files = ["LICENSE"]
|
|
16
|
+
keywords = ["NETIO"]
|
|
17
|
+
classifiers = [
|
|
18
|
+
"Programming Language :: Python :: 3",
|
|
19
|
+
"Programming Language :: Python :: 3.10",
|
|
20
|
+
"Programming Language :: Python :: 3.11",
|
|
21
|
+
"Programming Language :: Python :: 3.12",
|
|
22
|
+
"Programming Language :: Python :: 3.13",
|
|
23
|
+
"Programming Language :: Python :: 3.14",
|
|
24
|
+
"Operating System :: OS Independent",
|
|
25
|
+
"Intended Audience :: Developers",
|
|
26
|
+
"Natural Language :: English",
|
|
27
|
+
"Development Status :: 4 - Beta",
|
|
28
|
+
]
|
|
29
|
+
|
|
30
|
+
dependencies = [
|
|
31
|
+
"websocket-client",
|
|
32
|
+
"requests",
|
|
33
|
+
"urllib3",
|
|
34
|
+
"typing-extensions>=4.4.0; python_version < '3.12'"
|
|
35
|
+
]
|
|
36
|
+
|
|
37
|
+
[project.urls]
|
|
38
|
+
Homepage = "https://netio-products.com/"
|
|
39
|
+
Repository = "https://github.com/netioproducts/PyNetioConf"
|
|
40
|
+
Issues = "https://github.com/netioproducts/PyNetioConf/issues"
|
|
41
|
+
Changelog = "https://github.com/netioproducts/PyNetioConf/blob/main/CHANGELOG.md"
|
|
42
|
+
|
|
43
|
+
[build-system]
|
|
44
|
+
requires = ["uv_build>=0.12.22,<0.13"]
|
|
45
|
+
build-backend = "uv_build"
|
|
46
|
+
|
|
47
|
+
[tool.uv.build-backend]
|
|
48
|
+
module-name = "PyNetioConf"
|
|
49
|
+
# uv_build does not read .gitignore; keep local-only folders out of builds made outside CI.
|
|
50
|
+
source-exclude = [".venv", "devhelpers"]
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Implementation specifics for ESP devices with the firmware 2.x.x.
|
|
3
|
+
"""
|
|
4
|
+
from .esp_device import ESPDevice
|
|
5
|
+
from .. import NetioManager
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class ESP200Device(ESPDevice):
|
|
9
|
+
"""
|
|
10
|
+
A class to control ESP devices with the firmware 2.x.x.
|
|
11
|
+
"""
|
|
12
|
+
|
|
13
|
+
def __init__(self, host: str, username: str, password: str, sn_number: str, hostname: str, keep_alive: bool =
|
|
14
|
+
True, netio_manager: NetioManager | None = None, use_https: bool = False):
|
|
15
|
+
super().__init__(host, username, password, sn_number, hostname, keep_alive, netio_manager, use_https)
|
|
16
|
+
self.fw_version = self.get_version()
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Implementation specifics for ESP devices with the firmware 3.x.x.
|
|
3
|
+
"""
|
|
4
|
+
from .esp_200_device import ESP200Device
|
|
5
|
+
from .. import NetioManager
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class ESP300Device(ESP200Device):
|
|
9
|
+
"""
|
|
10
|
+
A class to control ESP devices with the firmware 3.x.x.
|
|
11
|
+
"""
|
|
12
|
+
|
|
13
|
+
def __init__(self, host: str, username: str, password: str, sn_number: str, hostname: str, keep_alive: bool =
|
|
14
|
+
True, netio_manager: NetioManager | None = None, use_https: bool = False):
|
|
15
|
+
super().__init__(host, username, password, sn_number, hostname, keep_alive, netio_manager, use_https)
|
|
16
|
+
self.fw_version = self.get_version()
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Implementation specifics for ESP devices with the firmware 4.0.x.
|
|
3
|
+
"""
|
|
4
|
+
from .esp_300_device import ESP300Device
|
|
5
|
+
from .. import NetioManager
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class ESP400Device(ESP300Device):
|
|
9
|
+
"""
|
|
10
|
+
A class to control ESP devices with the firmware 4.0.x.
|
|
11
|
+
"""
|
|
12
|
+
|
|
13
|
+
def __init__(self, host: str, username: str, password: str, sn_number: str, hostname: str, keep_alive: bool =
|
|
14
|
+
True, netio_manager: NetioManager | None = None, use_https: bool = False):
|
|
15
|
+
super().__init__(host, username, password, sn_number, hostname, keep_alive, netio_manager, use_https)
|
|
16
|
+
self.fw_version = self.get_version()
|