Add Backend.devices ListModelMap

The Device ListModels will be populated after login.
This commit is contained in:
miruka
2019-05-09 13:58:46 -04:00
parent a15f6b0bac
commit 1a90bb4331
5 changed files with 79 additions and 23 deletions

View File

@@ -1,3 +1,4 @@
from enum import Enum
from typing import Any, Dict, List, Optional
from PyQt5.QtCore import QDateTime, QSortFilterProxyModel
@@ -42,6 +43,22 @@ class RoomCategory(ListItem):
sortedRooms: QSortFilterProxyModel = QSortFilterProxyModel()
class Trust(Enum):
blacklisted = -1
undecided = 0
trusted = 1
class Device(ListItem):
_required_init_values = {"deviceId", "ed25519Key"}
_constant = {"deviceId", "ed25519Key"}
deviceId: str = ""
ed25519Key: str = ""
displayName: Optional[str] = None
trust: Trust = Trust.undecided
class Account(ListItem):
_required_init_values = {"userId", "roomCategories"}
_constant = {"userId", "roomCategories"}