diff --git a/data/config/mosquitto/openwb_local.conf b/data/config/mosquitto/openwb_local.conf index f540b3dcf1..e9acb2edc3 100644 --- a/data/config/mosquitto/openwb_local.conf +++ b/data/config/mosquitto/openwb_local.conf @@ -1,4 +1,4 @@ -# openwb-version:19 +# openwb-version:20 listener 1886 localhost allow_anonymous true @@ -33,8 +33,6 @@ topic openWB/internal_chargepoint/# out 2 topic openWB/io/# out 2 topic openWB/internal_io/# out 2 -topic openWB/mqtt/# both 2 - topic openWB/pv/config/configured out 2 topic openWB/pv/get/# out 2 topic openWB/pv/+/config/# out 2 diff --git a/packages/helpermodules/update_config.py b/packages/helpermodules/update_config.py index 40daa6a85b..82e2a5850d 100644 --- a/packages/helpermodules/update_config.py +++ b/packages/helpermodules/update_config.py @@ -28,7 +28,7 @@ from helpermodules.measurement_logging.process_log import get_default_charge_log_columns, get_totals from helpermodules.measurement_logging.write_log import get_names from helpermodules.messaging import MessageType, pub_system_message -from helpermodules.pub import Pub +from helpermodules.pub import Pub, pub_single from helpermodules.utils.json_file_handler import write_and_check from helpermodules.utils.run_command import run_command from helpermodules.utils.topic_parser import decode_payload, get_index, get_second_index @@ -56,7 +56,7 @@ class UpdateConfig: - DATASTORE_VERSION = 89 + DATASTORE_VERSION = 90 valid_topic = [ "^openWB/bat/config/bat_control_permitted$", @@ -2348,3 +2348,19 @@ def upgrade_datastore_88(self) -> None: pub_system_message({}, "Es gibt ein neues Theme: das Koala-Theme! Smarthpone-optimiert und mit " "Energiefluss-Diagramm & Karten-Ansicht der Ladepunkte", MessageType.INFO) self.__update_topic("openWB/system/datastore_version", 89) + + def upgrade_datastore_89(self) -> None: + def on_connect(client, userdata, flags, rc): + client.subscribe("openWB/mqtt/#") + + def on_message(client, userdata, message): + log.debug(f"Lösche MQTT-Device-Topic {message.topic} auf dem externen Broker") + pub_single(message.topic, "") + + BrokerClient("deleteMqttDeviceExternalBroker", + on_connect, + on_message, + host="localhost", + port=1883).start_finite_loop() + + self.__update_topic("openWB/system/datastore_version", 90)