Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions homeassistant/components/matrix/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
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

Expand Down Expand Up @@ -276,15 +276,13 @@ def _join_rooms(self):
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",
Expand Down