internal static void UpdateState(string message)
 {
     try
     {
         List <IOTDevice> datas = new List <IOTDevice>();
         var context            = GlobalHost.ConnectionManager.GetHubContext <IOTHub>();
         foreach (var str in message.Split(';'))
         {
             if (string.IsNullOrEmpty(str.Trim()))
             {
                 continue;
             }
             int       PIN   = int.Parse(str.Split(':')[0]);
             bool      State = bool.Parse(str.Split(':')[1]);
             IOTDevice node  = new IOTDevice()
             {
                 ID = PIN, State = State
             };
             datas.Add(node);
         }
         dynamic allClients = context.Clients.All.UpdateState(JsonConvert.SerializeObject(datas));
     }
     catch (Exception ex)
     {
         Console.WriteLine(ex.Message);
     }
 }
        internal static void UpdateState(string message)
        {
            try
            {
                List<IOTDevice> datas = new List<IOTDevice>();
                var context = GlobalHost.ConnectionManager.GetHubContext<IOTHub>();
                foreach (var str in message.Split(';'))
                {
                    if (string.IsNullOrEmpty(str.Trim())) continue;
                    int PIN = int.Parse(str.Split(':')[0]);
                    bool State = bool.Parse(str.Split(':')[1]);
                    IOTDevice node = new IOTDevice() { ID = PIN, State = State };
                    datas.Add(node);
                }

                dynamic allClients = context.Clients.All.UpdateState(JsonConvert.SerializeObject(datas));

            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }
        }