hassio-plejd/plejd/Dockerfile
Victor b3c6334f0c
Improve MQTT behavior and add experimental parsing for color temp support from Plejd API (#298)
* Update underlying docker containers and dependencies.
* Minor linting and code issues fixes
* Update supported devices section
* Improve Mqtt message properties - retain, etc.
- Retain discovery messages
- Don't retain others
- Set QoS to 1 consistently to ensure at least once delivery
- Set session timeout to ensure a reasonable TTL on messages
* Code and logic to remove any retained mqtt messages for SET/STATE/AVAILABILITY
* Temporary restructure of init flow for mqtt.
- No longer wait for HA birth message
- Don't listen to incoming messages until old retained messages have been purged.
- More details in https://github.com/icanos/hassio-plejd/issues/218
* Fix lingering incorrect access of connectedDevice.id
* Fix to avoid Home Assistant setting retain flag on MQTT SET STATE messages
* Parse new TRAIT=15, assuming this means dimmable and tunable white
* Clarify TRAITS bitmask values
* Add experimental parsing for color temp support from Plejd API
* Lint fixes
* Remove null coalescing operator since we don't compile code
* Handle case where outputSettings is null in PlejdApi
* Solve MQTT errors due to deprecated api color_temp and unsupported removal of retained state messages
2025-08-05 19:55:50 +02:00

68 lines
1.4 KiB
Docker

ARG BUILD_FROM=hassioaddons/base:14.2.2
FROM $BUILD_FROM
ENV LANG C.UTF-8
# Set shell
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
# Copy data for add-on
COPY ./*.js /plejd/
COPY ./config.json /plejd/
COPY ./package.json /plejd/
ARG BUILD_ARCH
# Install Node
RUN apk add --no-cache jq
RUN \
apk add --no-cache --virtual .build-dependencies \
g++ \
gcc \
libc-dev \
linux-headers \
make \
python3 \
bluez \
eudev-dev \
zlib-dev \
\
&& apk add --no-cache \
git \
nodejs \
npm \
dbus-dev \
glib-dev \
\
&& npm config set unsafe-perm true
WORKDIR /plejd
RUN npm install \
--no-audit \
--no-update-notifier \
--unsafe-perm
# Copy root filesystem
COPY rootfs /
# Build arguments
ARG BUILD_DATE
ARG BUILD_REF
ARG BUILD_VERSION
# Labels
LABEL \
io.hass.name="Plejd" \
io.hass.description="Adds support for the Swedish home automation devices from Plejd." \
io.hass.arch="${BUILD_ARCH}" \
io.hass.type="addon" \
io.hass.version=${BUILD_VERSION} \
maintainer="Marcus Westin <marcus@sekurbit.se>" \
org.label-schema.description="Adds support for the Swedish home automation devices from Plejd." \
org.label-schema.build-date=${BUILD_DATE} \
org.label-schema.name="Plejd" \
org.label-schema.schema-version="1.0" \
org.label-schema.usage="https://github.com/icanos/hassio-plejd/tree/master/README.md" \
org.label-schema.vcs-ref=${BUILD_REF} \
org.label-schema.vcs-url="https://github.com/icanos/hassio-plejd"