/// <summary>
        ///
        /// </summary>
        /// <param name="version"></param>
        /// <param name="forecast"></param>
        /// <param name="pointKey"></param>
        /// <returns></returns>
        public static WeatherMT Create(ProtocolVersion version, i360PointForecast forecast, byte?pointKey = null)
        {
            WeatherMT weather = Create <WeatherMT>(version);

            weather.Forecast = forecast;
            weather.PointKey = pointKey;

            return(weather);
        }
        /// <summary>
        ///
        /// </summary>
        /// <param name="payload"></param>
        protected override void unpack(BinaryBitReader reader)
        {
            Forecast = new i360PointForecast();

            bool extended = false;

            if (this.Version >= ProtocolVersion.v3__WeatherExtension)
            {
                extended = reader.ReadBoolean();
            }


            Forecast.TimeOffset = (int)reader.ReadUInt(5) - 12;


            var dates     = new int[16];
            var forecasts = new List <i360Forecast>();
            int month     = 0;

            for (int j = 0; j < 16; j++)
            {
                try
                {
                    var forecast = new i360Forecast();

                    ///->

                    ///Дата не изменилась?
                    bool sameDay = reader.ReadBoolean();

                    ///Если изменилась - сохраняем день от начала месяца
                    if (!sameDay)
                    {
                        dates[j] = (int)reader.ReadUInt(5);
                    }
                    else
                    {
                        dates[j] = dates[j - 1];
                    }


                    if (j > 0 && dates[j] < dates[j - 1])
                    {
                        month++;
                    }


                    int hourOffset = (int)reader.ReadUInt(5);

                    forecast.Date = new DateTime(DateTime.Now.Year, DateTime.Now.Month + month, dates[j], hourOffset, 0, 0, DateTimeKind.Utc);

                    ///->

                    forecast.Temperature = (int)reader.ReadUInt(7) - 70;

                    ///->

                    uint?_pressure = reader.ReadUIntNullable(8);

                    if (_pressure != null)
                    {
                        forecast.Pressure = (int)_pressure + 580;
                    }

                    ///->

                    uint?_cloud = reader.ReadUIntNullable(4);

                    if (_cloud != null)
                    {
                        forecast.Cloud = Math.Min(100, (int)_cloud * 15);
                    }

                    ///->
                    ///
                    uint?_precipitation = reader.ReadUIntNullable(8);

                    if (_precipitation != null)
                    {
                        forecast.Precipitation = _precipitation / 4d;
                    }

                    ///->

                    uint?_windDirection = reader.ReadUIntNullable(4);

                    if (_windDirection != null)
                    {
                        forecast.WindDirection = (int)Math.Round(_windDirection.Value * 45d);
                    }

                    ///-->

                    forecast.WindSpeed = reader.ReadUIntNullable(6);

                    ///->

                    forecast.SnowRisk = reader.ReadBoolean();

                    ///->


                    if (this.Version >= ProtocolVersion.v3__WeatherExtension && extended)
                    {
                        ///->

                        uint?_cloudHeight = reader.ReadUIntNullable(8);

                        if (_cloudHeight != null)
                        {
                            forecast.CloudHeight = (int)(_cloudHeight.Value * 70d);
                        }

                        ///->

                        uint?_visibility = reader.ReadUIntNullable(10);

                        if (_visibility != null)
                        {
                            forecast.Visibility = (int)(_visibility.Value * 10d);
                        }

                        ///->

                        forecast.WindGust = reader.ReadUIntNullable(6);

                        ///->
                    }



                    forecasts.Add(forecast);
                }
                catch (Exception e)
                {
                    Debugger.Break();
                }
            }

            Forecast.DayInfos = forecasts.GroupBy(x => x.Date.Date).Select(x => new i360DayInfo()
            {
                Date = x.Key
            }).ToList();
            Forecast.Forecasts = forecasts;

            if (this.Version >= ProtocolVersion.v4__WeatherExtension)
            {
                if (reader.ReadBoolean())
                {
                    PointKey = (byte)reader.ReadUInt(4);
                }
            }
        }