From 44532411765fb30bd415d1b1b009be38ed215067 Mon Sep 17 00:00:00 2001 From: Jafar Atili Date: Wed, 28 Sep 2022 15:18:06 +0300 Subject: [PATCH] Fix spelling in switchbee (#79195) --- homeassistant/components/switchbee/config_flow.py | 4 ++-- homeassistant/components/switchbee/coordinator.py | 3 +-- homeassistant/components/switchbee/entity.py | 4 ++-- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/homeassistant/components/switchbee/config_flow.py b/homeassistant/components/switchbee/config_flow.py index d49155f9cb5..967af101360 100644 --- a/homeassistant/components/switchbee/config_flow.py +++ b/homeassistant/components/switchbee/config_flow.py @@ -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) diff --git a/homeassistant/components/switchbee/coordinator.py b/homeassistant/components/switchbee/coordinator.py index 5d6cf6140af..bf94c98d21b 100644 --- a/homeassistant/components/switchbee/coordinator.py +++ b/homeassistant/components/switchbee/coordinator.py @@ -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) ) diff --git a/homeassistant/components/switchbee/entity.py b/homeassistant/components/switchbee/entity.py index 56191cbb1eb..5925eba2488 100644 --- a/homeassistant/components/switchbee/entity.py +++ b/homeassistant/components/switchbee/entity.py @@ -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,