Hi i’m developing integrations and run into the problem that cannot fix. In my config file I have:
foxess:
- username: joe
password: secret123
deviceID: 32f1bbc87
- name: FoxESS-2
username: stefan-batory
password: password^password
deviceID: 55560e929
Config schema definition in the code looks like this:
FOXESS_SCHEMA = vol.Schema(
{
vol.Optional(CONF_NAME,default=DEFAULT_NAME): cv.string,
vol.Required(CONF_USERNAME): cv.string,
vol.Required(CONF_PASSWORD): cv.string,
vol.Required(CONF_DEVICEID): cv.string
}
)
CONFIG_SCHEMA = vol.Schema(
{DOMAIN: vol.All( cv.ensure_list,[FOXESS_SCHEMA])},
extra=vol.ALLOW_EXTRA
)
The integration is staring and running properly but when I try to restart HA from UI I receive:
2022-05-27 20:50:57 ERROR (MainThread) [homeassistant.components.homeassistant] The system cannot restart because the configuration is not valid: Invalid config for [foxess]: [username] is an invalid option for [foxess]. Check: foxess->username. (See ?, line ?).
2022-05-27 20:50:57 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [3833414896] The system cannot restart because the configuration is not valid: Invalid config for [foxess]: [username] is an invalid option for [foxess]. Check: foxess->username. (See ?, line ?).
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 189, in handle_call_service
await hass.services.async_call(
File "/usr/src/homeassistant/homeassistant/core.py", line 1627, in async_call
task.result()
File "/usr/src/homeassistant/homeassistant/core.py", line 1664, in _execute_service
await cast(Callable[[ServiceCall], Awaitable[None]], handler.job.target)(
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 747, in admin_handler
await result
File "/usr/src/homeassistant/homeassistant/components/homeassistant/__init__.py", line 173, in async_handle_core_service
raise HomeAssistantError(
homeassistant.exceptions.HomeAssistantError: The system cannot restart because the configuration is not valid: Invalid config for [foxess]: [username] is an invalid option for [foxess]. Check: foxess->username. (See ?, line ?).
What I’m doing wrong ?