コード例 #1
0
 public bool Initialize()
 {
     try
     {
         _magicHomeAurora = new MagicHomeAuroraDevice();
         _magicHomeAurora.Init(ipAddress);
         return(true);
     }
     catch (Exception exc)
     {
         return(false);
     }
 }
コード例 #2
0
    //Custom method to send the color to the device
    private void SendColorToDevice(Color color, bool forced)
    {
        //Check if device's current color is the same, no need to update if they are the same
        if (!device_color.Equals(color) || forced)
        {
            //SendArgs(new string[] { string.Format("--sc:{0}:{1}:{2}", color.R.ToString(), color.G.ToString(), color.B.ToString()) });

            _magicHomeAurora = new MagicHomeAuroraDevice();
            _magicHomeAurora.Init(ipAddress);
            _magicHomeAurora.SetColor(color);
            _magicHomeAurora.Stop();
            device_color = color;
            Global.logger.LogLine(string.Format("[C# Script] Sent a color, {0} to MagicHomeLive", color));
        }
    }