public static void SendAction(string domain, string action, Dictionary<string, string> data) { string json = "{" + ParseDictionaryToJson(data) + "}"; WebRequests.SendData(domain, action, json); }
public static void SendAction(string entityId, string action) { string json = "{\"entity_id\":\"" + entityId + "\"}"; WebRequests.SendData(entityId.Split('.')[0], action, json); }
public static void SendAction(string action, IEnumerable<string> entityIds) { string json = "{\"entity_id\":[" + string.Join(',', entityIds.Select(x => "\"" + x + "\"").ToList()) + "]}"; WebRequests.SendData(entityIds.First().Split('.')[0], action, json); }
public static void SendActionNoData(string entityId) { WebRequests.SendData(entityId.Split('.')[0], entityId.Split('.')[1], string.Empty); }