updates2mqtt 1.3.4__py3-none-any.whl → 1.3.5__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- updates2mqtt/app.py +2 -1
- updates2mqtt/config.py +18 -10
- {updates2mqtt-1.3.4.dist-info → updates2mqtt-1.3.5.dist-info}/METADATA +9 -4
- {updates2mqtt-1.3.4.dist-info → updates2mqtt-1.3.5.dist-info}/RECORD +7 -7
- {updates2mqtt-1.3.4.dist-info → updates2mqtt-1.3.5.dist-info}/WHEEL +0 -0
- {updates2mqtt-1.3.4.dist-info → updates2mqtt-1.3.5.dist-info}/entry_points.txt +0 -0
- {updates2mqtt-1.3.4.dist-info → updates2mqtt-1.3.5.dist-info}/licenses/LICENSE +0 -0
updates2mqtt/app.py
CHANGED
|
@@ -39,7 +39,8 @@ class App:
|
|
|
39
39
|
self.last_scan_timestamp: str | None = None
|
|
40
40
|
app_config: Config | None = load_app_config(CONF_FILE)
|
|
41
41
|
if app_config is None:
|
|
42
|
-
log.error(f"Invalid configuration at {CONF_FILE},
|
|
42
|
+
log.error(f"Invalid configuration at {CONF_FILE}, edit config to fix missing or invalid values and restart")
|
|
43
|
+
log.error("Exiting app")
|
|
43
44
|
sys.exit(1)
|
|
44
45
|
self.cfg: Config = app_config
|
|
45
46
|
|
updates2mqtt/config.py
CHANGED
|
@@ -96,6 +96,10 @@ class UpdateInfoConfig:
|
|
|
96
96
|
common_packages: dict[str, PackageUpdateInfo] = field(default_factory=lambda: {})
|
|
97
97
|
|
|
98
98
|
|
|
99
|
+
class IncompleteConfigException(BaseException):
|
|
100
|
+
pass
|
|
101
|
+
|
|
102
|
+
|
|
99
103
|
def load_package_info(pkginfo_file_path: Path) -> UpdateInfoConfig:
|
|
100
104
|
if pkginfo_file_path.exists():
|
|
101
105
|
log.debug("Loading common package update info", path=pkginfo_file_path)
|
|
@@ -107,29 +111,33 @@ def load_package_info(pkginfo_file_path: Path) -> UpdateInfoConfig:
|
|
|
107
111
|
return typing.cast("UpdateInfoConfig", cfg)
|
|
108
112
|
|
|
109
113
|
|
|
110
|
-
def load_app_config(conf_file_path: Path) -> Config | None:
|
|
111
|
-
initializing: bool = False
|
|
114
|
+
def load_app_config(conf_file_path: Path, return_new: bool = False) -> Config | None:
|
|
112
115
|
base_cfg = OmegaConf.structured(Config)
|
|
113
116
|
if conf_file_path.exists():
|
|
114
117
|
cfg = OmegaConf.merge(base_cfg, OmegaConf.load(conf_file_path))
|
|
115
118
|
else:
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
119
|
+
if not conf_file_path.parent.exists():
|
|
120
|
+
try:
|
|
121
|
+
log.debug(f"Creating config directory {conf_file_path.parent} if not already present")
|
|
122
|
+
conf_file_path.parent.mkdir(parents=True, exist_ok=True)
|
|
123
|
+
except Exception:
|
|
124
|
+
log.exception("Unable to create config directory", path=conf_file_path.parent)
|
|
122
125
|
try:
|
|
123
126
|
conf_file_path.write_text(OmegaConf.to_yaml(base_cfg))
|
|
127
|
+
log.info(f"Auto-generated a new config file at {conf_file_path}")
|
|
128
|
+
log.info("The config has place holders for MQTT user and password")
|
|
129
|
+
if return_new:
|
|
130
|
+
return base_cfg
|
|
131
|
+
return None
|
|
124
132
|
except Exception:
|
|
125
133
|
log.exception("Unable to write config file", path=conf_file_path)
|
|
126
134
|
cfg = base_cfg
|
|
127
135
|
|
|
128
136
|
try:
|
|
129
137
|
# Validate that all required fields are present, throw exception now rather than when config first used
|
|
130
|
-
OmegaConf.to_container(cfg, throw_on_missing=
|
|
138
|
+
OmegaConf.to_container(cfg, throw_on_missing=True)
|
|
131
139
|
OmegaConf.set_readonly(cfg, True)
|
|
132
140
|
return typing.cast("Config", cfg)
|
|
133
141
|
except (MissingMandatoryValue, ValidationError) as e:
|
|
134
|
-
log.error("Configuration error
|
|
142
|
+
log.error("Configuration error %s", e, path=conf_file_path.as_posix())
|
|
135
143
|
return None
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: updates2mqtt
|
|
3
|
-
Version: 1.3.
|
|
3
|
+
Version: 1.3.5
|
|
4
4
|
Summary: System update and docker image notification and execution over MQTT
|
|
5
5
|
Project-URL: Repository, https://github.com/rhizomatics/updates2mqtt
|
|
6
6
|
Project-URL: Documentation, https://updates2mqtt.rhizomatics.org.uk
|
|
@@ -65,10 +65,15 @@ button in the HomeAssistant update dialog. Icons and release notes can be specif
|
|
|
65
65
|
|
|
66
66
|
updates2mqtt prefers to be run inside a Docker container.
|
|
67
67
|
|
|
68
|
-
### Manual
|
|
68
|
+
### Manual - Run without installing using uv
|
|
69
69
|
```
|
|
70
|
-
uv
|
|
71
|
-
|
|
70
|
+
uv run --with updates2mqtt updates2mqtt
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
### Manual - Install and run with pip
|
|
74
|
+
```
|
|
75
|
+
pip install updates2mqtt
|
|
76
|
+
python3 -m updates2mqtt
|
|
72
77
|
```
|
|
73
78
|
### Docker
|
|
74
79
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
updates2mqtt/__init__.py,sha256=gnmHrLOSYc-N1-c5VG46OpNpoXEybKzYhEvFMm955P8,237
|
|
2
2
|
updates2mqtt/__main__.py,sha256=HBF00oH5fhS33sI_CdbxNlaUvbIzuuGxwnRYdhHqx0M,194
|
|
3
|
-
updates2mqtt/app.py,sha256=
|
|
4
|
-
updates2mqtt/config.py,sha256=
|
|
3
|
+
updates2mqtt/app.py,sha256=GfssSuanHYKQxcvZCSeFX6UxN64-h1lKp1HYgUpANg0,7824
|
|
4
|
+
updates2mqtt/config.py,sha256=x57wIb0KzJ09EJcRkEYsM4cS5344o6Cy0PaSfFDWMK4,4606
|
|
5
5
|
updates2mqtt/hass_formatter.py,sha256=Ulfj8F0e_1QMmRuJzHsNM2WxHbz9sIkWOWjRq3kQZzs,2772
|
|
6
6
|
updates2mqtt/model.py,sha256=5tWlj3appGGZjkuBeYR2lb-kXoy5mzCn4P_EJQjnwok,3676
|
|
7
7
|
updates2mqtt/mqtt.py,sha256=kDpbq9jk0av6FqyZrSPtg5oQrbklI0BMMH8wxnAp0OI,12230
|
|
@@ -9,8 +9,8 @@ updates2mqtt/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
|
9
9
|
updates2mqtt/integrations/__init__.py,sha256=KmNTUxvVWvqI7rl4I0xZg7XaCmcMS2O4OSv-ClsWM4Q,109
|
|
10
10
|
updates2mqtt/integrations/docker.py,sha256=OX_sXtWVgUJfRSFi_tTBib4gvP_foQI4MoeTkTeLbZc,18868
|
|
11
11
|
updates2mqtt/integrations/git_utils.py,sha256=SkAp6XcvCHwaiy17t6F97kcWTjBd7RyEmfhz6M_EhP0,2196
|
|
12
|
-
updates2mqtt-1.3.
|
|
13
|
-
updates2mqtt-1.3.
|
|
14
|
-
updates2mqtt-1.3.
|
|
15
|
-
updates2mqtt-1.3.
|
|
16
|
-
updates2mqtt-1.3.
|
|
12
|
+
updates2mqtt-1.3.5.dist-info/METADATA,sha256=_hRlXS3I27z_zEMDYyZw0uhm7l2ciCEIAfWDhHvSVlE,12924
|
|
13
|
+
updates2mqtt-1.3.5.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
14
|
+
updates2mqtt-1.3.5.dist-info/entry_points.txt,sha256=Hc6NZ2dBevYSUKTJU6NOs8Mw7Vt0S-9lq5FuKb76NCc,54
|
|
15
|
+
updates2mqtt-1.3.5.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
16
|
+
updates2mqtt-1.3.5.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|