예제 #1
0
        public void HomeSensorTest()
        {
            var data = HomeSensorHelper.GetSensorData();

            Assert.IsNotNull(data);
            Assert.IsTrue(data.Temperature > 0);
        }
예제 #2
0
        public async void Run(IBackgroundTaskInstance taskInstance)
        {
            taskInstance.Canceled += OnCanceled;
            var defferal = taskInstance.GetDeferral();

            TileHelper.UpdateTile(HomeSensorHelper.GetSensorData());
            defferal.Complete();
        }
예제 #3
0
        private void Refresh()
        {
            var data = HomeSensorHelper.GetSensorData();

            TileHelper.UpdateTile(data);
            Temperature.Text    = data.Temperature + "°F";
            DewPoint.Text       = data.DewPoint.ToString("#0.000");
            Humidity.Text       = string.Format("{0}%", data.Humidity.ToString("#0.00"));
            Light.Text          = (data.Light > 190) ? "On" : "Off";
            CarbonMonoxide.Text = data.CarbonMonoxide.ToString();
            Smoke.Text          = data.Smoke.ToString();
            LastUpdated.Text    = string.Format("Last Updated: {0}", DateTime.Now);
        }