20 Commits

Author SHA1 Message Date
aa04b75e41
Adjustments to wecker.sh script:
- Reordered the iobroker state set commands to set colortemp at the end for better consistency.
- Removed unnecessary ping test in the check_ip function.
- Cleaned up the check_notification function, removed unnecessary echo statements.
- Adjusted the sleep time in the check_notification function to 5 seconds.
- Updated comments and removed unnecessary comments for clarity.
- Minor formatting improvements for better readability.
- Added missing code in the color change loop, now it changes colors as intended. (hopefully)
- Removed redundant comments at the end of the script.

These changes enhance the script's clarity, remove unnecessary code, and ensure proper functionality.
2023-12-28 21:51:20 +01:00
8c3bfed83f
Fix syntax error in check_ip function and handle unsuccessful attempts. Update wecker.sh: Fix syntax error in 'for' loop 2023-12-27 12:47:55 +01:00
dde161ae61
Improve IP resolution and add retry mechanism
- Modified the IP resolution process to allow for multiple attempts with a specified interval.
- Added a retry mechanism to check the IP address multiple times before considering it unsuccessful.
- If the target IP cannot be found after the specified number of attempts, an error message is displayed.
- Updated the SSH command to run the alarm script in the background.
2023-12-26 17:01:34 +01:00
5f7abef59d
Improve IP resolution and add retry mechanism
- Modified the IP resolution process to allow for multiple attempts with a specified interval.
- Added a retry mechanism to check the IP address multiple times before considering it unsuccessful.
- If the target IP cannot be found after the specified number of attempts, an error message is displayed.
- Updated the SSH command to run the alarm script in the background.
2023-12-22 17:51:48 +01:00
4761bfea0f
Refactor Wecker Script for Improved Readability and Functionality
- Combined IP retrieval and ping test into a single function 'check_ip'.
- Improved error handling for better script robustness.
- Removed unnecessary commented-out code and added comments for clarity.
- Ensured consistency in indentation and formatting.

Author: Michael, Haider
Date: 22.12.2023
2023-12-22 15:07:05 +01:00
11ae8bfaf6
Update MAC address in check_ip function
Changed the MAC address in the check_ip function to '1e:46:8c'.
2023-12-22 10:07:40 +01:00
c5d7167bb1
Keep only the next 'at'-job and delete all future jobs in A72_alarm_getter.sh
Modified delete_expired_at_jobs function to retain only the next 'at'-job and delete all upcoming jobs. This ensures that only the immediate 'at'-job remains scheduled.
2023-12-22 09:42:28 +01:00
76d38622c6
Aktualisiere IP-Adressen in A72_alarm_getter.sh und wecker.sh:
- Ändere die MAC-Adresse in beiden Skripten auf '18🆎1d' für die Funktion check_ip.
2023-12-22 09:09:17 +01:00
5bb790bb3b
Aktualisiere Wecker-Script:
- Geänderte Mac-Adresse für die Funktion check_ip.
- Verwende 'arp-scan' für die IP-Ermittlung.
- Verbesserte Ausgabe und Wartezeit in der Funktion check_notification.
- Start des Alarm-Scripts auf dem Handy mit protokollierter Ausgabe.
2023-12-22 08:05:08 +01:00
43564c52ac
Verbesserungen am Wecker-Script:
- Geänderte Mac-Adresse für Lisas iPhone in check_ip-Funktion.
- Verbesserte Ausgabe und Wartezeit in der check_notification-Funktion.
- Angepasste Schritte und Dauer für die Helligkeits- und Farbtemperaturanpassung.
- Start des Alarm-Scripts auf dem Handy ohne protokollierte Ausgabe.
2023-12-19 17:16:47 +01:00
2d15fe099c
Anpassungen am Wecker-Script:
- Geänderte Mac-Adresse für Lisas iPhone in check_ip-Funktion.
- Verbesserte Ausgabe in der check_notification-Funktion.
- Angepasste Schritte und Dauer für die Helligkeits- und Farbtemperaturanpassung.
- Start des Alarm-Scripts auf dem Handy mit protokollierter Ausgabe.
2023-12-18 12:56:31 +01:00
b95e0627dc
Update wecker.sh script
- Adjusted the 'check_notification' function to execute the SSH command within a timeout.
- Modified the logging of wecker.sh start and end times for better monitoring.

Changes:
- Modified line 41 in wecker.sh to execute the SSH command within a timeout for 'check_notification' function
  from:
  output=                [0] "Beenden" -> PendingIntent{cb58c43: PendingIntentRecord{9bf5dfe com.urbandroid.sleep startActivity (allowlist: 27215bc:+30s0ms/0/NOTIFICATION_SERVICE/NotificationManagerService)}}
  to:
  output=Timeout

- Added date and echo statements to log the start and end times in 'check_notification' function.

- Moved the 'ssh root@  '/data/scripts/morning-alarm.sh'' line to the end of the script to trigger the morning alarm.

Author: Michael Haider
Date: 17.12.2023
2023-12-17 21:53:26 +01:00
2ce472fa08
Funktion: prüfen ob Wecker am Handy aus, gefixt 2023-11-28 08:32:25 +01:00
e5a4a74da5
Enable light in check_ip function 2023-11-25 11:15:26 +01:00
96e857a4cf
Commit: Fix check_notification condition and add check_external_light_status
1. Added a new function `check_external_light_status` to check if the light is turned off externally.

2. Modified the condition in the `check_notification` function to correctly check if the notification contains "[1]" and the specified strings.

3. Corrected the assignment statement inside the `while` loop. Changed `first_brightness_cmason.nvimhange=false` to `first_brightness_change=false`.
2023-11-25 09:58:53 +01:00
fcc070e03d
Gefixt: schritte wurden nicht reichtig berechnet 2023-11-25 07:15:55 +01:00
16bf50bbb3
Check, ob Wecker am handy beendet wurde, wird nun erst ab dem Farbwechsel durchgeführt. 2023-11-25 06:53:50 +01:00
8a9dea2d71
Funktion zum licht ausschalten, wenn wecker am handy beendet 2023-11-22 12:27:46 +01:00
94dee024a4
wecker.sh checkt ip von a72 2023-11-19 18:45:14 +01:00
c34f28302e
initial commit 2023-11-16 09:17:08 +01:00