Skip to content

Commit c1596f5

Browse files
authored
Update config_flow.py
1 parent f21de4a commit c1596f5

1 file changed

Lines changed: 11 additions & 11 deletions

File tree

custom_components/ha_felicity/config_flow.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
"""Config flow for SDM630 integration."""
1+
"""Config flow for Felicity integration."""
22

33
import logging
44
from typing import Any
@@ -43,8 +43,8 @@
4343
_LOGGER = logging.getLogger(__name__)
4444

4545

46-
class HA_SDM630ConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
47-
"""Handle a config flow for SDM630."""
46+
class HA_FelicityConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
47+
"""Handle a config flow for Felicity."""
4848

4949
VERSION = 1
5050

@@ -56,7 +56,7 @@ def __init__(self):
5656
@callback
5757
def async_get_options_flow(config_entry: ConfigEntry):
5858
"""Get the options flow for this handler."""
59-
return SDM630OptionsFlowHandler(config_entry)
59+
return FelicityOptionsFlowHandler(config_entry)
6060

6161
async def async_step_user(self, user_input: dict[str, Any] | None = None) -> FlowResult:
6262
"""Handle connection type selection."""
@@ -105,7 +105,7 @@ async def async_step_serial(self, user_input: dict[str, Any] | None = None) -> F
105105

106106
data_schema = vol.Schema(
107107
{
108-
vol.Required(CONF_NAME, default="SDM630"): str,
108+
vol.Required(CONF_NAME, default="Felicity"): str,
109109
vol.Required(CONF_SERIAL_PORT): selector.SelectSelector(
110110
selector.SelectSelectorConfig(
111111
options=port_options,
@@ -156,7 +156,7 @@ async def async_step_serial(self, user_input: dict[str, Any] | None = None) -> F
156156
errors["base"] = "read_error"
157157
except Exception as err:
158158
errors["base"] = "unknown"
159-
_LOGGER.exception("Unexpected error during SDM630 serial setup: %s", err)
159+
_LOGGER.exception("Unexpected error during Felicity serial setup: %s", err)
160160

161161
return self.async_show_form(step_id="serial",data_schema=data_schema,errors=errors)
162162

@@ -166,7 +166,7 @@ async def async_step_tcp(self, user_input: dict[str, Any] | None = None) -> Flow
166166

167167
data_schema = vol.Schema(
168168
{
169-
vol.Required(CONF_NAME, default="SDM630"): str,
169+
vol.Required(CONF_NAME, default="Felicity"): str,
170170
vol.Required(CONF_HOST): str,
171171
vol.Required(CONF_PORT, default=DEFAULT_TCP_PORT): vol.All(
172172
vol.Coerce(int), vol.Range(min=1, max=65535)
@@ -200,12 +200,12 @@ async def async_step_tcp(self, user_input: dict[str, Any] | None = None) -> Flow
200200
errors["base"] = "read_error"
201201
except Exception as err:
202202
errors["base"] = "unknown"
203-
_LOGGER.exception("Unexpected error during SDM630 TCP setup: %s", err)
203+
_LOGGER.exception("Unexpected error during Felicity TCP setup: %s", err)
204204

205205
return self.async_show_form(step_id="tcp", data_schema=data_schema, errors=errors)
206206

207207
async def _async_test_serial_connection(self, data: dict[str, Any]) -> None:
208-
"""Test serial connection to the SDM630 meter."""
208+
"""Test serial connection to the Felicity meter."""
209209
client = None
210210
try:
211211
client = AsyncModbusSerialClient(
@@ -239,7 +239,7 @@ async def _async_test_serial_connection(self, data: dict[str, Any]) -> None:
239239
_LOGGER.debug("Error closing Modbus Serial client: %s", err)
240240

241241
async def _async_test_tcp_connection(self, data: dict[str, Any]) -> None:
242-
"""Test TCP connection to the SDM630 meter."""
242+
"""Test TCP connection to the Felicity meter."""
243243
client = None
244244
try:
245245
client = AsyncModbusTcpClient(
@@ -269,7 +269,7 @@ async def _async_test_tcp_connection(self, data: dict[str, Any]) -> None:
269269
except Exception as err:
270270
_LOGGER.debug("Error closing Modbus TCP client: %s", err)
271271

272-
class SDM630OptionsFlowHandler(config_entries.OptionsFlow):
272+
class FelicityOptionsFlowHandler(config_entries.OptionsFlow):
273273
def __init__(self, config_entry: ConfigEntry):
274274
"""Initialize options flow."""
275275
# self.config_entry = config_entry # this is wrong!

0 commit comments

Comments
 (0)