Skip to content

Commit

Permalink
use fire instead of async_fire
Browse files Browse the repository at this point in the history
  • Loading branch information
Giga77 committed Apr 26, 2024
1 parent f3d8f1a commit 1689399
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion custom_components/ecole_directe/coordinator.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,4 +216,4 @@ def trigger_event(self, event_type, eleve: EDEleve, event_data):
"type": event_type,
"data": event_data,
}
self.hass.bus.async_fire(EVENT_TYPE, event_data)
self.hass.bus.fire(EVENT_TYPE, event_data)
8 changes: 6 additions & 2 deletions custom_components/ecole_directe/ecole_directe_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -356,8 +356,12 @@ def get_ecoledirecte_session(data, config_path, hass) -> EDSession | None:
encoding="utf-8",
) as f:
json.dump(qcm_json, f, ensure_ascii=False, indent=4)
event_data = {"type": "new_qcm", "question": question}
hass.bus.async_fire(EVENT_TYPE, event_data)
event_data = {
"device_id": "ED - " + data["username"],
"type": "new_qcm",
"question": question,
}
hass.bus.fire(EVENT_TYPE, event_data)

try_login -= 1

Expand Down

0 comments on commit 1689399

Please sign in to comment.