async def format_forecast_data(self):
    'Flatten out forecast data.'
    flattened = {}
    days = len(self.daily_forecasts_data['data'])
    for day in range(0, days):
        icon = self.daily_forecasts_data['data'][day]['icon_descriptor']
        flattened['mdi_icon'] = MDI_ICON_MAP[icon]
        uv = self.daily_forecasts_data['data'][day]['uv']
        flattened['uv_category'] = UV_MAP[uv['category']]
        flattened['uv_max_index'] = uv['max_index']
        flattened['uv_start_time'] = uv['start_time']
        flattened['uv_end_time'] = uv['end_time']
        rain = self.daily_forecasts_data['data'][day]['rain']
        flattened['rain_chance'] = rain['chance']
        flattened['rain_amount_min'] = rain['amount']['min']
        if (rain['amount']['max'] is None):
            flattened['rain_amount_max'] = flattened['rain_amount_min']
            flattened['rain_amount_range'] = rain['amount']['min']
        else:
            flattened['rain_amount_max'] = rain['amount']['max']
            flattened['rain_amount_range'] = '{} to {}'.format(rain['amount']['min'], rain['amount']['max'])
        self.daily_forecasts_data['data'][day].update(flattened)
Flatten out forecast data.
async def format_forecast_data(self):
    
    flattened = {}
    days = len(self.daily_forecasts_data['data'])
    for day in range(0, days):
        icon = self.daily_forecasts_data['data'][day]['icon_descriptor']
        flattened['mdi_icon'] = MDI_ICON_MAP[icon]
        uv = self.daily_forecasts_data['data'][day]['uv']
        flattened['uv_category'] = UV_MAP[uv['category']]
        flattened['uv_max_index'] = uv['max_index']
        flattened['uv_start_time'] = uv['start_time']
        flattened['uv_end_time'] = uv['end_time']
        rain = self.daily_forecasts_data['data'][day]['rain']
        flattened['rain_chance'] = rain['chance']
        flattened['rain_amount_min'] = rain['amount']['min']
        if (rain['amount']['max'] is None):
            flattened['rain_amount_max'] = flattened['rain_amount_min']
            flattened['rain_amount_range'] = rain['amount']['min']
        else:
            flattened['rain_amount_max'] = rain['amount']['max']
            flattened['rain_amount_range'] = '{} to {}'.format(rain['amount']['min'], rain['amount']['max'])
        self.daily_forecasts_data['data'][day].update(flattened)