mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 13:17:32 +00:00
Fix spelling in switchbee (#79195)
This commit is contained in:
parent
cce23683f1
commit
4453241176
@ -66,7 +66,7 @@ class ConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
|
|||||||
)
|
)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
mac_formated = await validate_input(self.hass, user_input)
|
mac_formatted = await validate_input(self.hass, user_input)
|
||||||
except CannotConnect:
|
except CannotConnect:
|
||||||
errors["base"] = "cannot_connect"
|
errors["base"] = "cannot_connect"
|
||||||
except InvalidAuth:
|
except InvalidAuth:
|
||||||
@ -76,7 +76,7 @@ class ConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
|
|||||||
errors["base"] = "unknown"
|
errors["base"] = "unknown"
|
||||||
|
|
||||||
else:
|
else:
|
||||||
await self.async_set_unique_id(mac_formated)
|
await self.async_set_unique_id(mac_formatted)
|
||||||
self._abort_if_unique_id_configured()
|
self._abort_if_unique_id_configured()
|
||||||
return self.async_create_entry(title=user_input[CONF_HOST], data=user_input)
|
return self.async_create_entry(title=user_input[CONF_HOST], data=user_input)
|
||||||
|
|
||||||
|
@ -29,8 +29,7 @@ class SwitchBeeCoordinator(DataUpdateCoordinator[Mapping[int, SwitchBeeBaseDevic
|
|||||||
"""Initialize."""
|
"""Initialize."""
|
||||||
self.api: CentralUnitAPI = swb_api
|
self.api: CentralUnitAPI = swb_api
|
||||||
self._reconnect_counts: int = 0
|
self._reconnect_counts: int = 0
|
||||||
|
self.mac_formatted: str | None = (
|
||||||
self.mac_formated: str | None = (
|
|
||||||
None if self.api.mac is None else format_mac(self.api.mac)
|
None if self.api.mac is None else format_mac(self.api.mac)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -27,7 +27,7 @@ class SwitchBeeEntity(CoordinatorEntity[SwitchBeeCoordinator], Generic[_DeviceTy
|
|||||||
super().__init__(coordinator)
|
super().__init__(coordinator)
|
||||||
self._device = device
|
self._device = device
|
||||||
self._attr_name = device.name
|
self._attr_name = device.name
|
||||||
self._attr_unique_id = f"{coordinator.mac_formated}-{device.id}"
|
self._attr_unique_id = f"{coordinator.mac_formatted}-{device.id}"
|
||||||
|
|
||||||
|
|
||||||
class SwitchBeeDeviceEntity(SwitchBeeEntity[_DeviceTypeT]):
|
class SwitchBeeDeviceEntity(SwitchBeeEntity[_DeviceTypeT]):
|
||||||
@ -45,7 +45,7 @@ class SwitchBeeDeviceEntity(SwitchBeeEntity[_DeviceTypeT]):
|
|||||||
identifiers={
|
identifiers={
|
||||||
(
|
(
|
||||||
DOMAIN,
|
DOMAIN,
|
||||||
f"{device.unit_id}-{coordinator.mac_formated}",
|
f"{device.unit_id}-{coordinator.mac_formatted}",
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
manufacturer=SWITCHBEE_BRAND,
|
manufacturer=SWITCHBEE_BRAND,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user