-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
afde03f
commit b2cd9c2
Showing
7 changed files
with
953 additions
and
782 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
*.patch binary |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,4 +6,6 @@ __pycache__/ | |
# local files | ||
.env | ||
.vscode | ||
.vs | ||
.vs | ||
dist/*.whl | ||
dist/*.tar.gz |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,33 @@ | ||
FROM python:3.11-slim AS build | ||
WORKDIR /app | ||
ENV POETRY_NO_INTERACTION=1 \ | ||
POETRY_VIRTUALENVS_IN_PROJECT=1 \ | ||
POETRY_VIRTUALENVS_CREATE=1 \ | ||
POETRY_CACHE_DIR=/tmp/poetry_cache | ||
|
||
COPY pyproject.toml poetry.lock ./ | ||
|
||
RUN apt update && apt install -y build-essential | ||
RUN if [ $(dpkg --print-architecture) = "armhf" ]; then \ | ||
printf "[global]\nextra-index-url=https://www.piwheels.org/simple\n" > /etc/pip.conf ; \ | ||
fi | ||
RUN pip install poetry | ||
RUN --mount=type=cache,target=$POETRY_CACHE_DIR poetry install --without dev --no-root | ||
|
||
FROM python:3.11-slim AS final | ||
WORKDIR /app | ||
ENV VIRTUAL_ENV=/app/.venv \ | ||
PATH="/app/.venv/bin:$PATH" \ | ||
PYTHONDONTWRITEBYTECODE=1 | ||
|
||
RUN apt update && apt install -y bluez | ||
|
||
COPY --from=build ${VIRTUAL_ENV} ${VIRTUAL_ENV} | ||
COPY ./atagmqtt atagmqtt | ||
|
||
# During debugging, this entry point will be overridden. For more information, refer to https://aka.ms/vscode-docker-python-debug | ||
FROM python:3.12 AS build | ||
WORKDIR /app | ||
ENV POETRY_NO_INTERACTION=1 \ | ||
POETRY_VIRTUALENVS_IN_PROJECT=1 \ | ||
POETRY_VIRTUALENVS_CREATE=1 \ | ||
POETRY_CACHE_DIR=/tmp/poetry_cache | ||
|
||
COPY pyproject.toml poetry.lock ./ | ||
|
||
RUN apt update && apt install -y build-essential dos2unix | ||
RUN if [ $(dpkg --print-architecture) = "armhf" ]; then \ | ||
printf "[global]\nextra-index-url=https://www.piwheels.org/simple\n" > /etc/pip.conf ; \ | ||
fi | ||
RUN pip install poetry | ||
RUN --mount=type=cache,target=$POETRY_CACHE_DIR poetry install --without dev --no-root | ||
|
||
COPY homie.patch ./ | ||
RUN find .venv/lib/python3.12/site-packages/homie -type f -print0 | xargs -0 unix2dos | ||
RUN patch --verbose -p0 -i homie.patch | ||
|
||
FROM python:3.12-slim AS final | ||
WORKDIR /app | ||
ENV VIRTUAL_ENV=/app/.venv \ | ||
PATH="/app/.venv/bin:$PATH" \ | ||
PYTHONDONTWRITEBYTECODE=1 | ||
|
||
RUN apt update && apt install -y bluez | ||
|
||
COPY --from=build ${VIRTUAL_ENV} ${VIRTUAL_ENV} | ||
COPY ./atagmqtt atagmqtt | ||
|
||
# During debugging, this entry point will be overridden. For more information, refer to https://aka.ms/vscode-docker-python-debug | ||
CMD ["python", "-m", "atagmqtt"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
--- .venv/lib/python3.12/site-packages/homie/device_base.py.orig 2024-12-01 13:13:19.563768881 +0100 | ||
+++ .venv/lib/python3.12/site-packages/homie/device_base.py 2024-12-01 13:15:44.858792494 +0100 | ||
@@ -97,7 +97,7 @@ | ||
|
||
self.mqtt_subscription_handlers = {} | ||
|
||
- global devices | ||
+ global devices | ||
devices.append(self) | ||
|
||
#atexit.register(self.close) | ||
@@ -166,7 +166,7 @@ | ||
def publish_extensions(self, retain=True, qos=1): | ||
extensions = ",".join(self.extensions) | ||
|
||
- if extensions is not "": | ||
+ if extensions != "": | ||
self.publish("/".join((self.topic, "$extensions")), extensions, retain, qos) | ||
|
||
if "stats" in self.extensions: | ||
@@ -195,7 +195,7 @@ | ||
|
||
# def publish_homeassistant(self,hass_config,hass_payload): | ||
# self.publish(hass_config,hass_payload, True, 1) | ||
- | ||
+ | ||
def add_subscription(self,topic,handler,qos=0): #subscription list to the required MQTT topics, used by properties to catch set topics | ||
self.mqtt_subscription_handlers [topic] = handler | ||
self.mqtt_client.subscribe (topic,qos) | ||
@@ -309,7 +309,7 @@ | ||
|
||
def close_devices(*arg): | ||
logger.info ('Closing Devices') | ||
- global devices | ||
+ global devices | ||
for device in devices: | ||
device.close() | ||
logger.info ('Closed Devices') | ||
--- .venv/lib/python3.12/site-packages/homie/node/property/property_base.py.orig 2024-12-01 13:13:19.563768881 +0100 | ||
+++ .venv/lib/python3.12/site-packages/homie/node/property/property_base.py 2024-12-01 13:16:45.943557530 +0100 | ||
@@ -148,7 +148,7 @@ | ||
|
||
def publish_tags(self, retain=True, qos=1): | ||
tags = ",".join(self.tags) | ||
- if tags is not "": | ||
+ if tags != "": | ||
self.publish("/".join((self.topic, "$tags")), tags, retain, qos) | ||
|
||
def publish_meta(self, retain=True, qos=1): |
Oops, something went wrong.