From 2c978400b9e62c5c61ab3a75e15883517ac0ae43 Mon Sep 17 00:00:00 2001 From: avollkopf <43980694+avollkopf@users.noreply.github.com> Date: Sat, 4 Mar 2023 15:03:21 +0100 Subject: [PATCH 1/2] set actor power added to api --- cbpi/__init__.py | 2 +- cbpi/http_endpoints/http_actor.py | 33 +++++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+), 1 deletion(-) diff --git a/cbpi/__init__.py b/cbpi/__init__.py index b9218f9..bf6d794 100644 --- a/cbpi/__init__.py +++ b/cbpi/__init__.py @@ -1,3 +1,3 @@ -__version__ = "4.1.3" +__version__ = "4.1.4" __codename__ = "Groundhog Day" diff --git a/cbpi/http_endpoints/http_actor.py b/cbpi/http_endpoints/http_actor.py index d3bec9b..e551dba 100644 --- a/cbpi/http_endpoints/http_actor.py +++ b/cbpi/http_endpoints/http_actor.py @@ -250,4 +250,37 @@ class ActorHttpEndpoints(): #print(data) await self.controller.call_action(actor_id, data.get("action"), data.get("parameter")) + return web.Response(status=204) + + @request_mapping(path="/{id}/set_power", method="POST", auth_required=auth) + async def http_set_power(self, request) -> web.Response: + """ + + --- + description: Set actor power + tags: + - Actor + parameters: + - name: "id" + in: "path" + description: "Actor ID" + required: true + type: "integer" + format: "int64" + - in: body + name: body + description: Set Power + required: true + schema: + type: object + properties: + temp: + type: integer + responses: + "204": + description: successful operation + """ + id = request.match_info['id'] + data = await request.json() + await self.controller.set_power(id,data.get("power")) return web.Response(status=204) \ No newline at end of file From 4c0aa22e984c7bfce6777ab054e1958b8e81c0fd Mon Sep 17 00:00:00 2001 From: avollkopf <43980694+avollkopf@users.noreply.github.com> Date: Sat, 4 Mar 2023 16:03:04 +0100 Subject: [PATCH 2/2] adapted dockerfiles to new org --- .devcontainer/Dockerfile | 2 +- Dockerfile | 2 +- cbpi/__init__.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index f1d8ce0..364d53d 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -16,6 +16,6 @@ RUN cat /workspace/additional-dev-requirements.txt 2>/dev/null 1>> /workspace/re # Install current version of cbpi-ui RUN mkdir /opt/downloads \ - && curl https://github.com/avollkopf/craftbeerpi4-ui/archive/main.zip -L -o /opt/downloads/cbpi-ui.zip \ + && curl https://github.com/PiBrewing/craftbeerpi4-ui/archive/main.zip -L -o /opt/downloads/cbpi-ui.zip \ && pip3 install --no-cache-dir /opt/downloads/cbpi-ui.zip \ && rm -rf /opt/downloads \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index 69b9e0c..de45f14 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,7 @@ FROM alpine:latest as download RUN apk --no-cache add curl && mkdir /downloads # Download installation files -RUN curl https://github.com/avollkopf/craftbeerpi4-ui/archive/main.zip -L -o ./downloads/cbpi-ui.zip +RUN curl https://github.com/PiBrewing/craftbeerpi4-ui/archive/main.zip -L -o ./downloads/cbpi-ui.zip FROM python:3.10 as base diff --git a/cbpi/__init__.py b/cbpi/__init__.py index bf6d794..17b857f 100644 --- a/cbpi/__init__.py +++ b/cbpi/__init__.py @@ -1,3 +1,3 @@ -__version__ = "4.1.4" +__version__ = "4.1.5" __codename__ = "Groundhog Day"