micolous / cbus

Use Python to communicate with a Clipsal C-Bus PCI or CNI! Includes MQTT bridge (for Home Assistant), PCI simulator, and reverse engineering notes.
http://cbus.readthedocs.org/
GNU Lesser General Public License v3.0
49 stars 27 forks source link

Expanded to all lighting applications - backward compatible #36

Open CABrouwers opened 2 years ago

CABrouwers commented 2 years ago
  1. Improved Windows compatibility

    • Added command to Dockerfile to automatically remove any CRLF line termination from the entry point script. They are sometimes added by git when it runs on Windows, and they prevent the script from running when the file is copied back on a Linux image.

    • Added code in cmqttd.py triggered when the code is run directly on a Windows machine. It deals with an issue related to windows ports' behavior within the event loop that results in an error. The issue is documented here: https://bugs.python.org/issue37373

  2. Added directory cmqttd_config/ to received project file and MQTT credential files. The content is copied on the image in directory etc/cmqttd/

  3. Added application argument to SAL class and all derived classes. It is necessary to enable LightingSAL classes to address multiple applications. The argument is ignored/optional for other SAL application classes.

  4. Adapted daemon to process all lighting applications.

  5. Improved label extraction logic:

    • Added argument to entry point sh and to mqttd:main to allow selecting a specific cbus network when the project file contains more than one.
    • Corrects bug when reading XML project files
    • All lighting application labels are now extracted; only groups with labels are published.
    • Groups are added dynamically if a packet is received later and no label was available in the project file.
    • If no application is available in project or project file is no provided, the default lighting application is assumed.
    • If an application has no label defined at all, all lights are published at start with default labels.
    • Topic strings and device naming is backward compatible.
  6. Upgraded version requirements for libraries. Python 3.10 is now required (due to the use of new typing syntax), thus forcing to pull alpine:edge docker image (Should be changed after the next alpine upgrade)

  7. Updated test code by adding application parameter to function calls when necessary. Test cases have not been modified otherwise.

  8. Added processing of level status report. The daemon automatically requests a report on all lighting applications at startup