Fix spelling in switchbee (#79195)

pull/78957/head
Jafar Atili 2022-09-28 15:18:06 +03:00 committed by GitHub
parent cce23683f1
commit 4453241176
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 6 deletions

View File

@ -66,7 +66,7 @@ class ConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
)
try:
mac_formated = await validate_input(self.hass, user_input)
mac_formatted = await validate_input(self.hass, user_input)
except CannotConnect:
errors["base"] = "cannot_connect"
except InvalidAuth:
@ -76,7 +76,7 @@ class ConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
errors["base"] = "unknown"
else:
await self.async_set_unique_id(mac_formated)
await self.async_set_unique_id(mac_formatted)
self._abort_if_unique_id_configured()
return self.async_create_entry(title=user_input[CONF_HOST], data=user_input)

View File

@ -29,8 +29,7 @@ class SwitchBeeCoordinator(DataUpdateCoordinator[Mapping[int, SwitchBeeBaseDevic
"""Initialize."""
self.api: CentralUnitAPI = swb_api
self._reconnect_counts: int = 0
self.mac_formated: str | None = (
self.mac_formatted: str | None = (
None if self.api.mac is None else format_mac(self.api.mac)
)

View File

@ -27,7 +27,7 @@ class SwitchBeeEntity(CoordinatorEntity[SwitchBeeCoordinator], Generic[_DeviceTy
super().__init__(coordinator)
self._device = device
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]):
@ -45,7 +45,7 @@ class SwitchBeeDeviceEntity(SwitchBeeEntity[_DeviceTypeT]):
identifiers={
(
DOMAIN,
f"{device.unit_id}-{coordinator.mac_formated}",
f"{device.unit_id}-{coordinator.mac_formatted}",
)
},
manufacturer=SWITCHBEE_BRAND,