Logout() public method

public Logout ( ) : void
return void
Exemplo n.º 1
0
        public void GetStatusTest()
        {

            using (var manager = new IpModuleManager(module))
            {
                manager.Login();
                manager.GetAlarmInformation();
                manager.GetStatus();
                manager.Logout();
            }

        }
Exemplo n.º 2
0
        public void GetSystemDataTest()
        {
            using (var manager = new IpModuleManager(module))
            {
                manager.Login();
                manager.GetAlarmInformation();
                manager.Logout();

                Assert.IsNotEmpty(manager.TroubleCodes);
                Assert.IsNotEmpty(manager.Devices);
                Assert.IsNotEmpty(manager.Partitions);
            }

        }
        public override void Configure(Container container)
        {
            GlobalResponseFilters.Add((req, res, dto) =>
            {
                res.AddHeader("X-Paradox", ServiceName);
            });

            JsConfig.EmitCamelCaseNames = true;
            Plugins.Add(new SwaggerFeature());

            bool smartThingsEnabled = Convert.ToBoolean(ConfigurationManager.AppSettings["enableSmartThings"]);
            if (smartThingsEnabled)
            {
                Plugins.Add(new SmartThingsPlugin());
            }

            var manager = new IpModuleManager(module);

            // try one attempt to logout/login if can't login initially
            if (!manager.Login())
            {
                logger.Warn("Couldn't login. Attempting to logout then login to alarm module.");
                manager.Logout();
                manager.Login();
            }

            try
            {
                manager.GetAlarmInformation();
            }
            catch (Exception)
            {
                logger.Error("Problem logging in and getting alarm information. Services will start but Alarm host will not be connected.");
            }

            container.Register(manager);

            alarmStatusCheckThread = new Thread(manager.StartStatusUpdates);
            container.Register(alarmStatusCheckThread);
            alarmStatusCheckThread.Start();

        }
Exemplo n.º 4
0
        public void GetVersionInfoTest()
        {
            using (var manager = new IpModuleManager(module))
            {
                manager.Login();
                manager.GetVersionInformation();
                manager.Logout();
            }

            //NOTE: fill in with your own values.
            Assert.That(module.AlarmPanelVersion.Type, Is.EqualTo(ConfigurationManager.AppSettings["moduleIp"]));
            Assert.That(module.AlarmPanelVersion.SerialNumber, Is.EqualTo("03 00 61 3B"));
            Assert.That(module.AlarmPanelVersion.FirmwareVersion, Is.EqualTo("1.10"));

            Assert.That(module.IpModuleVersion.FirmwareVersion, Is.EqualTo("1.26.01"));
            Assert.That(module.IpModuleVersion.HardwareVersion, Is.EqualTo("010"));
            Assert.That(module.IpModuleVersion.Eco, Is.EqualTo("M009"));
            Assert.That(module.IpModuleVersion.SerialBoot, Is.EqualTo("N/A"));
            Assert.That(module.IpModuleVersion.IpBoot, Is.EqualTo("2.12"));
            Assert.That(module.IpModuleVersion.SerialNumber, Is.EqualTo("71 00 4A C9"));
            Assert.That(module.IpModuleVersion.MacAddress, Is.EqualTo("00:19:BA:02:16:9D"));
        }
Exemplo n.º 5
0
        public void StatusEventTest()
        {

            using (var manager = new IpModuleManager(module))
            {
                manager.Login();
                manager.GetAlarmInformation();
                manager.AlarmStatusUpdate += (sender, args) => Console.Write("raised");
                manager.MonitorEvents();
                manager.GetStatus();
                Thread.Sleep(1500);
                manager.GetStatus();

                manager.ShouldRaise("AlarmStatusUpdate");

                manager.Logout();

            }

        }
Exemplo n.º 6
0
        public void StayArmTest()
        {

            using (var manager = new IpModuleManager(module))
            {
                manager.Login();
                manager.GetAlarmInformation();
                manager.AlarmAction(PartitionNumber.Two, AlarmMode.RegularArm);
                manager.Logout();

            }

        }
Exemplo n.º 7
0
 public void LoginTest()
 {
     var manager = new IpModuleManager(module);
     Assert.IsTrue(manager.Login());
     manager.Logout();
 }