2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-03-13 17:26:34 +00:00

altitude added

git-svn-id: https://svn.fhem.de/fhem/trunk@3480 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig 2013-07-23 06:03:39 +00:00
parent f45d256560
commit 821b9bf536
3 changed files with 38 additions and 87 deletions

View File

@ -451,7 +451,8 @@ isday</pre>
<b>Get</b> <ul>N/A</ul><br> <b>Get</b> <ul>N/A</ul><br>
<b>Attributes</b> <ul> <b>Attributes</b><br>
<ul>
<a name="latitude"></a> <a name="latitude"></a>
<li>latitude<br> <li>latitude<br>
If set, this latitude is used to calculate sunset/sunrise<br> If set, this latitude is used to calculate sunset/sunrise<br>
@ -464,6 +465,10 @@ isday</pre>
Notation need to be in decimal format (for example Berlin = 13.400) Notation need to be in decimal format (for example Berlin = 13.400)
As default Frankfurt/Main, Germany (8.686) is used. As default Frankfurt/Main, Germany (8.686) is used.
</li><br> </li><br>
<a name="altitude"></a>
<li>altitude<br>
Used by other modules.
</li><br>
Note: these are global attributes, e.g.<br> Note: these are global attributes, e.g.<br>
<ul> <ul>
attr global latitude 50.112<br> attr global latitude 50.112<br>

View File

@ -4,6 +4,8 @@
# This is quite a big mess here. # This is quite a big mess here.
use IO::File; use IO::File;
use strict;
use warnings;
# Server-Side script to check out the fhem SVN repository, and upload the # Server-Side script to check out the fhem SVN repository, and upload the
# changed files to the server # changed files to the server
@ -13,89 +15,17 @@ $ENV{CVS_RSH}="/usr/bin/ssh";
print "\n\n"; print "\n\n";
print localtime() . "\n"; print localtime() . "\n";
#my $homedir="/Users/rudi/Projects/fhem/fhemupdate";
my $homedir="/home/rudi/fhemupdate"; my $homedir="/home/rudi/fhemupdate";
#goto NEWSTYLE;
chdir("$homedir/culfw"); chdir("$homedir/culfw");
system("svn update ."); system("svn update .");
chdir("$homedir/fhem"); chdir("$homedir/fhem");
system("mkdir -p fhemupdate");
system("svn update ."); system("svn update .");
die "SVN failed, exiting\n" if($?); die "SVN failed, exiting\n" if($?);
`../copyfiles.sh`; `../copyfiles.sh`;
#################################
# Old style
my @filelist = (
"./fhem.pl.txt",
"FHEM/.*.pm",
"FHEM/FhemUtils/.*.pm",
"FHEM/lib/.*.pm",
"www/gplot/.*.gplot",
"www/images/dark/.*.png",
"www/images/default/.*.png",
"www/images/smallscreen/.*.png",
"www/pgm2/.*\.(js|css|svg)",
"docs/commandref(_..)?.html",
"docs/faq(_..)?.html",
"docs/HOWTO(_..)?.html",
"docs/fhem.*.png",
"docs/.*.jpg",
"../culfw/Devices/CUL/.*.hex",
"./CHANGED",
);
# Read in the file timestamps
my %filetime;
my %filesize;
my %filedir;
foreach my $fspec (@filelist) {
$fspec =~ m,^(.+)/([^/]+)$,;
my ($dir,$pattern) = ($1, $2);
opendir DH, $dir || die("Can't open $dir: $!\n");
foreach my $file (grep { /$pattern/ && -f "$dir/$_" } readdir(DH)) {
my @st = stat("$dir/$file");
my @mt = localtime($st[9]);
$filetime{$file} = sprintf "%04d-%02d-%02d_%02d:%02d:%02d",
$mt[5]+1900, $mt[4]+1, $mt[3], $mt[2], $mt[1], $mt[0];
$filesize{$file} = $st[7];
$filedir{$file} = $dir;
}
closedir(DH);
}
my %oldtime;
if(open FH, "fhemupdate/filetimes.txt") {
while(my $l = <FH>) {
chomp($l);
my ($ts, $fs, $file) = split(" ", $l, 3);
$oldtime{"$file.txt"} = $ts if($file eq "fhem.pl");
$oldtime{$file} = $ts;
}
close(FH);
}
chdir("$homedir/fhem/fhemupdate");
open FH, ">filetimes.txt" || die "Can't open filetimes.txt: $!\n";
my $cnt;
foreach my $f (sort keys %filetime) {
my $fn = $f;
$fn =~ s/.txt$// if($fn =~ m/.pl.txt$/);
print FH "$filetime{$f} $filesize{$f} $fn\n";
my $newfname = $f;
if(!$oldtime{$f} || $oldtime{$f} ne $filetime{$f}) {
system("cp ../$filedir{$f}/$f $f");
$cnt++;
}
}
close FH;
NEWSTYLE:
for(my $loop = 0; $loop < 2; $loop++) { for(my $loop = 0; $loop < 2; $loop++) {
################################# #################################
# new Style # new Style
@ -108,17 +38,31 @@ for(my $loop = 0; $loop < 2; $loop++) {
"./CHANGED" => { type=>",fhem,", dir=>"." }, "./CHANGED" => { type=>",fhem,", dir=>"." },
"FHEM/.*.pm" => { type=>",fhem,", dir=>"FHEM" }, "FHEM/.*.pm" => { type=>",fhem,", dir=>"FHEM" },
"FHEM/FhemUtils/.*.pm" => { type=>",fhem,", dir=>"FHEM/FhemUtils"}, "FHEM/FhemUtils/.*.pm" => { type=>",fhem,", dir=>"FHEM/FhemUtils"},
"FHEM/FhemUtils/update-.*", => { type=>",fhem,", dir=>"FHEM/FhemUtils"},
"FHEM/lib/.*.pm" => { type=>",fhem,", dir=>"FHEM/lib"}, "FHEM/lib/.*.pm" => { type=>",fhem,", dir=>"FHEM/lib"},
"FHEM/lib/SWAP/.*.xml" => { type=>",fhem,", dir=>"FHEM/lib/SWAP"},
"FHEM/lib/SWAP/panStamp/.*" => { type=>",fhem,", dir=>"FHEM/lib/SWAP/panStamp"},
"FHEM/lib/SWAP/justme/.*" => { type=>",fhem,", dir=>"FHEM/lib/SWAP/justme"},
"FHEM/lib/Device/.*.pm" => { type=>",fhem,", dir=>"FHEM/lib/Device"},
"FHEM/lib/Device/Firmata/.*.pm"=>{ type=>",fhem,", dir=>"FHEM/lib/Device/Firmata"},
"../culfw/Devices/CUL/.*.hex" => { type=>",fhem,", dir=>"FHEM", "../culfw/Devices/CUL/.*.hex" => { type=>",fhem,", dir=>"FHEM",
dir3=>"FHEM", }, dir3=>"FHEM", },
"www/pgm2/.*" => { type=>"fhem,", dir=>"www/pgm2"}, "www/pgm2/.*" => { type=>"fhem,", dir=>"www/pgm2"},
"www/jscolor/.*" => { type=>"fhem,", dir=>"www/pgm2"},
"www/gplot/.*.gplot" => { type=>"fhem,", dir=>"www/pgm2"}, "www/gplot/.*.gplot" => { type=>"fhem,", dir=>"www/pgm2"},
"www/images/dark/.*.png" => { type=>"fhem,", dir=>"www/pgm2"}, "www/images/dark/.*.png" => { type=>"fhem,", dir=>"www/pgm2"},
"www/images/bright/.*.png" => { type=>"fhem,", dir=>"www/pgm2"},
"www/images/bright/.*.png" => { type=>"fhem,", dir=>"www/pgm2"},
"www/images/fhemSVG/.*.svg" => { type=>"fhem,", dir=>"www/pgm2"},
"www/images/openautomation/.*.svg" => { type=>"fhem,", dir=>"www/pgm2"},
"www/images/openautomation/.*.txt" => { type=>"fhem,", dir=>"www/pgm2"},
"www/images/darktouchpad/.*.png" => { type=>"fhem,", dir=>"www/pgm2"},
"www/images/default/.*" => { type=>"fhem,", dir=>"www/pgm2"}, "www/images/default/.*" => { type=>"fhem,", dir=>"www/pgm2"},
"www/images/default/remotecontrol/.*" => { type=>"fhem,", dir=>"www/pgm2"},
"www/images/smallscreen/.*" => { type=>"fhem,", dir=>"www/pgm2"}, "www/images/smallscreen/.*" => { type=>"fhem,", dir=>"www/pgm2"},
"docs/commandref(_..)?.html" => { type=>"fhem,", dir=>"www/pgm2"}, "docs/commandref(_..)?.html" => { type=>"fhem,", dir=>"www/pgm2"},
"docs/faq(_..)?.html" => { type=>"fhem,", dir=>"www/pgm2"}, "docs/faq(_..)?.html" => { type=>"fhem,", dir=>"www/pgm2"},
"docs/HOWTO(_..)?.html" => { type=>"fhem,", dir=>"www/pgm2"}, "docs/HOWTO(_..)?.html" => { type=>"fhem,", dir=>"www/pgm2"},
"docs/fhem.*.png" => { type=>"fhem,", dir=>"www/pgm2"}, "docs/fhem.*.png" => { type=>"fhem,", dir=>"www/pgm2"},
"docs/.*.jpg" => { type=>"fhem,", dir=>"www/pgm2"}, "docs/.*.jpg" => { type=>"fhem,", dir=>"www/pgm2"},
); );
@ -210,21 +154,23 @@ chdir("$homedir/fhem");
if(0) { if(0) {
my $fname="controls_fhem.txt"; my $fname="controls_fhem.txt";
`cp fhemupdate4/$fname fhemupdate`;
`cp fhemupdate4/$fname fhemupdate2/FHEM`;
`rm fhemupdate2/$fname`;
my @st = stat("fhemupdate4/$fname"); my @st = stat("fhemupdate4/$fname");
my @mt = localtime($st[9]); my @mt = localtime($st[9]);
my $ftime = sprintf "%04d-%02d-%02d_%02d:%02d:%02d", my $ftime = sprintf "%04d-%02d-%02d_%02d:%02d:%02d",
$mt[5]+1900, $mt[4]+1, $mt[3], $mt[2], $mt[1], $mt[0]; $mt[5]+1900, $mt[4]+1, $mt[3], $mt[2], $mt[1], $mt[0];
my $fsize = $st[7]; my $fsize = $st[7];
system("echo $ftime $fsize $fname >> fhemupdate/filetimes.txt");
system("echo $ftime $fsize FHEM/$fname >> fhemupdate2/filetimes.txt");
} }
my $rsyncopts="-a --delete --compress --verbose"; my $rsyncopts="-a --delete --compress --verbose";
system("rsync $rsyncopts fhemupdate fhem.de:fhem");
system("rsync $rsyncopts fhemupdate2 fhem.de:fhem");
system("rsync $rsyncopts fhemupdate4/. fhem.de:fhem/fhemupdate4/svn"); system("rsync $rsyncopts fhemupdate4/. fhem.de:fhem/fhemupdate4/svn");
system("scp docs/commandref.html docs/commandref_DE.html fhem.de:fhem"); if(-f "commandref_changed") {
system("scp CHANGED fhem.de:fhem"); system("scp docs/commandref.html docs/commandref_DE.html fhem.de:fhem");
}
system("scp CHANGED MAINTAINER.txt fhem.de:fhem");
system("scp fhem.de:fhem/stats/data/fhem_statistics_db.sqlite ..");
chdir("$homedir");
system("sh mksvnlog.sh > SVNLOG");
system("scp SVNLOG fhem.de:fhem");
system("sourceforge/dorsync");

View File

@ -195,7 +195,7 @@ my $namedef =
"- a regexp, if it contains one of the following characters: *[]^\$\n" . "- a regexp, if it contains one of the following characters: *[]^\$\n" .
"- a range separated by dash (-)\n"; "- a range separated by dash (-)\n";
my @cmdList; # Remaining commands in a chain. Used by sleep my @cmdList; # Remaining commands in a chain. Used by sleep
my $evalSpecials; # Used by EvalSpecials->AnalyzeCommand parameter passing my $evalSpecials; # Used by EvalSpecials->AnalyzeCommand parameter passing
$init_done = 0; $init_done = 0;
@ -205,7 +205,7 @@ $modules{Global}{AttrList} =
"archivecmd apiversion archivedir configfile lastinclude logfile " . "archivecmd apiversion archivedir configfile lastinclude logfile " .
"modpath nrarchive pidfilename port statefile title userattr " . "modpath nrarchive pidfilename port statefile title userattr " .
"verbose:1,2,3,4,5 mseclog:1,0 version nofork:1,0 logdir holiday2we " . "verbose:1,2,3,4,5 mseclog:1,0 version nofork:1,0 logdir holiday2we " .
"autoload_undefined_devices:1,0 dupTimeout latitude longitude " . "autoload_undefined_devices:1,0 dupTimeout latitude longitude altitude" .
"backupcmd backupdir backupsymlink backup_before_update " . "backupcmd backupdir backupsymlink backup_before_update " .
"exclude_from_update motd updatebranch uniqueID ". "exclude_from_update motd updatebranch uniqueID ".
"sendStatistics:onUpdate,manually,never updateInBackground:1,0 ". "sendStatistics:onUpdate,manually,never updateInBackground:1,0 ".