Commit cd66c329 authored by Admin's avatar Admin
Browse files

ditched update.sh and have it in Makefile (make update);

added HomeBot icon and changed css; it's not pretty, but one
does at least see that a FHEM-fork is running;
some fixes in hobo.pl, #2
parent 04aee036
......@@ -74,6 +74,12 @@ install:
@echo " perl $(BINDIR)/$(SHORTNAME).pl $(ETCDIR)/$(SHORTNAME).cfg"
@echo
update:
git pull
sudo killall -15 perl
sudo make install
sudo perl /opt/HomeBot/hobo.pl /opt/HomeBot/hobo.cfg
dist:
mkdir .f
cp -r $(SHORTNAME).pl $(SHORTNAME).cfg CHANGED HISTORY Makefile README.SVN\
......
......@@ -39,8 +39,7 @@ HomeBot infrastructure from the OS Perl installation.
Once you have established that, your update cycle should become very easy:
git pull
./update.sh ("make update" if there is no update.sh)
make update
# Can I contribute?
......
......@@ -4358,11 +4358,10 @@ sub resolveAttrRename {
# {{{ InternalVal
sub InternalVal {
my ($d,$n,$default) = @_;
if (defined($defs{$d}) &&
defined($defs{$d}{$n})) {
return $defs{$d}{$n};
}
my ($d, $n, $default) = @_;
return $defs{$d}{$n} if (ref $defs{$d} eq 'HASH'
&& defined $defs{$d}{$n});
return $default;
}
......@@ -4370,10 +4369,24 @@ sub InternalVal {
# {{{ InternalNum
sub InternalNum {
my ($d,$n,$default,$round) = @_;
my $val = InternalVal($d,$n,$default);
$val = ($val =~ /(-?\d+(\.\d+)?)/ ? $1 : "");
$val = round($val,$round) if ($round);
my $val = InternalVal(shift, shift, shift); # get defs hash value or default
my $round = shift; # get number of rounding places
$val = ($val =~ /(-?\d+(\.\d+)?)/ ? $1 : 0); # extract number from defs value or zero
$val = round($val+0, $round) if ($round); # force numeric context and round number
# to $round decimal places (if given)
# in previous versions, $val was set to '' (empty string) if no
# number could have been matched. This would send sprintf straight
# to a warning 'Argument "" isn't numeric in sprintf', in case
# $round was set. The result of all this would still have been
# 0.0... So we set the default as 0 anyway and in excess to that
# force numeric context before sending the value to round/sprintf.
# This may lead to 'Argument "" isn't numeric in addition (+)' in
# pathological cases, but then we have catched the problem here
# and now before passing it on.
return $val;
}
......@@ -4581,6 +4594,7 @@ sub concatc {
################################################################
# {{{ readingsBeginUpdate
#
# Call readingsBeginUpdate before you start updating readings.
# The updated readings will all get the same timestamp,
......
#!/bin/bash
sudo killall -15 perl
sudo make install
sudo perl /opt/HomeBot/hobo.pl /opt/HomeBot/hobo.cfg
......@@ -2,7 +2,7 @@
body { font-size:16px;}
#logo { margin-top:10px; margin-left:20px; width:120px; height:132px;
background-image:url(../images/default/fhemicon.png); }
background-image:url(../images/default/hobo_icon.png); }
#menu { margin-top:10px; margin-left:20px; width:140px; }
#hdr { position:absolute; top:10px; left:180px; }
#content { position:absolute; top:50px; left:180px; bottom:20px; right:10px; }
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment