From b9bbe36af0cddccd9b54d4fdbde304034d2b230d Mon Sep 17 00:00:00 2001 From: Klaas Schoute Date: Wed, 29 Apr 2026 08:58:22 +0200 Subject: [PATCH] Remove name field from Forecast.solar config flow (#169165) --- homeassistant/components/forecast_solar/config_flow.py | 6 ++---- homeassistant/components/forecast_solar/strings.json | 3 +-- tests/components/forecast_solar/test_config_flow.py | 5 ++--- 3 files changed, 5 insertions(+), 9 deletions(-) diff --git a/homeassistant/components/forecast_solar/config_flow.py b/homeassistant/components/forecast_solar/config_flow.py index 7fb1bde2d5a..098c74c9547 100644 --- a/homeassistant/components/forecast_solar/config_flow.py +++ b/homeassistant/components/forecast_solar/config_flow.py @@ -15,7 +15,7 @@ from homeassistant.config_entries import ( OptionsFlow, SubentryFlowResult, ) -from homeassistant.const import CONF_API_KEY, CONF_LATITUDE, CONF_LONGITUDE, CONF_NAME +from homeassistant.const import CONF_API_KEY, CONF_LATITUDE, CONF_LONGITUDE from homeassistant.core import callback from homeassistant.helpers import config_validation as cv, selector @@ -94,7 +94,7 @@ class ForecastSolarFlowHandler(ConfigFlow, domain=DOMAIN): """Handle a flow initiated by the user.""" if user_input is not None: return self.async_create_entry( - title=user_input[CONF_NAME], + title="", data={ CONF_LATITUDE: user_input[CONF_LATITUDE], CONF_LONGITUDE: user_input[CONF_LONGITUDE], @@ -118,13 +118,11 @@ class ForecastSolarFlowHandler(ConfigFlow, domain=DOMAIN): data_schema=self.add_suggested_values_to_schema( vol.Schema( { - vol.Required(CONF_NAME): str, vol.Required(CONF_LATITUDE): cv.latitude, vol.Required(CONF_LONGITUDE): cv.longitude, } ).extend(PLANE_SCHEMA.schema), { - CONF_NAME: self.hass.config.location_name, CONF_LATITUDE: self.hass.config.latitude, CONF_LONGITUDE: self.hass.config.longitude, CONF_DECLINATION: DEFAULT_DECLINATION, diff --git a/homeassistant/components/forecast_solar/strings.json b/homeassistant/components/forecast_solar/strings.json index 3ed3f146a11..6d0c3b45844 100644 --- a/homeassistant/components/forecast_solar/strings.json +++ b/homeassistant/components/forecast_solar/strings.json @@ -7,8 +7,7 @@ "declination": "Declination (0 = Horizontal, 90 = Vertical)", "latitude": "[%key:common::config_flow::data::latitude%]", "longitude": "[%key:common::config_flow::data::longitude%]", - "modules_power": "Total Watt peak power of your solar modules", - "name": "[%key:common::config_flow::data::name%]" + "modules_power": "Total Watt peak power of your solar modules" }, "description": "Fill in the data of your solar panels. Please refer to the documentation if a field is unclear." } diff --git a/tests/components/forecast_solar/test_config_flow.py b/tests/components/forecast_solar/test_config_flow.py index d560fe0dc16..c4a3756589b 100644 --- a/tests/components/forecast_solar/test_config_flow.py +++ b/tests/components/forecast_solar/test_config_flow.py @@ -19,7 +19,7 @@ from homeassistant.config_entries import ( SOURCE_USER, ConfigSubentryData, ) -from homeassistant.const import CONF_API_KEY, CONF_LATITUDE, CONF_LONGITUDE, CONF_NAME +from homeassistant.const import CONF_API_KEY, CONF_LATITUDE, CONF_LONGITUDE from homeassistant.core import HomeAssistant from homeassistant.data_entry_flow import FlowResultType @@ -38,7 +38,6 @@ async def test_user_flow(hass: HomeAssistant, mock_setup_entry: AsyncMock) -> No result = await hass.config_entries.flow.async_configure( result["flow_id"], user_input={ - CONF_NAME: "Name", CONF_LATITUDE: 52.42, CONF_LONGITUDE: 4.42, CONF_AZIMUTH: 142, @@ -50,7 +49,7 @@ async def test_user_flow(hass: HomeAssistant, mock_setup_entry: AsyncMock) -> No assert result["type"] is FlowResultType.CREATE_ENTRY config_entry = result["result"] - assert config_entry.title == "Name" + assert config_entry.title == "" assert config_entry.unique_id is None assert config_entry.data == { CONF_LATITUDE: 52.42,