mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-03-10 03:06:37 +00:00
added uncached readings for OWDevice, missing "payload" fixed in OWServer
git-svn-id: https://svn.fhem.de/fhem/trunk@2517 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
222028a0a5
commit
ae180ffd0a
@ -50,6 +50,11 @@
|
||||
- feature: new readingsFn modules: FS20 CUL_WS HMS CUL_EM CUL_TX EnOcean ZWave
|
||||
- feature: telnet client mode
|
||||
- bugfix: FHEMWEB longpoll misses initial state change (HM: set_on vs. on)
|
||||
- change: 20_OWFS.pm, 21_OWTEMP modules flagged as "deprecated". These
|
||||
modules will be removed in a future release. Use OWServer / OWDevice
|
||||
instead. (M. Fischer)
|
||||
- feature: a lot of new features and known 1-wire slaves to OWServer /
|
||||
OWDevice added (M. Fischer)
|
||||
|
||||
- 2012-10-28 (5.3)
|
||||
- feature: added functions trim, ltrim, rtrim, UntoggleDirect,
|
||||
|
@ -266,6 +266,7 @@ OWServer_Dir($@)
|
||||
my ($hash,$path)= @_;
|
||||
|
||||
return undef unless(defined($hash->{fhem}{owserver}));
|
||||
$path= ($path) ? $path : "/";
|
||||
return $hash->{fhem}{owserver}->dir($path);
|
||||
}
|
||||
|
||||
@ -302,7 +303,7 @@ OWServer_Autocreate($)
|
||||
|
||||
my $owserver= $hash->{fhem}{owserver};
|
||||
|
||||
my @dir= split(",", $owserver->dir());
|
||||
my @dir= split(",", $owserver->dir("/"));
|
||||
my @devices= grep { m/^\/[0-9a-f]{2}.[0-9a-f]{12}$/i } @dir;
|
||||
|
||||
my @defined = ();
|
||||
@ -375,7 +376,7 @@ OWServer_Get($@)
|
||||
my $owserver= $hash->{fhem}{owserver};
|
||||
|
||||
if($cmd eq "devices") {
|
||||
my @dir= split(",", $owserver->dir());
|
||||
my @dir= split(",", $owserver->dir("/"));
|
||||
my @devices= grep { m/^\/[0-9a-f]{2}.[0-9a-f]{12}$/i } @dir;
|
||||
my $ret;
|
||||
for my $device (@devices) {
|
||||
|
@ -349,7 +349,7 @@ OWDevice_Initialize($)
|
||||
$hash->{UndefFn} = "OWDevice_Undef";
|
||||
$hash->{AttrFn} = "OWDevice_Attr";
|
||||
|
||||
$hash->{AttrList} = "IODev trimvalues polls interfaces model loglevel:0,1,2,3,4,5 ".
|
||||
$hash->{AttrList} = "IODev uncached trimvalues polls interfaces model loglevel:0,1,2,3,4,5 ".
|
||||
$readingFnAttributes;
|
||||
}
|
||||
|
||||
@ -401,6 +401,7 @@ OWDevice_ReadFromServer($$@)
|
||||
no strict "refs";
|
||||
my $ret;
|
||||
if($cmd eq "read") {
|
||||
unshift(@a,$dev);
|
||||
$ret = &{$modules{$iohash->{TYPE}}{ReadFn}}($iohash, @a);
|
||||
}
|
||||
if($cmd eq "dir") {
|
||||
@ -421,7 +422,8 @@ OWDevice_ReadValue($$) {
|
||||
|
||||
my $address= $hash->{fhem}{address};
|
||||
my $interface= $hash->{fhem}{interfaces};
|
||||
my $value= OWDevice_ReadFromServer($hash,"read","/$address/$reading");
|
||||
my $cache= (AttrVal($hash->{NAME},"uncached","")) ? "/uncached" : "";
|
||||
my $value= OWDevice_ReadFromServer($hash,"read","$cache/$address/$reading");
|
||||
#Debug "/$address/$reading => $value";
|
||||
if($interface ne "id") {
|
||||
if(defined($value)) {
|
||||
@ -468,7 +470,7 @@ OWDevice_UpdateValues($) {
|
||||
}
|
||||
if(@state) {
|
||||
foreach my $reading (@state) {
|
||||
my $value= OWDevice_ReadValue($hash,$reading);
|
||||
my $value= ReadingsVal($hash->{NAME},$reading,undef);
|
||||
if(defined($value)) {
|
||||
$state .= "$reading: $value ";
|
||||
} else {
|
||||
|
Loading…
x
Reference in New Issue
Block a user