2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-03-10 09:16:53 +00:00

93_DbRep: contrib 8.31.0

git-svn-id: https://svn.fhem.de/fhem/trunk@21067 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
nasseeder1 2020-01-28 21:10:55 +00:00
parent 6e0d141f62
commit 195601ddc6

View File

@ -774,6 +774,9 @@ sub DbRep_Set($@) {
if (!AttrVal($hash->{NAME}, "reading", "")) { if (!AttrVal($hash->{NAME}, "reading", "")) {
return " The attribute reading to analyze is not set !"; return " The attribute reading to analyze is not set !";
} }
if ($prop =~ /deleteOther/ && !AttrVal($hash->{NAME}, "allowDeletion", 0)) {
return " Set attribute 'allowDeletion' if you want to allow deletion of any database entries. Use it with care !";
}
if ($prop && $prop =~ /writeToDB/) { if ($prop && $prop =~ /writeToDB/) {
if (!AttrVal($hash->{NAME}, "device", "") || AttrVal($hash->{NAME}, "device", "") =~ /[%*:=,]/ || AttrVal($hash->{NAME}, "reading", "") =~ /[,\s]/) { if (!AttrVal($hash->{NAME}, "device", "") || AttrVal($hash->{NAME}, "device", "") =~ /[%*:=,]/ || AttrVal($hash->{NAME}, "reading", "") =~ /[,\s]/) {
return "<html>If you want write results back to database, attributes \"device\" and \"reading\" must be set.<br> return "<html>If you want write results back to database, attributes \"device\" and \"reading\" must be set.<br>