Skip to content

Commit

Permalink
Intertechno Fix adress
Browse files Browse the repository at this point in the history
  • Loading branch information
Wolbolar committed Oct 15, 2018
1 parent 33d1ec4 commit 2aee15c
Show file tree
Hide file tree
Showing 11 changed files with 4,070 additions and 4,030 deletions.
18 changes: 12 additions & 6 deletions AIO Device Import/module.php
Original file line number Diff line number Diff line change
Expand Up @@ -905,10 +905,13 @@ protected function ITImportCreator($CategoryID)
$ITType = ucfirst($ITType); //erster Buchstabe groß
if($lengthaddress == 3) // alter Code aus Buchstaben und Ziffer
{
$ITDeviceCode = strval($address[1]+1); // Devicecode auf Original umrechen +1
$ITDeviceCode_import = strval($address[1]);
$ITDeviceCode_dec = hexdec($ITDeviceCode_import);
$ITDeviceCode = strval($ITDeviceCode_dec+1); // Devicecode auf Original umrechen +1
$ITFamilyCode = $address[0]; // Zahlencode in Buchstaben Familencode umwandeln
$hexsend = array("0", "1", "2", "3", "4", "5", "6", "7", "8", "9");
$itfc = array("A", "B", "C", "D", "E", "F", "G", "H", "I", "J");
$hexsend = array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23);
$itfc = array("A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W");
$ITFamilyCode = hexdec($ITFamilyCode);
$ITFamilyCode = str_replace($hexsend, $itfc, $ITFamilyCode);
}
elseif($lengthaddress == 9) //neuer Code
Expand Down Expand Up @@ -1358,10 +1361,13 @@ protected function NEOJSONImport($devicetype, $directory, $CategoryID, $subtype)
$Ident = $ITType."_".$identaddress;
if($lengthaddress == 3) // alter Code aus Buchstaben und Ziffer
{
$ITDeviceCode = strval($address[1]+1); // Devicecode auf Original umrechen +1
$ITDeviceCode_import = strval($address[1]);
$ITDeviceCode_dec = hexdec($ITDeviceCode_import);
$ITDeviceCode = strval($ITDeviceCode_dec+1); // Devicecode auf Original umrechen +1
$ITFamilyCode = $address[0]; // Zahlencode in Buchstaben Familencode umwandeln
$hexsend = array("0", "1", "2", "3", "4", "5", "6", "7", "8", "9");
$itfc = array("A", "B", "C", "D", "E", "F", "G", "H", "I", "J");
$hexsend = array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23);
$itfc = array("A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W");
$ITFamilyCode = hexdec($ITFamilyCode);
$ITFamilyCode = str_replace($hexsend, $itfc, $ITFamilyCode);
}
elseif($lengthaddress == 9) //neuer Code
Expand Down
Loading

0 comments on commit 2aee15c

Please sign in to comment.