Skip to content

Commit

Permalink
Merge 470beca into f46aa18
Browse files Browse the repository at this point in the history
  • Loading branch information
brainelectronics authored May 13, 2023
2 parents f46aa18 + 470beca commit 3fa3fcb
Show file tree
Hide file tree
Showing 7 changed files with 182 additions and 3 deletions.
7 changes: 7 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,3 +68,10 @@ jobs:
- name: Test build package
run: |
twine check dist/*
# - name: Validate mip package file
# run: |
# upy-package \
# --setup_file setup.py \
# --package_changelog_file changelog.md \
# --package_file package.json \
# --validate
56 changes: 55 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,17 +45,70 @@ Connect the MicroPython device to a network (if possible)
```python
import network
station = network.WLAN(network.STA_IF)
station.active(True)
station.connect('SSID', 'PASSWORD')
station.isconnected()
```

and install this lib on the MicroPython device like this
#### General

Install the latest package version of this lib on the MicroPython device

```python
import mip
mip.install("github:brainelectronics/micropython-nextion")
```

For MicroPython versions below 1.19.1 use the `upip` package instead of `mip`

```python
import upip
upip.install('micropython-nextion')
```

#### Specific version

Install a specific, fixed package version of this lib on the MicroPython device

```python
import mip
# install a verions of a specific branch
mip.install("github:brainelectronics/micropython-nextion", version="feature/add-mip-package-file")
# install a tag version
mip.install("github:brainelectronics/micropython-nextion", version="0.15.0")
```

For MicroPython versions below 1.19.1 use the `upip` package instead of `mip`

```python
import upip
upip.install('micropython-nextion')
```

#### Test version

Install a specific release candidate version uploaded to
[Test Python Package Index](https://test.pypi.org/) on every PR on the
MicroPython device. If no specific version is set, the latest stable version
will be used.

```python
import mip
mip.install("github:brainelectronics/micropython-nextion", version="0.15.0-rc1.dev29")
```

For MicroPython versions below 1.19.1 use the `upip` package instead of `mip`

```python
import upip
# overwrite index_urls to only take artifacts from test.pypi.org
upip.index_urls = ['https://test.pypi.org/pypi']
upip.install('micropython-nextion')
```

See also [brainelectronics Test PyPi Server in Docker][ref-brainelectronics-test-pypiserver]
for a test PyPi server running on Docker.

### Manually

#### Upload files to board
Expand Down Expand Up @@ -121,5 +174,6 @@ of the Arduino library.
[ref-nextion-wiki]: https://wiki.iteadstudio.com/Nextion_HMI_Solution
[ref-itead-nextion-github]: https://github.com/itead/ITEADLIB_Arduino_Nextion
[ref-remote-upy-shell]: https://github.com/dhylands/rshell
[ref-brainelectronics-test-pypiserver]: https://github.com/brainelectronics/test-pypiserver
[ref-github-be-mircopython-modules]: https://github.com/brainelectronics/micropython-modules
[ref-itead-github]: https://github.com/itead
9 changes: 8 additions & 1 deletion changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@ r"^\#\# \[\d{1,}[.]\d{1,}[.]\d{1,}\] \- \d{4}\-\d{2}-\d{2}$"
-->

## Released
## [0.15.0] - 2023-05-13
### Added
- `package.json` for `mip` installation with MicroPython v1.19.1 or newer, see #27
- Instructions for installation with `mip` on MicroPython v1.19.1 or newer in `README`, see #27
- UART ID can be specified in `NexHardware` with `uart_id`, see #29

## [0.14.0] - 2023-03-01
### Added
- `.editorconfig` for common editor settings
Expand Down Expand Up @@ -209,8 +215,9 @@ r"^\#\# \[\d{1,}[.]\d{1,}[.]\d{1,}\] \- \d{4}\-\d{2}-\d{2}$"
- [Example HMI file](examples/everything.HMI) to be used for all examples

<!-- Links -->
[Unreleased]: https://github.com/brainelectronics/micropython-nextion/compare/0.14.0...develop
[Unreleased]: https://github.com/brainelectronics/micropython-nextion/compare/0.15.0...develop

[0.15.0]: https://github.com/brainelectronics/micropython-nextion/tree/0.15.0
[0.14.0]: https://github.com/brainelectronics/micropython-nextion/tree/0.14.0
[0.13.0]: https://github.com/brainelectronics/micropython-nextion/tree/0.13.0
[0.12.0]: https://github.com/brainelectronics/micropython-nextion/tree/0.12.0
Expand Down
3 changes: 2 additions & 1 deletion nextion/nextion_hardware.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ class NexHardware(object):
def __init__(self,
rx_pin: int,
tx_pin: int,
uart_id: int = 1,
baudrate: Optional[int] = 9600,
timeout: Optional[int] = 100,
invert: Optional[int] = 0,
Expand Down Expand Up @@ -65,7 +66,7 @@ def __init__(self,
self._invert = invert

self._uart = UART(
1,
uart_id,
tx=self._tx_pin,
rx=self._rx_pin,
baudrate=self._baudrate,
Expand Down
108 changes: 108 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
{
"urls": [
[
"nextion/__init__.py",
"github:brainelectronics/micropython-nextion/nextion/__init__.py"
],
[
"nextion/common.py",
"github:brainelectronics/micropython-nextion/nextion/common.py"
],
[
"nextion/const.py",
"github:brainelectronics/micropython-nextion/nextion/const.py"
],
[
"nextion/nextion_button.py",
"github:brainelectronics/micropython-nextion/nextion/nextion_button.py"
],
[
"nextion/nextion_checkbox.py",
"github:brainelectronics/micropython-nextion/nextion/nextion_checkbox.py"
],
[
"nextion/nextion_crop.py",
"github:brainelectronics/micropython-nextion/nextion/nextion_crop.py"
],
[
"nextion/nextion_dual_state_button.py",
"github:brainelectronics/micropython-nextion/nextion/nextion_dual_state_button.py"
],
[
"nextion/nextion_gauge.py",
"github:brainelectronics/micropython-nextion/nextion/nextion_gauge.py"
],
[
"nextion/nextion_gpio.py",
"github:brainelectronics/micropython-nextion/nextion/nextion_gpio.py"
],
[
"nextion/nextion_hardware.py",
"github:brainelectronics/micropython-nextion/nextion/nextion_hardware.py"
],
[
"nextion/nextion_number.py",
"github:brainelectronics/micropython-nextion/nextion/nextion_number.py"
],
[
"nextion/nextion_page.py",
"github:brainelectronics/micropython-nextion/nextion/nextion_page.py"
],
[
"nextion/nextion_picture.py",
"github:brainelectronics/micropython-nextion/nextion/nextion_picture.py"
],
[
"nextion/nextion_progressbar.py",
"github:brainelectronics/micropython-nextion/nextion/nextion_progressbar.py"
],
[
"nextion/nextion_radio.py",
"github:brainelectronics/micropython-nextion/nextion/nextion_radio.py"
],
[
"nextion/nextion_rtc.py",
"github:brainelectronics/micropython-nextion/nextion/nextion_rtc.py"
],
[
"nextion/nextion_scrolltext.py",
"github:brainelectronics/micropython-nextion/nextion/nextion_scrolltext.py"
],
[
"nextion/nextion_slider.py",
"github:brainelectronics/micropython-nextion/nextion/nextion_slider.py"
],
[
"nextion/nextion_text.py",
"github:brainelectronics/micropython-nextion/nextion/nextion_text.py"
],
[
"nextion/nextion_timer.py",
"github:brainelectronics/micropython-nextion/nextion/nextion_timer.py"
],
[
"nextion/nextion_upload.py",
"github:brainelectronics/micropython-nextion/nextion/nextion_upload.py"
],
[
"nextion/nextion_variable.py",
"github:brainelectronics/micropython-nextion/nextion/nextion_variable.py"
],
[
"nextion/nextion_waveform.py",
"github:brainelectronics/micropython-nextion/nextion/nextion_waveform.py"
],
[
"nextion/typing.py",
"github:brainelectronics/micropython-nextion/nextion/typing.py"
],
[
"nextion/version.py",
"github:brainelectronics/micropython-nextion/nextion/version.py"
]
],
"deps": [
"micropython-ulogging"
],
"version": "0.15.0"
}
1 change: 1 addition & 0 deletions requirements-test.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
# Avoid fixed versions
flake8>=6.0.0,<7
yamllint>=1.29,<2
setup2upypackage>=0.1.0,<1
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
'Development Status :: 4 - Beta',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Programming Language :: Python :: Implementation :: MicroPython',
],
keywords='micropython, nextion, display, nextion-display, nextion-communication, uart, library',
project_urls={
Expand Down

0 comments on commit 3fa3fcb

Please sign in to comment.