diff --git a/custom_components/toshiba_ac/entity.py b/custom_components/toshiba_ac/entity.py index 2c45d3b..2b88b9e 100644 --- a/custom_components/toshiba_ac/entity.py +++ b/custom_components/toshiba_ac/entity.py @@ -33,7 +33,11 @@ def __init__(self, toshiba_device: ToshibaAcDevice) -> None: @property def available(self) -> bool: """Return True if entity is available.""" - return bool(self._device.ac_id and self._device.amqp_api.sas_token and self._device.http_api.access_token) + return bool( + self._device.ac_id + and self._device.amqp_api.sas_token + and self._device.http_api.access_token + ) class ToshibaAcStateEntity(ToshibaAcEntity): diff --git a/custom_components/toshiba_ac/entity_description.py b/custom_components/toshiba_ac/entity_description.py index d010684..b0ae2f7 100644 --- a/custom_components/toshiba_ac/entity_description.py +++ b/custom_components/toshiba_ac/entity_description.py @@ -16,7 +16,9 @@ class ToshibaAcEnumEntityDescriptionMixin(Generic[TEnum]): ac_attr_name: str ac_attr_setter: str - async def async_set_attr(self, device: ToshibaAcDevice, value: TEnum | None) -> None: + async def async_set_attr( + self, device: ToshibaAcDevice, value: TEnum | None + ) -> None: """Set the provided option enum value.""" if not self.ac_attr_setter and not self.ac_attr_name: return diff --git a/custom_components/toshiba_ac/select.py b/custom_components/toshiba_ac/select.py index 11d7fce..f134dfa 100644 --- a/custom_components/toshiba_ac/select.py +++ b/custom_components/toshiba_ac/select.py @@ -162,7 +162,9 @@ class ToshibaAcSelectEntity(ToshibaAcStateEntity, SelectEntity): entity_description: ToshibaAcSelectDescription _attr_has_entity_name = True - def __init__(self, device: ToshibaAcDevice, entity_description: ToshibaAcSelectDescription): + def __init__( + self, device: ToshibaAcDevice, entity_description: ToshibaAcSelectDescription + ): """Initialize the ToshibaAcSelectEntity.""" super().__init__(device) self._attr_unique_id = f"{device.ac_unique_id}_{entity_description.key}" @@ -177,7 +179,9 @@ def update_attrs(self): """Update the entity's attributes.""" features = self._device.supported.for_ac_mode(self._device.ac_mode) self._attr_options = self.entity_description.get_option_names(features) - self._attr_current_option = self.entity_description.current_option_name(self._device) + self._attr_current_option = self.entity_description.current_option_name( + self._device + ) @property def available(self) -> bool: diff --git a/custom_components/toshiba_ac/switch.py b/custom_components/toshiba_ac/switch.py index 2674e14..c2fbfac 100644 --- a/custom_components/toshiba_ac/switch.py +++ b/custom_components/toshiba_ac/switch.py @@ -148,7 +148,9 @@ class ToshibaAcSwitchEntity(ToshibaAcStateEntity, SwitchEntity): entity_description: ToshibaAcSwitchDescription _attr_has_entity_name = True - def __init__(self, device: ToshibaAcDevice, entity_description: ToshibaAcSwitchDescription): + def __init__( + self, device: ToshibaAcDevice, entity_description: ToshibaAcSwitchDescription + ): """Initialize the switch.""" super().__init__(device) @@ -162,7 +164,9 @@ def available(self): return ( super().available and self._device.ac_status == ToshibaAcStatus.ON - and self.entity_description.is_supported(self._device.supported.for_ac_mode(self._device.ac_mode)) + and self.entity_description.is_supported( + self._device.supported.for_ac_mode(self._device.ac_mode) + ) ) @property diff --git a/pyproject.toml b/pyproject.toml index 326c65d..852a5f8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,5 +1,4 @@ [tool.black] -line-length = 120 target-version = ["py39", "py310"] exclude = 'generated'