Merge pull request #94 from PiBrewing/development

Development
This commit is contained in:
Alexander Vollkopf 2023-03-06 20:09:15 +01:00 committed by GitHub
commit 2aae389a20
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 36 additions and 3 deletions

View file

@ -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

View file

@ -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

View file

@ -1,3 +1,3 @@
__version__ = "4.1.3"
__version__ = "4.1.5"
__codename__ = "Groundhog Day"

View file

@ -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)