updates2mqtt 1.4.1__py3-none-any.whl → 1.4.2__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/config.py +3 -1
- updates2mqtt/hass_formatter.py +20 -4
- updates2mqtt/mqtt.py +8 -6
- {updates2mqtt-1.4.1.dist-info → updates2mqtt-1.4.2.dist-info}/METADATA +9 -4
- {updates2mqtt-1.4.1.dist-info → updates2mqtt-1.4.2.dist-info}/RECORD +8 -8
- {updates2mqtt-1.4.1.dist-info → updates2mqtt-1.4.2.dist-info}/WHEEL +0 -0
- {updates2mqtt-1.4.1.dist-info → updates2mqtt-1.4.2.dist-info}/entry_points.txt +0 -0
- {updates2mqtt-1.4.1.dist-info → updates2mqtt-1.4.2.dist-info}/licenses/LICENSE +0 -0
updates2mqtt/config.py
CHANGED
|
@@ -49,6 +49,8 @@ class HomeAssistantDiscoveryConfig:
|
|
|
49
49
|
class HomeAssistantConfig:
|
|
50
50
|
discovery: HomeAssistantDiscoveryConfig = field(default_factory=HomeAssistantDiscoveryConfig)
|
|
51
51
|
state_topic_suffix: str = "state"
|
|
52
|
+
device_creation: bool = True
|
|
53
|
+
area: str | None = None
|
|
52
54
|
|
|
53
55
|
|
|
54
56
|
@dataclass
|
|
@@ -74,7 +76,7 @@ class LogConfig:
|
|
|
74
76
|
class Config:
|
|
75
77
|
log: LogConfig = field(default_factory=LogConfig)
|
|
76
78
|
node: NodeConfig = field(default_factory=NodeConfig)
|
|
77
|
-
mqtt: MqttConfig = field(default_factory=MqttConfig)
|
|
79
|
+
mqtt: MqttConfig = field(default_factory=MqttConfig) # pyright: ignore[reportCallIssue, reportArgumentType]
|
|
78
80
|
homeassistant: HomeAssistantConfig = field(default_factory=HomeAssistantConfig)
|
|
79
81
|
docker: DockerConfig = field(default_factory=DockerConfig)
|
|
80
82
|
scan_interval: int = 60 * 60 * 3
|
updates2mqtt/hass_formatter.py
CHANGED
|
@@ -19,9 +19,16 @@ HASS_UPDATE_SCHEMA = [
|
|
|
19
19
|
|
|
20
20
|
|
|
21
21
|
def hass_format_config(
|
|
22
|
-
discovery: Discovery,
|
|
22
|
+
discovery: Discovery,
|
|
23
|
+
object_id: str,
|
|
24
|
+
node_name: str,
|
|
25
|
+
state_topic: str,
|
|
26
|
+
command_topic: str | None,
|
|
27
|
+
device_creation: bool = True,
|
|
28
|
+
area: str | None = None,
|
|
29
|
+
session: str | None = None,
|
|
23
30
|
) -> dict[str, Any]:
|
|
24
|
-
config = {
|
|
31
|
+
config: dict[str, Any] = {
|
|
25
32
|
"name": f"{discovery.name} {discovery.source_type} on {node_name}",
|
|
26
33
|
"device_class": None, # not firmware, so defaults to null
|
|
27
34
|
"unique_id": object_id,
|
|
@@ -37,11 +44,20 @@ def hass_format_config(
|
|
|
37
44
|
"latest_version_topic": state_topic,
|
|
38
45
|
"latest_version_template": "{{value_json.latest_version}}",
|
|
39
46
|
"origin": {
|
|
40
|
-
"name": "updates2mqtt",
|
|
41
|
-
"sw_version": updates2mqtt.version,
|
|
47
|
+
"name": f"{node_name} updates2mqtt Agent",
|
|
48
|
+
"sw_version": updates2mqtt.version, # pyright: ignore[reportAttributeAccessIssue]
|
|
42
49
|
"support_url": "https://github.com/rhizomatics/updates2mqtt/issues",
|
|
43
50
|
},
|
|
44
51
|
}
|
|
52
|
+
if device_creation:
|
|
53
|
+
config["device"] = {
|
|
54
|
+
"name": f"{node_name} updates2mqtt Agent",
|
|
55
|
+
"sw_version": updates2mqtt.version, # pyright: ignore[reportAttributeAccessIssue]
|
|
56
|
+
"manufacturer": "rhizomatics",
|
|
57
|
+
"identifiers": [f"{node_name}.updates2mqtt"],
|
|
58
|
+
}
|
|
59
|
+
if area:
|
|
60
|
+
config["device"]["suggested_area"] = area
|
|
45
61
|
if command_topic:
|
|
46
62
|
config["command_topic"] = command_topic
|
|
47
63
|
config["payload_install"] = f"{discovery.source_type}|{discovery.name}|install"
|
updates2mqtt/mqtt.py
CHANGED
|
@@ -315,12 +315,14 @@ class MqttPublisher:
|
|
|
315
315
|
self.publish(
|
|
316
316
|
self.config_topic(discovery),
|
|
317
317
|
hass_format_config(
|
|
318
|
-
discovery,
|
|
319
|
-
object_id,
|
|
320
|
-
self.node_cfg.name,
|
|
321
|
-
self.
|
|
322
|
-
|
|
323
|
-
|
|
318
|
+
discovery=discovery,
|
|
319
|
+
object_id=object_id,
|
|
320
|
+
node_name=self.node_cfg.name,
|
|
321
|
+
area=self.hass_cfg.area,
|
|
322
|
+
state_topic=self.state_topic(discovery),
|
|
323
|
+
command_topic=command_topic,
|
|
324
|
+
device_creation=self.hass_cfg.device_creation,
|
|
325
|
+
session=discovery.session,
|
|
324
326
|
),
|
|
325
327
|
)
|
|
326
328
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: updates2mqtt
|
|
3
|
-
Version: 1.4.
|
|
3
|
+
Version: 1.4.2
|
|
4
4
|
Summary: System update and docker image notification and execution over MQTT
|
|
5
5
|
Project-URL: Homepage, https://updates2mqtt.rhizomatics.org.uk
|
|
6
6
|
Project-URL: Repository, https://github.com/rhizomatics/updates2mqtt
|
|
@@ -35,7 +35,7 @@ Requires-Dist: structlog>=25.4.0
|
|
|
35
35
|
Requires-Dist: usingversion>=0.1.2
|
|
36
36
|
Description-Content-Type: text/markdown
|
|
37
37
|
|
|
38
|
-
|
|
38
|
+
{ align=left }
|
|
39
39
|
|
|
40
40
|
# updates2mqtt
|
|
41
41
|
|
|
@@ -43,14 +43,19 @@ Description-Content-Type: text/markdown
|
|
|
43
43
|
|
|
44
44
|
[](https://pypi.org/project/updates2mqtt/)
|
|
45
45
|
[](https://github.com/rhizomatics/supernotify)
|
|
46
|
-
](https://updates2mqtt.rhizomatics.org.uk/developer/coverage/)
|
|
47
|
+

|
|
48
48
|
[](https://results.pre-commit.ci/latest/github/rhizomatics/updates2mqtt/main)
|
|
49
49
|
[](https://github.com/rhizomatics/updates2mqtt/actions/workflows/pypi-publish.yml)
|
|
50
50
|
[](https://github.com/rhizomatics/updates2mqtt/actions/workflows/python-package.yml)
|
|
51
51
|
[](https://github.com/rhizomatics/updates2mqtt/actions/workflows/github-code-scanning/codeql)
|
|
52
52
|
[](https://github.com/rhizomatics/updates2mqtt/actions/workflows/dependabot/dependabot-updates)
|
|
53
53
|
|
|
54
|
+
|
|
55
|
+
<br/>
|
|
56
|
+
<br/>
|
|
57
|
+
|
|
58
|
+
|
|
54
59
|
## Summary
|
|
55
60
|
|
|
56
61
|
Let Home Assistant tell you about new updates to Docker images for your containers.
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
updates2mqtt/__init__.py,sha256=gnmHrLOSYc-N1-c5VG46OpNpoXEybKzYhEvFMm955P8,237
|
|
2
2
|
updates2mqtt/__main__.py,sha256=HBF00oH5fhS33sI_CdbxNlaUvbIzuuGxwnRYdhHqx0M,194
|
|
3
3
|
updates2mqtt/app.py,sha256=-jAe9HcSSRmq5SZCvlsb8bFq2yVBNZQ0alQ5iRjl3tY,8518
|
|
4
|
-
updates2mqtt/config.py,sha256=
|
|
5
|
-
updates2mqtt/hass_formatter.py,sha256=
|
|
4
|
+
updates2mqtt/config.py,sha256=G7_5L7Ypc7dl35nnd5dP2AobSA08ZuyEM_ETCTPg_co,5144
|
|
5
|
+
updates2mqtt/hass_formatter.py,sha256=GrVtxqpaXNFaQWXjmOFhOxYwXVjeNjzUwAjFdJdsrwI,3337
|
|
6
6
|
updates2mqtt/model.py,sha256=O6GQFhfQvwQDxlZScFHrpQgFNkUrUAeaGGP6AqNua78,3827
|
|
7
|
-
updates2mqtt/mqtt.py,sha256=
|
|
7
|
+
updates2mqtt/mqtt.py,sha256=I8g-SekY-AIVRcSCZyb7fTGji5a8zT1PJ7d34l7LGyY,14832
|
|
8
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=Yb0XsrRyNZYAkw_ayd2iYLPFwgeA51Lz9HBVAGq3rs4,19273
|
|
11
11
|
updates2mqtt/integrations/git_utils.py,sha256=bPCmQiZpKpMcrGI7xAVmePXHFn8WwjcPNkf7xqDsGQA,2319
|
|
12
|
-
updates2mqtt-1.4.
|
|
13
|
-
updates2mqtt-1.4.
|
|
14
|
-
updates2mqtt-1.4.
|
|
15
|
-
updates2mqtt-1.4.
|
|
16
|
-
updates2mqtt-1.4.
|
|
12
|
+
updates2mqtt-1.4.2.dist-info/METADATA,sha256=1wqWYIbcNbC-SQxk2FiI_SPmw9F-RFwdoOE_vviSXzw,9290
|
|
13
|
+
updates2mqtt-1.4.2.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
|
|
14
|
+
updates2mqtt-1.4.2.dist-info/entry_points.txt,sha256=Hc6NZ2dBevYSUKTJU6NOs8Mw7Vt0S-9lq5FuKb76NCc,54
|
|
15
|
+
updates2mqtt-1.4.2.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
16
|
+
updates2mqtt-1.4.2.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|