Fix implicit-return in fixer (#122841)

This commit is contained in:
epenet 2024-07-30 15:24:35 +02:00 committed by GitHub
parent 41c7414d97
commit 27eba3cd46
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -4,6 +4,7 @@ from __future__ import annotations
from datetime import timedelta from datetime import timedelta
import logging import logging
from typing import Any
from fixerio import Fixerio from fixerio import Fixerio
from fixerio.exceptions import FixerioException from fixerio.exceptions import FixerioException
@ -89,13 +90,14 @@ class ExchangeRateSensor(SensorEntity):
return self._state return self._state
@property @property
def extra_state_attributes(self): def extra_state_attributes(self) -> dict[str, Any] | None:
"""Return the state attributes.""" """Return the state attributes."""
if self.data.rate is not None: if self.data.rate is not None:
return { return {
ATTR_EXCHANGE_RATE: self.data.rate["rates"][self._target], ATTR_EXCHANGE_RATE: self.data.rate["rates"][self._target],
ATTR_TARGET: self._target, ATTR_TARGET: self._target,
} }
return None
def update(self) -> None: def update(self) -> None:
"""Get the latest data and updates the states.""" """Get the latest data and updates the states."""