Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expanded to all lighting applications - backward compatible #36

Open
wants to merge 16 commits into
base: master
Choose a base branch
from

Conversation

CABrouwers
Copy link

@CABrouwers CABrouwers commented Apr 21, 2022

  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

Add 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.
Add code in cmqttd.py that is triggered when the Python code is run directly on Windows. It deals with an issue related to windows ports' behavior within the event loop that results in an error. The issue is documented here: Configuration of windows event loop for libraries python/cpython#81554
It is useful when porting the python code to a Windows system.
Files in directory cmqttd__config are copied to image director etc/cmqttd.
@CABrouwers CABrouwers changed the title Improve Windows compatibility Improve Windows compatibility + added mechanism to initiate content of etc/cmqttd folder Apr 21, 2022
@CABrouwers CABrouwers changed the title Improve Windows compatibility + added mechanism to initiate content of etc/cmqttd folder Improves Windows compatibility + adds mechanism to initiate content of etc/cmqttd folder Apr 21, 2022
ElementTree.parse(...) does not accept a bufferReader as argument but accepts a file path
Add option to select a specific cbus network if the project file contains multiple networks. Backward compatibility is retained
The argument --bus-network add to the main cmqttd call and the argument CMQTTD_CBUS_NETWORK is added to the entrypoint-cmqttd.sh
This necessary to enable to the lightingSAL class to work with multilple lighting applications
Change CNI parameters to enable relaying of  all applications packets.
Application argument added to mttq client and Cbus handler
Extract label from all lighting applications. Default label generation is moved here (from MQTT onconnect event. Default labels only generated if no label availabl for application
Python 3.10 required. At this time only alpine edge includes the release. Docker pull will need to be modified after next regular release
Updated test code with  application argument where necessary.  No change/addition to the test case.
@CABrouwers CABrouwers changed the title Improves Windows compatibility + adds mechanism to initiate content of etc/cmqttd folder Expanded to all lighting applications - backward compatible Apr 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant