-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #49 from Minims/dev
Dev
- Loading branch information
Showing
9 changed files
with
88 additions
and
33 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,25 @@ | ||
**/__pycache__ | ||
**/.classpath | ||
**/.dockerignore | ||
**/.env | ||
**/.git | ||
**/.gitignore | ||
**/.project | ||
**/.settings | ||
**/.toolstarget | ||
**/.vs | ||
**/.vscode | ||
**/*.*proj.user | ||
**/*.dbmdl | ||
**/*.jfm | ||
**/bin | ||
**/charts | ||
**/docker-compose* | ||
**/compose* | ||
**/Dockerfile* | ||
**/node_modules | ||
**/npm-debug.log | ||
**/obj | ||
**/secrets.dev.yaml | ||
**/values.dev.yaml | ||
README.md |
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,21 +1,23 @@ | ||
FROM python:3.8-slim-bullseye | ||
LABEL maintainer="Minims" | ||
ENV LANG C.UTF-8 | ||
|
||
STOPSIGNAL SIGINT | ||
|
||
# SomfyProtect2MQTT version | ||
ARG VERSION=0.1.7 | ||
|
||
# Download source and untar | ||
WORKDIR /usr/src | ||
ADD "https://github.com/Minims/SomfyProtect2MQTT/archive/refs/heads/dev.tar.gz" src.tar.gz | ||
RUN tar -xvf src.tar.gz | ||
RUN mv /usr/src/SomfyProtect2MQTT-dev /usr/src/SomfyProtect2MQTT | ||
|
||
# Install python requirements | ||
WORKDIR /usr/src/SomfyProtect2MQTT/somfyProtect2Mqtt | ||
RUN pip3 install -r requirements.txt | ||
|
||
# Run | ||
ENTRYPOINT ["./docker-entrypoint.sh"] | ||
# For more information, please refer to https://aka.ms/vscode-docker-python | ||
FROM python:3.8-slim | ||
|
||
# Keeps Python from generating .pyc files in the container | ||
ENV PYTHONDONTWRITEBYTECODE=1 | ||
|
||
# Turns off buffering for easier container logging | ||
ENV PYTHONUNBUFFERED=1 | ||
|
||
# Install pip requirements | ||
COPY requirements.txt . | ||
RUN python -m pip install -r requirements.txt | ||
|
||
WORKDIR /app | ||
COPY . /app | ||
|
||
# Creates a non-root user with an explicit UID and adds permission to access the /app folder | ||
# For more info, please refer to https://aka.ms/vscode-docker-python-configure-containers | ||
RUN adduser -u 5678 --disabled-password --gecos "" appuser && chown -R appuser /app | ||
USER appuser | ||
|
||
# During debugging, this entry point will be overridden. For more information, please refer to https://aka.ms/vscode-docker-python-debug | ||
ENTRYPOINT ["python", "main.py", "-c", "/config/config.yaml"] |
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 |
---|---|---|
@@ -1,13 +1,7 @@ | ||
version: "3.9" | ||
version: "3" | ||
services: | ||
somfyprotect2mqtt: | ||
build: . | ||
environment: | ||
TZ: Europe/Paris | ||
volumes: | ||
- ./data:/data | ||
- ./app:/app | ||
command: tail -f /dev/null | ||
- ./config:/config | ||
|
||
volumes: | ||
mydata: |
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
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,24 @@ | ||
"""Security InDoor Siren""" | ||
from typing import cast | ||
|
||
from somfy_protect.api.devices.base import SomfyProtectDevice | ||
|
||
|
||
class SomfyOne(SomfyProtectDevice): | ||
"""Class to represent Somfy One/One+.""" | ||
|
||
def get_rlink_quality(self) -> float: | ||
"""Link Quality in % | ||
Returns: | ||
float: Link Quality percentage | ||
""" | ||
return cast(float, self.get_status("rlink_quality_percent")) | ||
|
||
def get_battery_level(self) -> float: | ||
"""Battery Level | ||
Returns: | ||
float: Battery Level percentage | ||
""" | ||
return cast(float, self.get_status("battery_level")) |
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