mirror of
https://github.com/home-assistant/core.git
synced 2025-08-03 18:48:22 +00:00
fixes
This commit is contained in:
parent
46f2c9ee09
commit
b5fe085d05
@ -45,6 +45,7 @@ from .const import (
|
|||||||
CONF_SUBSCRIBE_LOGS,
|
CONF_SUBSCRIBE_LOGS,
|
||||||
DEFAULT_ALLOW_SERVICE_CALLS,
|
DEFAULT_ALLOW_SERVICE_CALLS,
|
||||||
DEFAULT_NEW_CONFIG_ALLOW_ALLOW_SERVICE_CALLS,
|
DEFAULT_NEW_CONFIG_ALLOW_ALLOW_SERVICE_CALLS,
|
||||||
|
DEFAULT_PORT,
|
||||||
DOMAIN,
|
DOMAIN,
|
||||||
)
|
)
|
||||||
from .dashboard import async_get_or_create_dashboard_manager, async_set_dashboard_info
|
from .dashboard import async_get_or_create_dashboard_manager, async_set_dashboard_info
|
||||||
@ -89,7 +90,7 @@ class EsphomeFlowHandler(ConfigFlow, domain=DOMAIN):
|
|||||||
|
|
||||||
fields: dict[Any, type] = OrderedDict()
|
fields: dict[Any, type] = OrderedDict()
|
||||||
fields[vol.Required(CONF_HOST, default=self._host or vol.UNDEFINED)] = str
|
fields[vol.Required(CONF_HOST, default=self._host or vol.UNDEFINED)] = str
|
||||||
fields[vol.Optional(CONF_PORT, default=self._port or 6053)] = int
|
fields[vol.Optional(CONF_PORT, default=self._port or DEFAULT_PORT)] = int
|
||||||
|
|
||||||
errors = {}
|
errors = {}
|
||||||
if error is not None:
|
if error is not None:
|
||||||
@ -178,8 +179,8 @@ class EsphomeFlowHandler(ConfigFlow, domain=DOMAIN):
|
|||||||
) -> ConfigFlowResult:
|
) -> ConfigFlowResult:
|
||||||
"""Handle a flow initialized by a reconfig request."""
|
"""Handle a flow initialized by a reconfig request."""
|
||||||
self._reconfig_entry = self._get_reconfigure_entry()
|
self._reconfig_entry = self._get_reconfigure_entry()
|
||||||
self._host = entry_data[CONF_HOST]
|
self._host = self._reconfig_entry.data[CONF_HOST]
|
||||||
self._port = entry_data[CONF_PORT]
|
self._port = self._reconfig_entry.data.get(CONF_PORT, DEFAULT_PORT)
|
||||||
return await self._async_step_user_base()
|
return await self._async_step_user_base()
|
||||||
|
|
||||||
@property
|
@property
|
||||||
@ -403,7 +404,7 @@ class EsphomeFlowHandler(ConfigFlow, domain=DOMAIN):
|
|||||||
data={
|
data={
|
||||||
**self._entry_with_name_conflict.data,
|
**self._entry_with_name_conflict.data,
|
||||||
CONF_HOST: self._host,
|
CONF_HOST: self._host,
|
||||||
CONF_PORT: self._port or 6053,
|
CONF_PORT: self._port or DEFAULT_PORT,
|
||||||
CONF_PASSWORD: self._password or "",
|
CONF_PASSWORD: self._password or "",
|
||||||
CONF_NOISE_PSK: self._noise_psk or "",
|
CONF_NOISE_PSK: self._noise_psk or "",
|
||||||
},
|
},
|
||||||
@ -528,7 +529,7 @@ class EsphomeFlowHandler(ConfigFlow, domain=DOMAIN):
|
|||||||
zeroconf_instance = await zeroconf.async_get_instance(self.hass)
|
zeroconf_instance = await zeroconf.async_get_instance(self.hass)
|
||||||
cli = APIClient(
|
cli = APIClient(
|
||||||
host,
|
host,
|
||||||
port or 6053,
|
port or DEFAULT_PORT,
|
||||||
"",
|
"",
|
||||||
zeroconf_instance=zeroconf_instance,
|
zeroconf_instance=zeroconf_instance,
|
||||||
noise_psk=noise_psk,
|
noise_psk=noise_psk,
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
"""ESPHome constants."""
|
"""ESPHome constants."""
|
||||||
|
|
||||||
|
from typing import Final
|
||||||
|
|
||||||
from awesomeversion import AwesomeVersion
|
from awesomeversion import AwesomeVersion
|
||||||
|
|
||||||
DOMAIN = "esphome"
|
DOMAIN = "esphome"
|
||||||
@ -13,6 +15,7 @@ CONF_BLUETOOTH_MAC_ADDRESS = "bluetooth_mac_address"
|
|||||||
DEFAULT_ALLOW_SERVICE_CALLS = True
|
DEFAULT_ALLOW_SERVICE_CALLS = True
|
||||||
DEFAULT_NEW_CONFIG_ALLOW_ALLOW_SERVICE_CALLS = False
|
DEFAULT_NEW_CONFIG_ALLOW_ALLOW_SERVICE_CALLS = False
|
||||||
|
|
||||||
|
DEFAULT_PORT: Final = 6053
|
||||||
|
|
||||||
STABLE_BLE_VERSION_STR = "2025.2.2"
|
STABLE_BLE_VERSION_STR = "2025.2.2"
|
||||||
STABLE_BLE_VERSION = AwesomeVersion(STABLE_BLE_VERSION_STR)
|
STABLE_BLE_VERSION = AwesomeVersion(STABLE_BLE_VERSION_STR)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user