|
| JsonObjectType | _get_auth_tokens (self) |
| |
| None | _handle_multi_room_send (self, Sequence[RoomAnyID] target_rooms, str message_type, dict content) |
| |
| None | _handle_room_message (self, MatrixRoom room, Event message) |
| |
| None | _handle_room_send (self, RoomAnyID target_room, str message_type, dict content) |
| |
| None | _join_room (self, RoomID room_id, RoomAnyID room_alias_or_id) |
| |
| None | _join_rooms (self) |
| |
| None | _load_commands (self, list[ConfigCommand] commands) |
| |
| None | _login (self) |
| |
| dict[RoomAnyID, RoomID] | _resolve_room_alias (self, RoomAnyID room_alias_or_id) |
| |
| None | _resolve_room_aliases (self, list[RoomAnyID] listening_rooms) |
| |
| None | _send_image (self, str image_path, Sequence[RoomAnyID] target_rooms) |
| |
| None | _send_message (self, str message, list[RoomAnyID] target_rooms, dict|None data) |
| |
| None | _store_auth_token (self, str token) |
| |
The Matrix Bot.
Definition at line 162 of file __init__.py.
◆ __init__()
| None homeassistant.components.matrix.MatrixBot.__init__ |
( |
|
self, |
|
|
HomeAssistant |
hass, |
|
|
str |
config_file, |
|
|
str |
homeserver, |
|
|
bool |
verify_ssl, |
|
|
str |
username, |
|
|
str |
password, |
|
|
list[RoomAnyID] |
listening_rooms, |
|
|
list[ConfigCommand] |
commands |
|
) |
| |
◆ _get_auth_tokens()
| JsonObjectType homeassistant.components.matrix.MatrixBot._get_auth_tokens |
( |
|
self | ) |
|
|
private |
Read sorted authentication tokens from disk.
Definition at line 349 of file __init__.py.
◆ _handle_multi_room_send()
| None homeassistant.components.matrix.MatrixBot._handle_multi_room_send |
( |
|
self, |
|
|
Sequence[RoomAnyID] |
target_rooms, |
|
|
str |
message_type, |
|
|
dict
|
content |
|
) |
| |
|
private |
Wrap _handle_room_send for multiple target_rooms.
Definition at line 444 of file __init__.py.
◆ _handle_room_message()
| None homeassistant.components.matrix.MatrixBot._handle_room_message |
( |
|
self, |
|
|
MatrixRoom |
room, |
|
|
Event |
message |
|
) |
| |
|
private |
Handle a message sent to a Matrix room.
Definition at line 249 of file __init__.py.
◆ _handle_room_send()
| None homeassistant.components.matrix.MatrixBot._handle_room_send |
( |
|
self, |
|
|
RoomAnyID |
target_room, |
|
|
str |
message_type, |
|
|
dict
|
content |
|
) |
| |
|
private |
Wrap _client.room_send and handle ErrorResponses.
Definition at line 426 of file __init__.py.
◆ _join_room()
| None homeassistant.components.matrix.MatrixBot._join_room |
( |
|
self, |
|
|
RoomID |
room_id, |
|
|
RoomAnyID |
room_alias_or_id |
|
) |
| |
|
private |
Join a room or do nothing if already joined.
Definition at line 326 of file __init__.py.
◆ _join_rooms()
| None homeassistant.components.matrix.MatrixBot._join_rooms |
( |
|
self | ) |
|
|
private |
Join the Matrix rooms that we listen for commands in.
Definition at line 339 of file __init__.py.
◆ _load_commands()
| None homeassistant.components.matrix.MatrixBot._load_commands |
( |
|
self, |
|
|
list[ConfigCommand] |
commands |
|
) |
| |
|
private |
◆ _login()
| None homeassistant.components.matrix.MatrixBot._login |
( |
|
self | ) |
|
|
private |
Log in to the Matrix homeserver.
Attempts to use the stored access token.
If that fails, then tries using the password.
If that also fails, raises LocalProtocolError.
Definition at line 374 of file __init__.py.
◆ _resolve_room_alias()
| dict[RoomAnyID, RoomID] homeassistant.components.matrix.MatrixBot._resolve_room_alias |
( |
|
self, |
|
|
RoomAnyID
|
room_alias_or_id |
|
) |
| |
|
private |
Resolve a single RoomAlias if needed.
Definition at line 288 of file __init__.py.
◆ _resolve_room_aliases()
| None homeassistant.components.matrix.MatrixBot._resolve_room_aliases |
( |
|
self, |
|
|
list[RoomAnyID] |
listening_rooms |
|
) |
| |
|
private |
Resolve any RoomAliases into RoomIDs for the purpose of client interactions.
Definition at line 315 of file __init__.py.
◆ _send_image()
| None homeassistant.components.matrix.MatrixBot._send_image |
( |
|
self, |
|
|
str |
image_path, |
|
|
Sequence[RoomAnyID]
|
target_rooms |
|
) |
| |
|
private |
Upload an image, then send it to all target_rooms.
Definition at line 460 of file __init__.py.
◆ _send_message()
| None homeassistant.components.matrix.MatrixBot._send_message |
( |
|
self, |
|
|
str |
message, |
|
|
list[RoomAnyID] |
target_rooms, |
|
|
dict | None
|
data |
|
) |
| |
|
private |
Send a message to the Matrix server.
Definition at line 513 of file __init__.py.
◆ _store_auth_token()
| None homeassistant.components.matrix.MatrixBot._store_auth_token |
( |
|
self, |
|
|
str |
token |
|
) |
| |
|
private |
Store authentication token to session and persistent storage.
Definition at line 363 of file __init__.py.
◆ handle_send_message()
| None homeassistant.components.matrix.MatrixBot.handle_send_message |
( |
|
self, |
|
|
ServiceCall |
service |
|
) |
| |
Handle the send_message service.
Definition at line 538 of file __init__.py.
◆ _access_tokens
| homeassistant.components.matrix.MatrixBot._access_tokens |
|
private |
◆ _client
| homeassistant.components.matrix.MatrixBot._client |
|
private |
◆ _homeserver
| homeassistant.components.matrix.MatrixBot._homeserver |
|
private |
◆ _mx_id
| homeassistant.components.matrix.MatrixBot._mx_id |
|
private |
◆ _password
| homeassistant.components.matrix.MatrixBot._password |
|
private |
◆ _session_filepath
| homeassistant.components.matrix.MatrixBot._session_filepath |
|
private |
◆ _unparsed_commands
| homeassistant.components.matrix.MatrixBot._unparsed_commands |
|
private |
◆ _verify_tls
| homeassistant.components.matrix.MatrixBot._verify_tls |
|
private |
◆ hass
| homeassistant.components.matrix.MatrixBot.hass |
The documentation for this class was generated from the following file: