Beispiel #1
0
        public void Process(EventFromIftttType eventNameChanged, bool newValue)
        {
            _log.DebugFormat("Event '{0}' is processing in '{1}'", eventNameChanged, System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);

            PushoverClient client = new PushoverClient();

            if (newValue)
            {
                client.SendNotification(PushoverRequest.CreateRequest("Sotfluent arrive au travail", "Presence", PushoverPriorityNotificationType.NormalPriority, PushoverSoundType.pushover));
            }
            else
            {
                client.SendNotification(PushoverRequest.CreateRequest("Sotfluent part du travail", "Presence", PushoverPriorityNotificationType.NormalPriority, PushoverSoundType.pushover));
            }
        }
Beispiel #2
0
        static void Main(string[] args)
        {
            log4net.Config.XmlConfigurator.Configure();

            System.ServiceModel.ServiceHost _hostApplication = new System.ServiceModel.ServiceHost(typeof(SoftFluent.Presence.Service.PresenceRestService));
            _hostApplication.Open();

            PushoverClient client = new PushoverClient();

            client.SendNotification("first message");

            PushoverRequest request = PushoverRequest.CreateRequest("Test", "Presence", PushoverPriorityNotificationType.LowPriority, "Tel_Softfluent");

            //PushoverRequest request = PushoverRequest.CreateRequest("Test", null, 30, 120, PushoverPriorityNotificationType.EmergencyPriority, "Tel_Softfluent");
            //request.TimeStamp = new DateTime(2016, 1, 31, 10, 5, 0);

            PushoverResponse response = client.SendNotification(request);

            if (response != null && response.Status == 1)
            {
                //OK
                client.CancelEmergency("");
            }
        }