mirror of
https://github.com/aljazceru/addons.git
synced 2026-02-09 23:24:20 +01:00
Sync time of RF Daemon every 30min (#425)
* sync homematic time periodically * Show "Run SetInterfaceClock" in log file * signal handler added * version incremented * Update CHANGELOG.md
This commit is contained in:
@@ -1,5 +1,8 @@
|
||||
# Changelog
|
||||
|
||||
## 3
|
||||
- Add periodically time sync
|
||||
|
||||
## 2
|
||||
- Fix wrong Timezone
|
||||
- Update OCCU to 3.37.8
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "HomeMatic OCCU",
|
||||
"version": "2",
|
||||
"version": "3",
|
||||
"slug": "homematic",
|
||||
"description": "HomeMatic central based on OCCU",
|
||||
"url": "https://home-assistant.io/addons/homematic/",
|
||||
|
||||
@@ -75,5 +75,24 @@ if [ "$WIRED_ENABLE" == "true" ]; then
|
||||
WAIT_PIDS+=($!)
|
||||
fi
|
||||
|
||||
# Register stop
|
||||
function stop_homematic() {
|
||||
echo "Kill Processes..."
|
||||
kill -15 "${WAIT_PIDS[@]}"
|
||||
wait "${WAIT_PIDS[@]}"
|
||||
echo "Done."
|
||||
}
|
||||
trap "stop_homematic" SIGTERM SIGHUP
|
||||
|
||||
# sync time periodically
|
||||
if [ "$RF_ENABLE" == "true" ]; then
|
||||
while true
|
||||
do
|
||||
sleep 30m
|
||||
echo "$(date '+%Y-%m-%d %H:%M:%S.%3N') Run SetInterfaceClock now."
|
||||
"$HM_HOME/bin/SetInterfaceClock" 127.0.0.1:2001
|
||||
done
|
||||
fi
|
||||
|
||||
# Wait until all is done
|
||||
wait "${WAIT_PIDS[@]}"
|
||||
|
||||
Reference in New Issue
Block a user