示例#1
0
        public void SendCommand(byte[] command, bool updateLastUsed = true)
        {
            byte[] prefix = GetCommandPrefix(BridgeId);
            byte[] toSum  = MiHelpers.Combine(command, new byte[] { Zone, 0x00 });
            byte[] cmd    = MiHelpers.Combine(prefix, toSum, new byte[] { (byte)toSum.Sum(x => x) });

            if (updateLastUsed)
            {
                _lastUsedCommand = command;
            }

            _client.Send(cmd);
        }
示例#2
0
        public static byte[] ApplyColor(Color color)
        {
            byte hue = MiHelpers.GetMilightHue(color);

            return(new byte[] { 0x31, 0x00, 0x00, 0x07, 0x01, hue, hue, hue, hue });
        }