public static HarmonyDocument SequenceDocument(int sequenceId) { var document = new HarmonyDocument(); var element = new Element("oa"); element.Attributes.Add("xmlns", "connect.logitech.com"); element.Attributes.Add("mime", "vnd.logitech.harmony/vnd.logitech.harmony.engine?holdAction"); var action = new HarmonySequenceAction { sequenceId = sequenceId }; var json = new JavaScriptSerializer().Serialize(action); // At this point our valid json won't work - we need to break it so it looks like: // {"sequenceId"::123} // note double colons json = json.Replace(":", "::"); element.Value = string.Format("action={0}:status=press", json); document.AddChild(element); return(document); }
public static HarmonyDocument GetCurrentActivityDocument() { var document = new HarmonyDocument(); document.AddChild(CreateOaElement("getCurrentActivity")); return(document); }
public static HarmonyDocument IRCommandDocument(string deviceId, string command) { var document = new HarmonyDocument(); var element = new Element("oa"); element.Attributes.Add("xmlns", "connect.logitech.com"); element.Attributes.Add("mime", "vnd.logitech.harmony/vnd.logitech.harmony.engine?holdAction"); var action = new HarmonyIRCommandAction { type = "IRCommand", deviceId = deviceId, command = command }; var json = new JavaScriptSerializer().Serialize(action); // At this point our valid json won't work - we need to break it so it looks like: // {"type"::"IRCommand","deviceId"::"deviceId","command"::"command"} // note double colons json = json.Replace(":", "::"); element.Value = string.Format("action={0}:status=press", json); document.AddChild(element); return(document); }
public static HarmonyDocument ConfigDocument() { var document = new HarmonyDocument(); document.AddChild(CreateOaElement("config")); return(document); }
public static HarmonyDocument StartActivityDocument(string activityId) { var document = new HarmonyDocument(); var element = CreateOaElement("startactivity"); element.Value = $"activityId={activityId}:timestamp=0"; document.AddChild(element); return(document); }
public static HarmonyDocument GetCurrentActivityDocument() { var document = new HarmonyDocument(); var element = new Element("oa"); element.Attributes.Add("xmlns", "connect.logitech.com"); element.Attributes.Add("mime", "vnd.logitech.harmony/vnd.logitech.harmony.engine?getCurrentActivity"); document.AddChild(element); return document; }
public static HarmonyDocument ConfigDocument() { var document = new HarmonyDocument(); var element = new Element("oa"); element.Attributes.Add("xmlns", "connect.logitech.com"); element.Attributes.Add("mime", "vnd.logitech.harmony/vnd.logitech.harmony.engine?config"); document.AddChild(element); return(document); }
public static HarmonyDocument LogitechPairDocument(string token) { var document = new HarmonyDocument(); var element = new Element("oa"); element.Attributes.Add("xmlns", "connect.logitech.com"); element.Attributes.Add("mime", "vnd.logitech.connect/vnd.logitech.pair"); element.Value = $"token={token}:name=foo#iOS6.0.1#iPhone"; document.AddChild(element); return(document); }
public static HarmonyDocument StartActivityDocument(string activityId) { var document = new HarmonyDocument(); var element = new Element("oa"); element.Attributes.Add("xmlns", "connect.logitech.com"); element.Attributes.Add("mime", "vnd.logitech.harmony/vnd.logitech.harmony.engine?startactivity"); element.Value = string.Format("activityId={0}:timestamp=0", activityId); document.AddChild(element); return document; }
public static HarmonyDocument LogitechPairDocument(string token) { var document = new HarmonyDocument(); var element = new Element("oa"); element.Attributes.Add("xmlns", "connect.logitech.com"); element.Attributes.Add("mime", "vnd.logitech.connect/vnd.logitech.pair"); element.Value = string.Format("token={0}:name={1}#{2}", token, "foo", "iOS6.0.1#iPhone"); document.AddChild(element); return document; }
public static HarmonyDocument StartActivityDocument(string activityId) { var document = new HarmonyDocument(); var element = new Element("oa"); element.Attributes.Add("xmlns", "connect.logitech.com"); element.Attributes.Add("mime", "vnd.logitech.harmony/vnd.logitech.harmony.engine?startactivity"); element.Value = string.Format("activityId={0}:timestamp=0", activityId); document.AddChild(element); return(document); }
public static HarmonyDocument LogitechPairDocument(string token) { var document = new HarmonyDocument(); var element = new Element("oa"); element.Attributes.Add("xmlns", "connect.logitech.com"); element.Attributes.Add("mime", "vnd.logitech.connect/vnd.logitech.pair"); element.Value = string.Format("token={0}:name={1}#{2}", token, "foo", "iOS6.0.1#iPhone"); document.AddChild(element); return(document); }
public static HarmonyDocument IrCommandDocument(string deviceId, string command) { var document = new HarmonyDocument(); var action = new HarmonyAction { type = "IRCommand", deviceId = deviceId, command = command }; var json = new JavaScriptSerializer().Serialize(action); // At this point our valid json won't work - we need to break it so it looks like: // {"type"::"IRCommand","deviceId"::"deviceId","command"::"command"} // note double colons json = json.Replace(":", "::"); var element = CreateOaElement("holdAction"); element.Value = $"action={json}:status=press"; document.AddChild(element); return(document); }
public static HarmonyDocument IRCommandDocument(string deviceId, string command) { var document = new HarmonyDocument(); var element = new Element("oa"); element.Attributes.Add("xmlns", "connect.logitech.com"); element.Attributes.Add("mime", "vnd.logitech.harmony/vnd.logitech.harmony.engine?holdAction"); var action = new HarmonyAction { type = "IRCommand", deviceId = deviceId, command = command }; var json = new JavaScriptSerializer().Serialize(action); // At this point our valid json won't work - we need to break it so it looks like: // {"type"::"IRCommand","deviceId"::"deviceId","command"::"command"} // note double colons json = json.Replace(":", "::"); element.Value = string.Format("action={0}:status=press", json); document.AddChild(element); return document; }
public static HarmonyDocument SequenceDocument(int sequenceId) { var document = new HarmonyDocument(); var element = new Element("oa"); element.Attributes.Add("xmlns", "connect.logitech.com"); element.Attributes.Add("mime", "vnd.logitech.harmony/vnd.logitech.harmony.engine?holdAction"); var action = new HarmonySequenceAction { sequenceId = sequenceId }; var json = new JavaScriptSerializer().Serialize(action); // At this point our valid json won't work - we need to break it so it looks like: // {"sequenceId"::123} // note double colons json = json.Replace(":", "::"); element.Value = string.Format("action={0}:status=press", json); document.AddChild(element); return document; }