From 79df8aa8354c0e4bd6d8aa6de6859aeb58dff535 Mon Sep 17 00:00:00 2001 From: Nebz <28622481+NebzHB@users.noreply.github.com> Date: Fri, 26 Jan 2024 08:45:36 +0100 Subject: [PATCH] Update homekitUtils.class.php --- homekitUtils.class.php | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/homekitUtils.class.php b/homekitUtils.class.php index 318c2c4..7cead97 100644 --- a/homekitUtils.class.php +++ b/homekitUtils.class.php @@ -27,11 +27,7 @@ public static function transformUnit($label) { 'lux'=>"lux", 'seconds'=>"s" ]; - if(array_key_exists($label,$units)) { - return $units[$label]; - } else { - return $label; - } + return $units[$label] ?? $label; } public static function expandUUID($uuid) { if(strlen($uuid) > 8) { return strtoupper($uuid); }