mirror of
https://github.com/home-assistant/core.git
synced 2025-07-27 07:07:28 +00:00
Fix implicit-return in fixer (#122841)
This commit is contained in:
parent
41c7414d97
commit
27eba3cd46
@ -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."""
|
||||||
|
Loading…
x
Reference in New Issue
Block a user