diff --git a/homeassistant/components/meteo_lt/weather.py b/homeassistant/components/meteo_lt/weather.py index 902a899dbc3..ec48bbf2a12 100644 --- a/homeassistant/components/meteo_lt/weather.py +++ b/homeassistant/components/meteo_lt/weather.py @@ -139,7 +139,7 @@ class MeteoLtWeatherEntity(CoordinatorEntity[MeteoLtUpdateCoordinator], WeatherE forecasts_by_date[date].append(timestamp) daily_forecasts = [] - for date in sorted(forecasts_by_date.keys())[:5]: + for date in sorted(forecasts_by_date.keys()): day_forecasts = forecasts_by_date[date] if not day_forecasts: continue @@ -186,5 +186,5 @@ class MeteoLtWeatherEntity(CoordinatorEntity[MeteoLtUpdateCoordinator], WeatherE return None return [ self._convert_forecast_data(forecast_data) - for forecast_data in self.coordinator.data.forecast_timestamps[:24] + for forecast_data in self.coordinator.data.forecast_timestamps ] diff --git a/tests/components/meteo_lt/fixtures/forecast.json b/tests/components/meteo_lt/fixtures/forecast.json index d289adb1394..fef864b3981 100644 --- a/tests/components/meteo_lt/fixtures/forecast.json +++ b/tests/components/meteo_lt/fixtures/forecast.json @@ -48,6 +48,84 @@ "relativeHumidity": 65, "totalPrecipitation": 0.1, "conditionCode": "cloudy" + }, + { + "forecastTimeUtc": "2025-09-26 10:00:00", + "airTemperature": 15.0, + "feelsLikeTemperature": 15.0, + "windSpeed": 3, + "windGust": 9, + "windDirection": 35, + "cloudCover": 30, + "seaLevelPressure": 1030, + "relativeHumidity": 60, + "totalPrecipitation": 0.2, + "conditionCode": "cloudy" + }, + { + "forecastTimeUtc": "2025-09-27 10:00:00", + "airTemperature": 16.0, + "feelsLikeTemperature": 16.0, + "windSpeed": 4, + "windGust": 10, + "windDirection": 40, + "cloudCover": 35, + "seaLevelPressure": 1029, + "relativeHumidity": 55, + "totalPrecipitation": 0.3, + "conditionCode": "rainy" + }, + { + "forecastTimeUtc": "2025-09-28 10:00:00", + "airTemperature": 17.0, + "feelsLikeTemperature": 17.0, + "windSpeed": 5, + "windGust": 11, + "windDirection": 45, + "cloudCover": 40, + "seaLevelPressure": 1028, + "relativeHumidity": 50, + "totalPrecipitation": 0.4, + "conditionCode": "rainy" + }, + { + "forecastTimeUtc": "2025-09-29 10:00:00", + "airTemperature": 18.0, + "feelsLikeTemperature": 18.0, + "windSpeed": 6, + "windGust": 12, + "windDirection": 50, + "cloudCover": 45, + "seaLevelPressure": 1027, + "relativeHumidity": 45, + "totalPrecipitation": 0.5, + "conditionCode": "rainy" + }, + { + "forecastTimeUtc": "2025-09-30 10:00:00", + "airTemperature": 19.0, + "feelsLikeTemperature": 19.0, + "windSpeed": 7, + "windGust": 13, + "windDirection": 55, + "cloudCover": 50, + "seaLevelPressure": 1026, + "relativeHumidity": 40, + "totalPrecipitation": 0.6, + "conditionCode": "rainy" + }, + { + "forecastTimeUtc": "2025-10-01 10:00:00", + "airTemperature": 20.0, + "feelsLikeTemperature": 20.0, + "windSpeed": 8, + "windGust": 14, + "windDirection": 60, + "cloudCover": 55, + "seaLevelPressure": 1025, + "relativeHumidity": 35, + "totalPrecipitation": 0.7, + "conditionCode": "rainy" } ] } diff --git a/tests/components/meteo_lt/test_weather.py b/tests/components/meteo_lt/test_weather.py index 27a6c549c03..1a6c0e59a46 100644 --- a/tests/components/meteo_lt/test_weather.py +++ b/tests/components/meteo_lt/test_weather.py @@ -34,3 +34,34 @@ async def test_weather_entity( await hass.async_block_till_done() await snapshot_platform(hass, entity_registry, snapshot, mock_config_entry.entry_id) + + +@pytest.mark.freeze_time("2025-09-25 9:00:00") +async def test_forecast_no_limits( + hass: HomeAssistant, + mock_config_entry: MockConfigEntry, +) -> None: + """Test that forecast returns all available data from API without limits.""" + mock_config_entry.add_to_hass(hass) + await hass.config_entries.async_setup(mock_config_entry.entry_id) + await hass.async_block_till_done() + + result = await hass.services.async_call( + "weather", + "get_forecasts", + {"entity_id": "weather.vilnius", "type": "hourly"}, + blocking=True, + return_response=True, + ) + hourly_forecasts = result["weather.vilnius"]["forecast"] + assert len(hourly_forecasts) == 9 + + result = await hass.services.async_call( + "weather", + "get_forecasts", + {"entity_id": "weather.vilnius", "type": "daily"}, + blocking=True, + return_response=True, + ) + daily_forecasts = result["weather.vilnius"]["forecast"] + assert len(daily_forecasts) == 7