mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-01-31 06:39:11 +00:00
HMCCU: Keep eventMap when resetting attributes
git-svn-id: https://svn.fhem.de/fhem/trunk@25138 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
0ac536d1b9
commit
45db448d78
@ -1,5 +1,6 @@
|
||||
# Add changes at the top of the list. Keep it in ASCII, and 80-char wide.
|
||||
# Do not insert empty lines here, update check depends on it.
|
||||
- bugfix: 88_HMCCU: Keep eventMap when resetting attributes
|
||||
- bugfix: 88_HMCCU: Fixed attribute room bug
|
||||
- new: 58_RPI_1Wire: Raspberry Pi 1Wire interface replacing 58_GPIO4
|
||||
- change: 73_AutoShuttersControl: change names of CommandTemplate variables,
|
||||
|
@ -57,7 +57,7 @@ my %HMCCU_CUST_CHN_DEFAULTS;
|
||||
my %HMCCU_CUST_DEV_DEFAULTS;
|
||||
|
||||
# HMCCU version
|
||||
my $HMCCU_VERSION = '5.0 213001927';
|
||||
my $HMCCU_VERSION = '5.0 213011850';
|
||||
|
||||
# Timeout for CCU requests (seconds)
|
||||
my $HMCCU_TIMEOUT_REQUEST = 4;
|
||||
@ -6642,11 +6642,9 @@ sub HMCCU_SetDefaultAttributes ($;$)
|
||||
$parRef //= { mode => 'update', role => undef, roleChn => undef };
|
||||
my $role;
|
||||
|
||||
# HMCCU_Log ($clHash, 2, HMCCU_RefToString($parRef));
|
||||
|
||||
if ($parRef->{mode} eq 'reset') {
|
||||
# List of attributes to be removed
|
||||
my @removeAttr = ('ccureadingname', 'ccuscaleval', 'eventMap', 'cmdIcon',
|
||||
my @removeAttr = ('ccureadingname', 'ccuscaleval', 'cmdIcon',
|
||||
'substitute', 'webCmd', 'widgetOverride'
|
||||
);
|
||||
|
||||
|
@ -30,7 +30,7 @@ sub HMCCUCHN_Set ($@);
|
||||
sub HMCCUCHN_Get ($@);
|
||||
sub HMCCUCHN_Attr ($@);
|
||||
|
||||
my $HMCCUCHN_VERSION = '5.0 213001927';
|
||||
my $HMCCUCHN_VERSION = '5.0 213011850';
|
||||
|
||||
######################################################################
|
||||
# Initialize module
|
||||
@ -360,12 +360,14 @@ sub HMCCUCHN_Set ($@)
|
||||
elsif ($lcopt eq 'defaults') {
|
||||
my $mode = shift @$a // 'update';
|
||||
my $rc = 0;
|
||||
my $retMsg = 'OK';
|
||||
if ($mode ne 'old') {
|
||||
$rc = HMCCU_SetDefaultAttributes ($hash, { mode => $mode, role => undef, roleChn => undef });
|
||||
$retMsg = 'Please remove HMCCU 4.3 entries from attribute eventMap' if ($rc && $mode eq 'reset' && exists($attr{$name}{eventMap}));
|
||||
}
|
||||
$rc = HMCCU_SetDefaults ($hash) if (!$rc);
|
||||
HMCCU_RefreshReadings ($hash) if ($rc);
|
||||
return HMCCU_SetError ($hash, $rc == 0 ? "No default attributes found" : "OK");
|
||||
return HMCCU_SetError ($hash, $rc == 0 ? 'No default attributes found' : $retMsg);
|
||||
}
|
||||
else {
|
||||
return "Unknown argument $opt choose one of $syntax";
|
||||
|
@ -31,7 +31,7 @@ sub HMCCUDEV_Set ($@);
|
||||
sub HMCCUDEV_Get ($@);
|
||||
sub HMCCUDEV_Attr ($@);
|
||||
|
||||
my $HMCCUDEV_VERSION = '5.0 213001927';
|
||||
my $HMCCUDEV_VERSION = '5.0 213011850';
|
||||
|
||||
######################################################################
|
||||
# Initialize module
|
||||
@ -448,12 +448,14 @@ sub HMCCUDEV_Set ($@)
|
||||
elsif ($lcopt eq 'defaults') {
|
||||
my $mode = shift @$a // 'update';
|
||||
my $rc = 0;
|
||||
my $retMsg = 'OK';
|
||||
if ($mode ne 'old') {
|
||||
$rc = HMCCU_SetDefaultAttributes ($hash, { mode => $mode, role => undef, roleChn => undef });
|
||||
$retMsg = 'Please remove HMCCU 4.3 entries from attribute eventMap' if ($rc && $mode eq 'reset' && exists($attr{$name}{eventMap}));
|
||||
}
|
||||
$rc = HMCCU_SetDefaults ($hash) if (!$rc);
|
||||
HMCCU_RefreshReadings ($hash) if ($rc);
|
||||
return HMCCU_SetError ($hash, $rc == 0 ? 'No default attributes found' : 'OK');
|
||||
return HMCCU_SetError ($hash, $rc == 0 ? 'No default attributes found' : $retMsg);
|
||||
}
|
||||
else {
|
||||
return "Unknown argument $opt choose one of $syntax";
|
||||
|
Loading…
Reference in New Issue
Block a user