Esempio n. 1
0
        public void SetMeasurements()
        {
            var weatherStationData = WeatherStationData.FromJson(CallService("http://api.openweathermap.org/data/2.5/weather?zip=33511,us&appid=16b2ef647f259a880fa718334c6f0c16&units=imperial"));

            temperature = weatherStationData.Main.Temp;
            humidity    = weatherStationData.Main.Humidity;
            pressure    = weatherStationData.Main.Pressure;
            MeasurementsChanged();
        }
Esempio n. 2
0
        private static BitmapEx Draw(WeatherStationData weatherInfo, LayoutContext layoutContext)
        {
            var indoorDevice = weatherInfo.Devices.First();
            var temperature  = WeatherHelpers.TempToStr(indoorDevice.Temperature.Value);
            var co2          = indoorDevice.Co2Measure.Value.ToString();

            var bitmap = layoutContext.CreateBitmap();

            DefaultDrawingAlgs.DrawTexts(bitmap, layoutContext.Options.Theme.FontFamily, co2, temperature, "+88", layoutContext.Options.Theme.ForegroundColor);

            return(bitmap);
        }