// Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov. // Jad home page: http://www.geocities.com/kpdus/jad.html // Decompiler options: braces fieldsfirst space lnc package com.philips.lighting.hue.sdk.utilities.impl; import java.util.Locale; public class PHHueHelper { public static final int BRIDGE_VERSION_1_0 = 0x40a8d; public static final int BRIDGE_VERSION_1_1 = 0xf5901; public static final int BRIDGE_VERSION_1_1_1 = 0xf597c; public PHHueHelper() { } public static String formatMacAddress(String s) { if (s == null) { s = null; } else { String s1 = s.replace(":", ""); if (s1.length() == 12) { s = new StringBuffer(); s.append(s1.substring(0, 2)).append(":").append(s1.substring(2, 4)).append(":").append(s1.substring(4, 6)).append(":").append(s1.substring(6, 8)).append(":").append(s1.substring(8, 10)).append(":").append(s1.substring(10, 12)); return s.toString(); } } return s; } public static String macAddressFromBridgeId(String s) { String s1; if (s == null) { s1 = null; } else { s1 = s; if (s.length() == 16) { StringBuffer stringbuffer = new StringBuffer(); stringbuffer.append(s.substring(0, 6)); stringbuffer.append(s.substring(10)); return formatMacAddress(stringbuffer.toString()); } } return s1; } public static float precision(int i, float f) { if (Float.isNaN(f)) { return 0.0F; } else { return Float.valueOf(String.format(Locale.ENGLISH, (new StringBuilder("%.")).append(i).append('f').toString(), new Object[] { Float.valueOf(f) })).floatValue(); } } }