forked from pieterjm/DeviceTimer
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmodels.py
More file actions
59 lines (49 loc) · 1.2 KB
/
models.py
File metadata and controls
59 lines (49 loc) · 1.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
from typing import List, Optional
from enum import Enum
from pydantic import BaseModel
class PaymentAllowed(Enum):
OPEN = 1
CLOSED = 2
WAIT = 3
class LnurldeviceSwitch(BaseModel):
id: Optional[str] = None
amount: float = 0.0
gpio_pin: int = 21
gpio_duration: int = 2100
lnurl: Optional[str] = None
label: Optional[str] = None
class CreateLnurldevice(BaseModel):
title: str
wallet: str
currency: str
available_start: str
available_stop: str
timeout: int
timezone: str
maxperday: Optional[int] = None
closed_url: Optional[str] = None
wait_url: Optional[str] = None
switches: Optional[List[LnurldeviceSwitch]] = None
class Lnurldevice(BaseModel):
id: str
key: str
title: str
wallet: str
currency: str
switches: List[LnurldeviceSwitch] = []
timestamp: str = ""
available_start: str
available_stop: str
timeout: int
timezone: str
maxperday: Optional[int] = None
closed_url: Optional[str] = None
wait_url: Optional[str] = None
class LnurldevicePayment(BaseModel):
id: str
deviceid: str
payhash: str
payload: str
switchid: str
sats: int
timestamp: str = ""