def _get_temperature_feeling(day_data, hour):
     """Get temperature from weather data."""
     val = get_forecast_hour_value(day_data[AEMET_ATTR_TEMPERATURE_FEELING],
                                   hour)
     if val:
         return format_int(val)
     return None
Exemple #2
0
 def _get_wind_speed(day_data, hour):
     """Get wind speed (hour) from weather data."""
     val = get_forecast_hour_value(day_data[AEMET_ATTR_WIND_GUST],
                                   hour,
                                   key=AEMET_ATTR_SPEED)[0]
     if val:
         return format_int(val)
     return None
Exemple #3
0
 def _get_wind_bearing(day_data, hour):
     """Get wind bearing (hour) from weather data."""
     val = get_forecast_hour_value(day_data[AEMET_ATTR_WIND_GUST],
                                   hour,
                                   key=AEMET_ATTR_DIRECTION)[0]
     if val in WIND_BEARING_MAP:
         return WIND_BEARING_MAP[val]
     _LOGGER.error("%s not found in Wind Bearing map", val)
     return None
Exemple #4
0
 def _get_wind_max_speed(day_data, hour):
     """Get wind max speed from weather data."""
     val = get_forecast_hour_value(day_data[AEMET_ATTR_WIND_GUST], hour)
     if val:
         return format_int(val)
     return None
Exemple #5
0
 def _get_temperature(day_data, hour):
     """Get temperature (hour) from weather data."""
     val = get_forecast_hour_value(day_data[AEMET_ATTR_TEMPERATURE], hour)
     return format_int(val)
Exemple #6
0
 def _get_snow(day_data, hour):
     """Get snow from weather data."""
     val = get_forecast_hour_value(day_data[AEMET_ATTR_SNOW], hour)
     if val:
         return format_float(val)
     return None
Exemple #7
0
 def _get_rain(day_data, hour):
     """Get rain from weather data."""
     val = get_forecast_hour_value(day_data[AEMET_ATTR_PRECIPITATION], hour)
     if val:
         return format_float(val)
     return None
Exemple #8
0
 def _get_humidity(day_data, hour):
     """Get humidity from weather data."""
     val = get_forecast_hour_value(day_data[AEMET_ATTR_HUMIDITY], hour)
     if val:
         return format_int(val)
     return None
Exemple #9
0
 def _get_condition(day_data, hour):
     """Get weather condition (hour) from weather data."""
     val = get_forecast_hour_value(day_data[AEMET_ATTR_SKY_STATE], hour)
     if val:
         return format_condition(val)
     return None