Skip to content

Commit

Permalink
Merge pull request #27 from domschl/dev_0.7.0
Browse files Browse the repository at this point in the history
Dev 0.7.0
  • Loading branch information
domschl authored Aug 18, 2023
2 parents 21d2a27 + 90937b4 commit 4b54a34
Show file tree
Hide file tree
Showing 12 changed files with 857 additions and 455 deletions.
61 changes: 61 additions & 0 deletions .github/workflows/python-fhem-test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python

name: Python package

on:
push:
branches: [ "master", "dev_0.7.0" ]
pull_request:
branches: [ "master" ]

jobs:
build:

runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.10", "3.11"]

steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Get perl stuff
run: |
sudo apt install perl libio-socket-ssl-perl
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install twine build
- name: Build python-fhem package
run: |
cd fhem
cp ../README.md .
python -m build
- name: Install python-fhem
run: |
python -m pip install ./fhem/dist/*.gz
rm ./fhem/dist/*
# - name: Install fhem server
# run: |
# cd selftest
# wget -nv https://fhem.de/fhem-6.0.tar.gz
# mkdir fhem
# cd fhem
# tar -xzf ../fhem-6.0.tar.gz
# cd fhem-6.0
# mkdir certs
# cd certs
# 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]"
# cd ..
# cp ../../fhem-config-addon.cfg fhem.cfg
# perl fhem.pl fhem.cfg
- name: Test with selftest.py
run: |
cd selftest
python selftest.py
# python selftest.py --reuse
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

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

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
34 changes: 14 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Python FHEM (home automation server) API

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.

**Note:** Python 2.x deprecation warning. `python-fhem` versions 0.6.x will be the last versions supporting Python 2.x.
**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.

## Installation

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

### From source

In `python-fhem/fhem`:

Get a copy of README for the install (required by setup.py):

```bash
cp ../README.md .
```

then:
To build your own package, install `python-build` and run:

```bash
pip install [-U] .
cd fhem
python -m build
```

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

```bash
pip install [-U] -e .
pip install [-U] dist/fhem-<version>.tar.gz
```

## History

* 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).
* 0.6.6 (2022-11-09): [unpublished] Fix for new option that produces fractional seconds in event data.
* 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.
* 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.
Expand Down Expand Up @@ -141,12 +135,7 @@ The library can create an event queue that uses a background thread to receive
and dispatch FHEM events:

```python
try:
# Python 3.x
import queue
except:
# Python 2.x
import Queue as queue
import queue
import fhem

que = queue.Queue()
Expand All @@ -159,6 +148,11 @@ while True:
que.task_done()
```

## Selftest

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,
creating devices and checking their state using the various different transports.

# Documentation

see: [python-fhem documentation](https://domschl.github.io/python-fhem/index.html)
Expand Down
1 change: 0 additions & 1 deletion fhem/MANIFEST.in

This file was deleted.

Loading

0 comments on commit 4b54a34

Please sign in to comment.