diff --git a/homeassistant/components/matrix/__init__.py b/homeassistant/components/matrix/__init__.py index 84fafd3f068..febafc367f1 100644 --- a/homeassistant/components/matrix/__init__.py +++ b/homeassistant/components/matrix/__init__.py @@ -21,7 +21,7 @@ from homeassistant.exceptions import HomeAssistantError import homeassistant.helpers.config_validation as cv from homeassistant.helpers.json import save_json from homeassistant.helpers.typing import ConfigType -from homeassistant.util.json import load_json +from homeassistant.util.json import JsonObjectType, load_json_object from .const import DOMAIN, FORMAT_HTML, FORMAT_TEXT, SERVICE_SEND_MESSAGE @@ -276,15 +276,13 @@ class MatrixBot: except MatrixRequestError as ex: _LOGGER.error("Could not join room %s: %s", room_id, ex) - def _get_auth_tokens(self): + def _get_auth_tokens(self) -> JsonObjectType: """Read sorted authentication tokens from disk. Returns the auth_tokens dictionary. """ try: - auth_tokens = load_json(self._session_filepath) - - return auth_tokens + return load_json_object(self._session_filepath) except HomeAssistantError as ex: _LOGGER.warning( "Loading authentication tokens from file '%s' failed: %s",