Skip to content

Commit 4b54a34

Browse files
authored
Merge pull request #27 from domschl/dev_0.7.0
Dev 0.7.0
2 parents 21d2a27 + 90937b4 commit 4b54a34

File tree

12 files changed

+857
-455
lines changed

12 files changed

+857
-455
lines changed
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
2+
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
3+
4+
name: Python package
5+
6+
on:
7+
push:
8+
branches: [ "master", "dev_0.7.0" ]
9+
pull_request:
10+
branches: [ "master" ]
11+
12+
jobs:
13+
build:
14+
15+
runs-on: ubuntu-latest
16+
strategy:
17+
fail-fast: false
18+
matrix:
19+
python-version: ["3.8", "3.10", "3.11"]
20+
21+
steps:
22+
- uses: actions/checkout@v3
23+
- name: Set up Python ${{ matrix.python-version }}
24+
uses: actions/setup-python@v3
25+
with:
26+
python-version: ${{ matrix.python-version }}
27+
- name: Get perl stuff
28+
run: |
29+
sudo apt install perl libio-socket-ssl-perl
30+
- name: Install dependencies
31+
run: |
32+
python -m pip install --upgrade pip
33+
python -m pip install twine build
34+
- name: Build python-fhem package
35+
run: |
36+
cd fhem
37+
cp ../README.md .
38+
python -m build
39+
- name: Install python-fhem
40+
run: |
41+
python -m pip install ./fhem/dist/*.gz
42+
rm ./fhem/dist/*
43+
# - name: Install fhem server
44+
# run: |
45+
# cd selftest
46+
# wget -nv https://fhem.de/fhem-6.0.tar.gz
47+
# mkdir fhem
48+
# cd fhem
49+
# tar -xzf ../fhem-6.0.tar.gz
50+
# cd fhem-6.0
51+
# mkdir certs
52+
# cd certs
53+
# openssl req -newkey rsa:2048 -nodes -keyout server-key.pem -x509 -days 36500 -out server-cert.pem -subj "/C=DE/ST=NRW/L=Earth/O=CompanyName/OU=IT/CN=www.example.com/[email protected]"
54+
# cd ..
55+
# cp ../../fhem-config-addon.cfg fhem.cfg
56+
# perl fhem.pl fhem.cfg
57+
- name: Test with selftest.py
58+
run: |
59+
cd selftest
60+
python selftest.py
61+
# python selftest.py --reuse

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2016-2018 Dominik Schlösser, [email protected]
3+
Copyright (c) 2016-2023 Dominik Schlösser, [email protected]
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 14 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Python FHEM (home automation server) API
99

1010
Simple API to connect to the [FHEM home automation server](https://fhem.de/) via sockets or http(s), using the telnet or web port on FHEM with optional SSL (TLS) and password or basicAuth support.
1111

12-
**Note:** Python 2.x deprecation warning. `python-fhem` versions 0.6.x will be the last versions supporting Python 2.x.
12+
**Note:** Starting with verson 0.7.0, Python 2.x is no longer supported with `python-fhem`. If you still require support for Python 2, use versions 0.6.5.
1313

1414
## Installation
1515

@@ -23,28 +23,22 @@ pip install [-U] fhem
2323

2424
### From source
2525

26-
In `python-fhem/fhem`:
27-
28-
Get a copy of README for the install (required by setup.py):
29-
30-
```bash
31-
cp ../README.md .
32-
```
33-
34-
then:
26+
To build your own package, install `python-build` and run:
3527

3628
```bash
37-
pip install [-U] .
29+
cd fhem
30+
python -m build
3831
```
3932

40-
or, as developer installation, allowing inplace editing:
33+
This will create a `dist` directory with the package. Install with:
4134

4235
```bash
43-
pip install [-U] -e .
36+
pip install [-U] dist/fhem-<version>.tar.gz
4437
```
45-
38+
4639
## History
4740

41+
* 0.7.0 (2023-08-17): [unpublished] Ongoing: move Travis CI -> Github actions, Python 2.x support removed, modernize python packaging, global states for SSL and authentication removed (support for multiple sessions).
4842
* 0.6.6 (2022-11-09): [unpublished] Fix for new option that produces fractional seconds in event data.
4943
* 0.6.5 (2020-03-24): New option `raw_value` for `FhemEventQueue`. Default `False` (old behavior), on `True`, the full, unparsed reading is returned, without looking for a unit.
5044
* 0.6.4 (2020-03-24): Bug fix for [#21](https://github.com/domschl/python-fhem/issues/21), Index out-of-range in event loop background thread for non-standard event formats.
@@ -141,12 +135,7 @@ The library can create an event queue that uses a background thread to receive
141135
and dispatch FHEM events:
142136

143137
```python
144-
try:
145-
# Python 3.x
146-
import queue
147-
except:
148-
# Python 2.x
149-
import Queue as queue
138+
import queue
150139
import fhem
151140

152141
que = queue.Queue()
@@ -159,6 +148,11 @@ while True:
159148
que.task_done()
160149
```
161150

151+
## Selftest
152+
153+
For a more complete example, you can look at [`selftest/selftest.py`](https://github.com/domschl/python-fhem/tree/master/selftest). This automatically installs an FHEM server, and runs a number of tests,
154+
creating devices and checking their state using the various different transports.
155+
162156
# Documentation
163157

164158
see: [python-fhem documentation](https://domschl.github.io/python-fhem/index.html)

fhem/MANIFEST.in

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)