Skip to content

Commit

Permalink
Astroclock version bump 1.07, setup.sh line endings fixed.
Browse files Browse the repository at this point in the history
  • Loading branch information
Rob Guzikowski committed Feb 13, 2023
1 parent a73c4f5 commit 6804f18
Show file tree
Hide file tree
Showing 6 changed files with 487 additions and 20 deletions.
4 changes: 2 additions & 2 deletions apps/astroClock/.vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
"skipFiles": [
"<node_internals>/**"
],
"program": "${workspaceFolder}\\astroClock.js",
"program": "${workspaceFolder}\\astroEvent.js",
"env":{"DEV_TARGET":"192.168.10.202"},
"args": ["20","3"],
"args": ["2023","2", "13", "59.9454", "10.7892", "Europe/Oslo"],
}
]
}
2 changes: 1 addition & 1 deletion apps/astroClock/astroClock deploy/setup.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash
# Adds the Astto clock internal device to the SmartServer. Run as root
echo "AstroClock device installer"
echo "AstroClock device installer 1.07"
APP_DIR="$APOLLO_DATA/apps"
A_SETUP="astroClock"
PWD=$1
Expand Down
2 changes: 1 addition & 1 deletion apps/astroClock/astroClock.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const { time, timeStamp } = require('console');
// 07/30/2022 - 1.00.006 - Now using suncalc.js to align with the Scheduler astro position module


const version = '1.00.006';
const version = '1.00.007';
const scheduleTm = 60000; // 00:01
let args = process.argv.slice(2);
let startupPause = 180;
Expand Down
16 changes: 9 additions & 7 deletions apps/astroClock/astroEvent.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const { createCipheriv } = require('crypto');
const moment = require('moment-timezone');

let hostIp = '127.0.0.1';
//let hostIp = '192.168.10.204';
//let hostIp = '10.100.16.213';
let year=1970;
let month=0; // 0 based, Jan = 0
let day=1
Expand All @@ -28,12 +28,14 @@ if (args.length >= 3) {
lat = parseFloat(args[3]);
lng = parseFloat(args[4]);
zone = args[5];
console.log('Blocking reboots and disabling ntp to set the clock');
execSync('block_reboot',{encoding:'utf-8'});
execSync(`timedatectl set-timezone ${zone}`,{encoding:'utf-8'});
execSync('timedatectl set-ntp false',{encoding:'utf-8'});
execSync(`timedatectl set-time \"${year}-${month+1}-${day} 03:01:00\"`,{encoding:'utf-8'});
console.log('*** Remember to run: sudo timedatectl set-ntp true and to enable reboots: unblock_reboot ***');
if (process.platform == 'linux') {
console.log('Blocking reboots and disabling ntp to set the clock');
execSync('block_reboot',{encoding:'utf-8'});
execSync(`timedatectl set-timezone ${zone}`,{encoding:'utf-8'});
execSync('timedatectl set-ntp false',{encoding:'utf-8'});
execSync(`timedatectl set-time \"${year}-${month+1}-${day} 03:01:00\"`,{encoding:'utf-8'});
console.log('*** Remember to run: sudo timedatectl set-ntp true and to enable reboots: unblock_reboot ***');
}
updateCfgTz=true;
}

Expand Down
Loading

0 comments on commit 6804f18

Please sign in to comment.