Set minimal value for modules power - Forecast.solar (#108166)

This commit is contained in:
Klaas Schoute
2024-01-16 22:46:00 +01:00
committed by GitHub
parent db81f4d046
commit 0f185a9a09

View File

@ -75,7 +75,9 @@ class ForecastSolarFlowHandler(ConfigFlow, domain=DOMAIN):
vol.Required(CONF_AZIMUTH, default=180): vol.All(
vol.Coerce(int), vol.Range(min=0, max=360)
),
vol.Required(CONF_MODULES_POWER): vol.Coerce(int),
vol.Required(CONF_MODULES_POWER): vol.All(
vol.Coerce(int), vol.Range(min=1)
),
}
),
)
@ -126,7 +128,7 @@ class ForecastSolarOptionFlowHandler(OptionsFlow):
vol.Required(
CONF_MODULES_POWER,
default=self.config_entry.options[CONF_MODULES_POWER],
): vol.Coerce(int),
): vol.All(vol.Coerce(int), vol.Range(min=1)),
vol.Optional(
CONF_DAMPING_MORNING,
default=self.config_entry.options.get(