Release Version 1.3.2

This commit is contained in:
Dirk Alders 2025-08-29 18:06:02 +02:00
parent 9c0aff5244
commit d331408806
10 changed files with 57094 additions and 46195 deletions

View File

@ -8,6 +8,8 @@ devinit:
cp config_example/config.j2 config.py
chmod 600 config.py
sed -i "/^DEBUG.*=.*/c\DEBUG = True" config.py
sed -i "/^LOG_HOSTNAME.*=.*/c\LOG_HOSTNAME = \"localhost\"" config.py
sed -i "/^LOG_LEVEL.*=.*/c\LOG_LEVEL = logging.WARNING" config.py
sed -i 's/{{ smart_srv_brain_hostname }}/localhost/' config.py
sed -i 's/"{{ smart_srv_brain_username }}"/None/' config.py
sed -i 's/"{{ smart_srv_brain_password }}"/None/' config.py

12
__make.d__/coverage.mk Normal file
View File

@ -0,0 +1,12 @@
.ONESHELL:
SHELL = /usr/bin/bash
MAKEFLAGS += --no-print-directory
.SILENT:
COV3_CMD=venv/bin/coverage
coverage:
$(COV3_CMD) erase
$(COV3_CMD) run -a --branch --source=devdi,devices,function smart_brain.py
$(COV3_CMD) xml -o ../smart_brain_test/testresults/coverage.xml

View File

@ -10,3 +10,4 @@ VENV_FOLDER = ./venv
localhelp:
echo "Possible local options are:"
echo " - devinit - Initialise the application for development usage"
echo " - coverage - Run smarthome in coverage mode"

2211
_testresults_/coverage.xml Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

Binary file not shown.

View File

@ -1,6 +1,5 @@
import geo
import logging
import report
from topics import *
DEBUG = False

2
devdi

@ -1 +1 @@
Subproject commit 58167fb8ecd719df6a6aca693cf9fd7735149db4
Subproject commit f0b994ef9c3a0526c4b699c491ccb478bc3847d0

View File

@ -2,6 +2,7 @@
# -*- coding: utf-8 -*-
#
import config
from devdi.topic import STOP_EXECUTION_TOPIC
import devices
from function.garden import garden
from function.stairway import stairway
@ -10,7 +11,9 @@ from function.first_floor_west import first_floor_west
from function.first_floor_east import first_floor_east
from function.rooms import room_collection
from function.videv import all_off, videv_pure_switch
import json
import logging
import mqtt
try:
from config import APP_NAME as ROOT_LOGGER_NAME
@ -20,9 +23,13 @@ logger = logging.getLogger(ROOT_LOGGER_NAME).getChild(__name__)
class all_functions(room_collection):
def __init__(self, mqtt_client):
def __init__(self, mqtt_client: mqtt.mqtt_client):
super().__init__(mqtt_client)
#
self.run = True
if config.DEBUG:
mqtt_client.add_callback(STOP_EXECUTION_TOPIC, self.__stop_execution__)
#
# Rooms
#
# garden
@ -45,6 +52,16 @@ class all_functions(room_collection):
# Summer / Winter mode
self.init_sumer_winter_mode()
def __stop_execution__(self, client, userdata, message):
if config.DEBUG:
try:
data = json.loads(message.payload)
except:
logger.error("Error while receiving mqtt message: topic=%s - payload=%s", repr(message.topic), repr(message.payload))
else:
if data is True:
self.run = False
def init_cross_room_interactions(self):
# shelly dirk input 1
self.last_gfw_dirk_input_1 = None

View File

@ -12,7 +12,7 @@ logger = report.default_logging_config()
VERS_MAJOR = 1
VERS_MINOR = 3
VERS_PATCH = 1
VERS_PATCH = 2
INFO_TOPIC = "__info__"
INFO_DATA = {
@ -49,5 +49,5 @@ if __name__ == "__main__":
#
func = function.all_functions(mc)
while (True):
while (func.run):
time.sleep(1)