Files
Symcon_Belevo_Energiemanage…/Ladestation_OCPP/libs/Diagnostics.php
T

26 lines
545 B
PHP

<?php
class Diagnostics
{
public static function message(string $severity, string $source, string $text, string $code = ''): array
{
return [
'timestamp' => time(),
'severity' => $severity,
'source' => $source,
'text' => $text,
'code' => $code
];
}
public static function statusFromFlags(bool $online, bool $fault): string
{
if ($fault) {
return 'Stoerung';
}
return $online ? 'Online' : 'Offline';
}
}
?>