Skip to content

Commit e408f5f

Browse files
authored
Merge pull request #3220 from benderl/fixes
Fixes
2 parents 892f1be + fa89299 commit e408f5f

2 files changed

Lines changed: 7 additions & 9 deletions

File tree

packages/helpermodules/pub.py

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ def __init__(self) -> None:
1313
self.publisher = InternalBrokerPublisher()
1414
self.publisher.start_loop()
1515

16-
def pub(self, topic: str, payload, qos: int = 0, retain: bool = True) -> None:
17-
if payload == "":
16+
def pub(self, topic: str, payload, qos: int = 0, retain: bool = True, no_json: bool = False) -> None:
17+
if payload == "" or no_json:
1818
self.publisher.client.publish(topic, payload, qos=qos, retain=retain)
1919
else:
2020
self.publisher.client.publish(topic, payload=json.dumps(payload), qos=qos, retain=retain)
@@ -31,7 +31,8 @@ def __getattr__(self, name):
3131
return getattr(self.instance, name)
3232

3333

34-
def pub_single(topic, payload, hostname="localhost", port=1883, no_json=False, retain=True):
34+
def pub_single(topic: str, payload, hostname: str = "localhost", port: int = 1883,
35+
no_json: bool = False, retain: bool = True):
3536
""" Sendet eine einzelne Nachricht an einen Host.
3637
3738
Parameter
@@ -46,10 +47,7 @@ def pub_single(topic, payload, hostname="localhost", port=1883, no_json=False, r
4647
Kompatibilität mit ISSS, die ramdisk verwenden.
4748
"""
4849
if hostname == "localhost":
49-
Pub().pub(topic, payload, qos=0, retain=retain)
50+
Pub().pub(topic, payload, qos=0, no_json=no_json, retain=retain)
5051
return
5152

52-
if no_json:
53-
publish.single(topic, payload, hostname=hostname, port=port, retain=retain)
54-
else:
55-
publish.single(topic, json.dumps(payload), hostname=hostname, port=port, retain=retain)
53+
publish.single(topic, payload if no_json else json.dumps(payload), hostname=hostname, port=port, retain=retain)

packages/modules/web_themes/standard_legacy/web/smartHome.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -450,7 +450,7 @@
450450
// load scripts synchronously in order specified
451451
var scriptsToLoad = [
452452
// load mqtt library
453-
'js/mqttws31.js',
453+
'js/mqtt-5.14.1.js',
454454
// some helper functions
455455
'helperFunctions.js?ver=20221117',
456456
// functions for processing messages

0 commit comments

Comments
 (0)