Hallo ihr lieben,
ich benutze diesesn „Entenzähler“, der bis auf eine sache wunderbar funktioniert
Ich hätte gerne eine schrittweite von „10“, statt von „1“…
Ich habe schon versucht, einiges im Script zu ändern, bekomme aber nie das gewünschte Ergebnis
Funktioniert das überhaupt mit dem script, oder bin ich da auf die schrittweite „1“ fixiert ?
Vielen Dank und schöne Grüße,
Sascha
<?php
/*
Lagerbestandsverwaltung
Zur Installation das Skript einmal ausführen und nach belieben
Integer-Variablen mit Variablenprofil 'StockManagement' und
diesem Skript als Aktionsskript erstellen.
*/
$ProfileName = 'StockManagement2';
if ($IPS_SENDER === 'WebFront')
{
$profile = IPS_GetVariableProfile($ProfileName);
$minValue = (int)$profile['Associations'][0]['Value'];
$maxValue = (int)$profile['Associations'][2]['Value'];
$value = GetValue($IPS_VARIABLE);
if ($IPS_VALUE == $minValue)
{
$value--;
}
else if ($IPS_VALUE == $maxValue)
{
$value++;
}
SetValue($IPS_VARIABLE, max($minValue + 1, min($maxValue - 1, $value)));
}
else
{
IPS_SetHidden($IPS_SELF, true);
if (@IPS_GetVariableProfile($ProfileName) === false && IPS_CreateVariableProfile($ProfileName, 1))
{
if (floatval(IPS_GetKernelVersion()) >= 2.4)
{
IPS_SetVariableProfileAssociation($ProfileName, -1, '<', '', -1);
IPS_SetVariableProfileAssociation($ProfileName, 0, '%d', '', -1);
IPS_SetVariableProfileAssociation($ProfileName, 101, '>', '', -1);
}
else
{
IPS_SetVariableProfileAssociation($ProfileName, -1, '<', '');
IPS_SetVariableProfileAssociation($ProfileName, 0, '%d', '');
IPS_SetVariableProfileAssociation($ProfileName, 101, '>', '');
}
}
}
?>