Skip to content

Commit

Permalink
Merge pull request #1085 from benderl/bugfix
Browse files Browse the repository at this point in the history
Bugfix
  • Loading branch information
benderl authored Aug 14, 2023
2 parents 6cc9664 + 64ba8bb commit bfccc05
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 28 deletions.
3 changes: 2 additions & 1 deletion data/config/boot_config.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# openwb - begin
# openwb-version:2
# openwb-version:3
# Do not edit this section! We need begin/end and version for proper updates!
[all]
gpio=4,5,7,11,17,22,23,24,25,26,27=op,dl
Expand All @@ -8,4 +8,5 @@ gpio=6,8,9,10,12,13,16,21=ip,pu
# this also requires to disable Bluetooth
dtoverlay=disable-bt
enable_uart=1
avoid_warnings=1
# openwb - end
10 changes: 5 additions & 5 deletions packages/helpermodules/messaging.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def pub_user_message(payload: dict, connection_id: str, message: str,

def pub_system_message(payload: dict, message: str,
message_type: MessageType = MessageType.INFO) -> None:
""" sendet eine Meldung an den Benutzer
""" sendet eine Meldung an alle Benutzer
"""
_pub_message(payload, None, message, message_type, MessageTarget.SYSTEM)

Expand Down Expand Up @@ -57,11 +57,11 @@ def _pub_message(payload: dict, connection_id: Optional[str], message: str,
log.warning('Benutzerbenachrichtigung ohne \'connection_id\'')
Pub().pub(topic, message_payload)
if message_type == MessageType.ERROR:
log.error(f'Befehl konnte nicht ausgeführt werden: {message_payload}')
log.error(f'Messaging: Fehlermeldung: {message_payload}')
else:
log.debug(f'Befehl erfolgreich ausgeführt: {message}')
log.debug(f'Messaging: Meldung: {message}')
except Exception:
log.exception("Fehler im Command-Modul")
log.exception("Fehler im Messaging-Modul")


def pub_error_global(payload: dict, connection_id: str, error_str: str) -> None:
Expand All @@ -76,4 +76,4 @@ def pub_error_global(payload: dict, connection_id: str, error_str: str) -> None:
Pub().pub(f'openWB/set/command/{connection_id}/error', error_payload)
log.error(f'Befehl konnte nicht ausgeführt werden: {error_payload}')
except Exception:
log.exception("Fehler im Command-Modul")
log.exception("Fehler im Messaging-Modul")
41 changes: 21 additions & 20 deletions packages/helpermodules/update_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -318,37 +318,38 @@ class UpdateConfig:
"^openWB/LegacySmartHome/Devices/[0-9]+/OnCntStandby$",
"^openWB/LegacySmartHome/Devices/[1-2]+/TemperatureSensor[0-2]$",

"^openWB/system/boot_done$",
"^openWB/system/available_branches",
"^openWB/system/backup_cloud/config$",
"^openWB/system/dataprotection_acknowledged$",
"^openWB/system/usage_terms_acknowledged$",
"^openWB/system/debug_level$",
"^openWB/system/lastlivevaluesJson$",
"^openWB/system/ip_address$",
"^openWB/system/version$",
"^openWB/system/release_train$",
"^openWB/system/update_in_progress$",
"^openWB/system/device/[0-9]+/config$",
"^openWB/system/device/[0-9]+/component/[0-9]+/config$",
"^openWB/system/device/[0-9]+/component/[0-9]+/simulation$",
"^openWB/system/device/[0-9]+/component/[0-9]+/simulation/timestamp_present$",
"^openWB/system/device/[0-9]+/component/[0-9]+/simulation/power_present$",
"^openWB/system/device/[0-9]+/component/[0-9]+/simulation/present_imported$",
"^openWB/system/device/[0-9]+/component/[0-9]+/simulation/present_exported$",
"^openWB/system/device/module_update_completed$",
"^openWB/system/boot_done$",
"^openWB/system/configurable/backup_clouds$",
"^openWB/system/configurable/chargepoints$",
"^openWB/system/configurable/chargepoints_internal$",
"^openWB/system/configurable/devices_components$",
"^openWB/system/configurable/display_themes$",
"^openWB/system/configurable/soc_modules$",
"^openWB/system/mqtt/bridge/[0-9]+$",
"^openWB/system/current_branch",
"^openWB/system/current_commit",
"^openWB/system/available_branches",
"^openWB/system/current_branch_commit",
"^openWB/system/current_commit",
"^openWB/system/current_missing_commits",
"^openWB/system/dataprotection_acknowledged$",
"^openWB/system/datastore_version"
"^openWB/system/debug_level$",
"^openWB/system/device/[0-9]+/component/[0-9]+/config$",
"^openWB/system/device/[0-9]+/component/[0-9]+/simulation$",
"^openWB/system/device/[0-9]+/component/[0-9]+/simulation/power_present$",
"^openWB/system/device/[0-9]+/component/[0-9]+/simulation/present_exported$",
"^openWB/system/device/[0-9]+/component/[0-9]+/simulation/present_imported$",
"^openWB/system/device/[0-9]+/component/[0-9]+/simulation/timestamp_present$",
"^openWB/system/device/[0-9]+/config$",
"^openWB/system/device/module_update_completed$",
"^openWB/system/ip_address$",
"^openWB/system/lastlivevaluesJson$",
"^openWB/system/messages/[0-9]+$",
"^openWB/system/mqtt/bridge/[0-9]+$",
"^openWB/system/release_train$",
"^openWB/system/update_in_progress$",
"^openWB/system/usage_terms_acknowledged$",
"^openWB/system/version$",
]
default_topic = (
("openWB/chargepoint/get/power", 0),
Expand Down
10 changes: 8 additions & 2 deletions runs/atreboot.sh
Original file line number Diff line number Diff line change
Expand Up @@ -297,8 +297,14 @@ chmod 666 "$LOGFILE"

# check for python dependencies
echo "install required python packages with 'pip3'..."
pip3 install -r "${OPENWBBASEDIR}/requirements.txt"
echo "done"
if pip3 install -r "${OPENWBBASEDIR}/requirements.txt"; then
echo "done"
else
echo "failed!"
message="Bei der Installation der benötigten Python-Bibliotheken ist ein Fehler aufgetreten! Bitte die Logdateien prüfen."
payload=$(printf '{"source": "system", "type": "danger", "message": "%s", "timestamp": %d}' "$message" "$(date +"%s")")
mosquitto_pub -p 1886 -t "openWB/system/messages/$(date +"%s%3N")" -r -m "$payload"
fi

# collect some hardware info
"${OPENWBBASEDIR}/runs/uuid.sh"
Expand Down

0 comments on commit bfccc05

Please sign in to comment.