Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
# Conflicts:
#	CHANGELOG.md
  • Loading branch information
jziolkowski committed Sep 14, 2024
2 parents 70750a7 + 4c65fa5 commit eb9ae2f
Show file tree
Hide file tree
Showing 25 changed files with 505 additions and 121 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ jobs:
run: pyinstaller --noconfirm --clean tdmgr.spec

- name: Upload binaries artifact to workflow
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: tdmgr
path: dist/*
28 changes: 28 additions & 0 deletions .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: PyTest

on:
workflow_dispatch:
pull_request:

jobs:
PyTest:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- uses: actions/setup-python@v4
with:
python-version: '3.8'

- name: Install dependencies
run: pip install -r requirements_dev.txt && pip install pytest-md

- name: Run pytest
uses: pavelzw/pytest-action@v2
with:
verbose: true
emoji: false
job-summary: true
custom-arguments: '-q'
click-to-expand: true
report-title: 'Test Report'
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## [2024.9.2] - 2024-09-14
## Fixed
- missing pydantic in pyproject.toml

## [2024.9.1] - 2024-09-12
## Changed
- semver -> calver, because following major/minor etc would not necessarily follow Tasmota features/breaking changes
Expand Down
5 changes: 3 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,9 @@ classifiers = [
"Development Status :: 4 - Beta",
]
dependencies = [
"paho_mqtt>=1.4",
"PyQt5>=5.14.2,<6"
"paho_mqtt>=1.4,<2",
"PyQt5>=5.14.2,<6",
"pydantic==2.5.2"
]
requires-python = ">=3.8"

Expand Down
2 changes: 1 addition & 1 deletion tdmgr/GUI/dialogs/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -560,7 +560,7 @@ def openTelemetry(self):
if self.device:
tele_widget = TelemetryWidget(self.device)
self.addDockWidget(Qt.RightDockWidgetArea, tele_widget)
self.mqtt_publish(self.device.cmnd_topic("STATUS"), "10")
self.mqtt_publish(self.device.cmnd_topic("STATUS"), "8")
self.tele_docks.append(tele_widget)
self.resizeDocks(
self.tele_docks, [100 // len(self.tele_docks) for _ in self.tele_docks], Qt.Vertical
Expand Down
13 changes: 13 additions & 0 deletions tdmgr/schemas/common.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,19 @@
import logging
from enum import Enum

from pydantic import BaseModel, ConfigDict, model_validator


class OnOffEnum(str, Enum):
ON = "ON"
OFF = "OFF"


class TDMBaseModel(BaseModel):
model_config = ConfigDict(extra="allow")

@model_validator(mode="after")
def log_extra_fields(cls, values):
if cls.__name__ != "StatusSNSSchema" and values.model_extra:
logging.warning("%s has extra fields: %s", cls.__name__, values.model_extra)
return values
Loading

0 comments on commit eb9ae2f

Please sign in to comment.