uns-kit 0.0.5__tar.gz → 0.0.6__tar.gz

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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: uns-kit
3
- Version: 0.0.5
3
+ Version: 0.0.6
4
4
  Summary: Lightweight Python UNS MQTT client (pub/sub + infra topics)
5
5
  License: MIT
6
6
  Author: Aljoša Vister
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "uns-kit"
3
- version = "0.0.5"
3
+ version = "0.0.6"
4
4
  description = "Lightweight Python UNS MQTT client (pub/sub + infra topics)"
5
5
  authors = ["Aljoša Vister <aljosa.vister@gmail.com>"]
6
6
  license = "MIT"
@@ -143,15 +143,22 @@ def create(dest: str):
143
143
  @click.option("--path", default="config.json", show_default=True)
144
144
  def write_config(path: str):
145
145
  data = {
146
- "host": "localhost",
147
- "port": 1883,
148
- "username": "",
149
- "password": "",
150
- "tls": False,
151
- "clientId": "uns-py",
152
- "packageName": "uns-kit",
153
- "packageVersion": "0.0.1",
154
- "processName": "uns-process",
146
+ "infra": {
147
+ "host": "localhost",
148
+ "port": 1883,
149
+ "username": "",
150
+ "password": "",
151
+ "tls": False,
152
+ "clientId": "uns-py",
153
+ "mqttSubToTopics": [],
154
+ "keepalive": 60,
155
+ "clean": True
156
+ },
157
+ "uns": {
158
+ "packageName": "uns-kit",
159
+ "packageVersion": "0.0.1",
160
+ "processName": "uns-process"
161
+ }
155
162
  }
156
163
  Path(path).write_text(json.dumps(data, indent=2))
157
164
  click.echo(f"Wrote {path}")
@@ -36,4 +36,4 @@ The default `main.py` uses `UnsProxyProcess` + `UnsMqttProxy`, which publish:
36
36
  - transformation stats (`.../<instance>/published-message-*`, `.../<instance>/subscribed-message-*`) every 60s
37
37
 
38
38
  ## Config
39
- Edit `config.json` with your MQTT host/auth.
39
+ Edit `config.json` with your MQTT host/auth (TS-style nested infra/uns structure).
@@ -8,9 +8,7 @@ from uns_kit import UnsConfig, UnsMqttClient, TopicBuilder
8
8
 
9
9
  def load_config() -> UnsConfig:
10
10
  cfg_path = Path("config.json")
11
- if cfg_path.exists():
12
- return UnsConfig.load(cfg_path)
13
- return UnsConfig(host="localhost")
11
+ return UnsConfig.load(cfg_path)
14
12
 
15
13
 
16
14
  def simulate_sensor_value(step: int) -> float:
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes