public PushbulletMethods() { Configs configs = ConfigsTools.GetConfigs <Configs>(); string accessToken = configs.PushbulletAccessToken; Client = new PushbulletClient(accessToken); }
public static void Trigger(string senderId, string triggerId) { Configs configs = ConfigsTools.GetConfigs <Configs>(); RegisteredTrigger registeredTrigger = configs.GetRegisteredTrigger(senderId, triggerId); if (registeredTrigger != null) { foreach (RegisteredTriggerAction action in registeredTrigger.Actions) { Type theType = System.Reflection.Assembly.GetExecutingAssembly().GetType("NotifyToAction." + action.TypeName); var theInstance = Activator.CreateInstance(theType); MethodInfo theMethod = theType.GetMethod(action.MethodName); if (action.MethodParameters == null) { theMethod.Invoke(theInstance, null); } else { theMethod.Invoke(theInstance, action.MethodParameters.ToArray()); } } } }
public YeelightMethods() : base(IPAddress.Parse(ConfigsTools.GetConfigs <Configs>().YeelightLampIp), 55443) { }