mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-02-28 02:44:53 +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.
|
# 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.
|
# 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
|
- bugfix: 88_HMCCU: Fixed attribute room bug
|
||||||
- new: 58_RPI_1Wire: Raspberry Pi 1Wire interface replacing 58_GPIO4
|
- new: 58_RPI_1Wire: Raspberry Pi 1Wire interface replacing 58_GPIO4
|
||||||
- change: 73_AutoShuttersControl: change names of CommandTemplate variables,
|
- change: 73_AutoShuttersControl: change names of CommandTemplate variables,
|
||||||
|
@ -57,7 +57,7 @@ my %HMCCU_CUST_CHN_DEFAULTS;
|
|||||||
my %HMCCU_CUST_DEV_DEFAULTS;
|
my %HMCCU_CUST_DEV_DEFAULTS;
|
||||||
|
|
||||||
# HMCCU version
|
# HMCCU version
|
||||||
my $HMCCU_VERSION = '5.0 213001927';
|
my $HMCCU_VERSION = '5.0 213011850';
|
||||||
|
|
||||||
# Timeout for CCU requests (seconds)
|
# Timeout for CCU requests (seconds)
|
||||||
my $HMCCU_TIMEOUT_REQUEST = 4;
|
my $HMCCU_TIMEOUT_REQUEST = 4;
|
||||||
@ -6642,11 +6642,9 @@ sub HMCCU_SetDefaultAttributes ($;$)
|
|||||||
$parRef //= { mode => 'update', role => undef, roleChn => undef };
|
$parRef //= { mode => 'update', role => undef, roleChn => undef };
|
||||||
my $role;
|
my $role;
|
||||||
|
|
||||||
# HMCCU_Log ($clHash, 2, HMCCU_RefToString($parRef));
|
|
||||||
|
|
||||||
if ($parRef->{mode} eq 'reset') {
|
if ($parRef->{mode} eq 'reset') {
|
||||||
# List of attributes to be removed
|
# List of attributes to be removed
|
||||||
my @removeAttr = ('ccureadingname', 'ccuscaleval', 'eventMap', 'cmdIcon',
|
my @removeAttr = ('ccureadingname', 'ccuscaleval', 'cmdIcon',
|
||||||
'substitute', 'webCmd', 'widgetOverride'
|
'substitute', 'webCmd', 'widgetOverride'
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -30,7 +30,7 @@ sub HMCCUCHN_Set ($@);
|
|||||||
sub HMCCUCHN_Get ($@);
|
sub HMCCUCHN_Get ($@);
|
||||||
sub HMCCUCHN_Attr ($@);
|
sub HMCCUCHN_Attr ($@);
|
||||||
|
|
||||||
my $HMCCUCHN_VERSION = '5.0 213001927';
|
my $HMCCUCHN_VERSION = '5.0 213011850';
|
||||||
|
|
||||||
######################################################################
|
######################################################################
|
||||||
# Initialize module
|
# Initialize module
|
||||||
@ -360,12 +360,14 @@ sub HMCCUCHN_Set ($@)
|
|||||||
elsif ($lcopt eq 'defaults') {
|
elsif ($lcopt eq 'defaults') {
|
||||||
my $mode = shift @$a // 'update';
|
my $mode = shift @$a // 'update';
|
||||||
my $rc = 0;
|
my $rc = 0;
|
||||||
|
my $retMsg = 'OK';
|
||||||
if ($mode ne 'old') {
|
if ($mode ne 'old') {
|
||||||
$rc = HMCCU_SetDefaultAttributes ($hash, { mode => $mode, role => undef, roleChn => undef });
|
$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);
|
$rc = HMCCU_SetDefaults ($hash) if (!$rc);
|
||||||
HMCCU_RefreshReadings ($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 {
|
else {
|
||||||
return "Unknown argument $opt choose one of $syntax";
|
return "Unknown argument $opt choose one of $syntax";
|
||||||
|
@ -31,7 +31,7 @@ sub HMCCUDEV_Set ($@);
|
|||||||
sub HMCCUDEV_Get ($@);
|
sub HMCCUDEV_Get ($@);
|
||||||
sub HMCCUDEV_Attr ($@);
|
sub HMCCUDEV_Attr ($@);
|
||||||
|
|
||||||
my $HMCCUDEV_VERSION = '5.0 213001927';
|
my $HMCCUDEV_VERSION = '5.0 213011850';
|
||||||
|
|
||||||
######################################################################
|
######################################################################
|
||||||
# Initialize module
|
# Initialize module
|
||||||
@ -448,12 +448,14 @@ sub HMCCUDEV_Set ($@)
|
|||||||
elsif ($lcopt eq 'defaults') {
|
elsif ($lcopt eq 'defaults') {
|
||||||
my $mode = shift @$a // 'update';
|
my $mode = shift @$a // 'update';
|
||||||
my $rc = 0;
|
my $rc = 0;
|
||||||
|
my $retMsg = 'OK';
|
||||||
if ($mode ne 'old') {
|
if ($mode ne 'old') {
|
||||||
$rc = HMCCU_SetDefaultAttributes ($hash, { mode => $mode, role => undef, roleChn => undef });
|
$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);
|
$rc = HMCCU_SetDefaults ($hash) if (!$rc);
|
||||||
HMCCU_RefreshReadings ($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 {
|
else {
|
||||||
return "Unknown argument $opt choose one of $syntax";
|
return "Unknown argument $opt choose one of $syntax";
|
||||||
|
Loading…
x
Reference in New Issue
Block a user