Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,12 @@ example.*
home.*
img
.coverage
cmqttd_config/*.cbz
cmqttd_config/*.pem
cmqttd_config/*.key¸
cmqttd_config/*.xml
cmqttd_config/auth
certificates
.vscode
project.xml
venv
9 changes: 6 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,13 @@
# $ docker build -t cmqttd .
# $ docker run --device /dev/ttyUSB0 -e "SERIAL_PORT=/dev/ttyUSB0" \
# -e "MQTT_SERVER=192.2.0.1" -e "TZ=Australia/Adelaide" -it cmqttd
FROM alpine:3.11 as base
FROM alpine:edge as base
# python 3.10 required, at date this file is created only available in alpine:edge

# Install most Python deps here, because that way we don't need to include build tools in the
# final image.
RUN apk add --no-cache python3 py3-cffi py3-paho-mqtt py3-six tzdata && \
pip3 install 'pyserial==3.4' 'pyserial_asyncio==0.4'
RUN apk add --no-cache python3 py-pip py3-cffi py3-paho-mqtt py3-six tzdata && \
pip3 install 'pyserial==3.5' 'pyserial_asyncio==0.6'

# Runs tests and builds a distribution tarball
FROM base as builder
Expand All @@ -27,8 +28,10 @@ RUN pip3 install 'parameterized' && \
# cmqttd runner image
FROM base as cmqttd
COPY COPYING COPYING.LESSER Dockerfile README.md entrypoint-cmqttd.sh /
RUN sed -i 's/\r$//' entrypoint-cmqttd.sh
COPY --from=builder /cbus/dist/cbus-0.2.generic.tar.gz /
RUN tar zxf /cbus-0.2.generic.tar.gz && rm /cbus-0.2.generic.tar.gz
COPY cmqttd_config/ /etc/cmqttd/

# Runs cmqttd itself
CMD /entrypoint-cmqttd.sh
6 changes: 6 additions & 0 deletions cbus/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,11 +116,16 @@ class Application(IntEnum):
LIGHTING_5d = 0x5d
LIGHTING_5e = 0x5e
LIGHTING_LAST = LIGHTING_5f = 0x5f
HVACACTUATOR_73 = 0x73
HVACACTUATOR_74 = 0x74
HVAC = 0xCA
CLOCK = 0xDF
TRIGGER = 0xCA
ENABLE = 0xCB
MASTER_APPLICATION = STATUS_REQUEST = 0xff



class CAL(IntEnum):
RESET = 0x08
RECALL = 0x1a
Expand Down Expand Up @@ -429,3 +434,4 @@ def check_ga(group_addr: int) -> None:
raise ValueError(
'Group Address out of range ({}..{}), got {}'.format(
MIN_GROUP_ADDR, MAX_GROUP_ADDR, group_addr))

Loading