Skip to content

Commit

Permalink
enable status response tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jziolkowski committed Sep 13, 2024
1 parent 5bdbdb1 commit 38951ff
Show file tree
Hide file tree
Showing 22 changed files with 473 additions and 119 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ classifiers = [
"Development Status :: 4 - Beta",
]
dependencies = [
"paho_mqtt>=1.4",
"paho_mqtt>=1.4,<2",
"PyQt5>=5.14.2,<6"
]
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 38951ff

Please sign in to comment.