72_TA_CMI_JSON: added internal NODEID_HEX

git-svn-id: https://svn.fhem.de/fhem/trunk/fhem@24054 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
delmar 2021-03-22 09:23:36 +00:00
parent 8dd39e61fb
commit 94434838f9
2 changed files with 7 additions and 5 deletions

View File

@ -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.
- feature: 72_TA_CMI_JSON: added internal NODEID_HEX
- change: 48_BlinkCamera: Support for SMS Pins in verifyPin
- feature: 72_TA_CMI_JSON: added set fixwertImpuls and setList
- feature: 72_TA_CMI_JSON: added set fixwertAnalog fixwertDigital

View File

@ -167,6 +167,10 @@ sub Define($$) {
$hash->{NODEID} = $nodeId;
$hash->{QUERYPARAM} = $queryParams;
my $hexNodeId = sprintf('%1x',$nodeId);
$hexNodeId = "0$hexNodeId" unless length($hexNodeId) == 2;
$hash->{NODEID_HEX} = $hexNodeId;
Log3 $name, 3, "TA_CMI_JSON ($name) - Define ... module=$module, CMI-URL=$cmiUrl, nodeId=$nodeId";
readingsSingleUpdate($hash, 'state', 'defined', 1);
@ -443,9 +447,7 @@ sub FixwertChangeRequest($$$$) {
my $name = $hash->{NAME};
my $nodeId = $hash->{NODEID};
my $cmiIp = $hash->{CMIURL};
my $hexNodeId = sprintf('%1x',$nodeId);
$hexNodeId = "0$hexNodeId" unless length($hexNodeId) == 2;
my $hexNodeId = $hash->{NODEID_HEX};
$index--; #1 on the Web UI is index 0. 2 is 1, etc.
my $hexIndex = sprintf('%1x',$index);
@ -507,8 +509,7 @@ sub RequestOutputStates($) {
my ($hash) = @_;
my $name = $hash->{NAME};
my $nodeId = $hash->{NODEID};
my $hexNodeId = sprintf('%1x',$nodeId);
$hexNodeId = "0$hexNodeId" unless length($hexNodeId) == 2;
my $hexNodeId = $hash->{NODEID_HEX};
my $url = "http://$hash->{CMIURL}/INCLUDE/agx2.cgi?nodex2=$hexNodeId"."&_=".gettimeofday();
my $username = AttrVal($name, 'username', 'admin');