Skip to content
Open
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions models.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ class Switch(BaseModel):
pin: int = 0
comment: bool = False
variable: bool = False
max_variable: int = 100
label: str | None = None


Expand Down
8 changes: 8 additions & 0 deletions static/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,14 @@
>Variable time (Amount * Duration)</q-tooltip
></q-checkbox
>
<q-input
v-if="_switch.variable"
filled
dense
v-model.number="_switch.max_variable"
type="number"
label="Max multiplier"
></q-input>
<q-checkbox
v-model="_switch.comment"
color="primary"
Expand Down
4 changes: 2 additions & 2 deletions views_lnurl.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ async def lnurl_params(
)
* 1000
)
# let the max be 100x the min if variable pricing is enabled
max_sendable = price_msat * 100 if _switch.variable else price_msat
# let the max be max_variable times the min if variable pricing is enabled
max_sendable = price_msat * _switch.max_variable if _switch.variable else price_msat
url = request.url_for("bitcoinswitch.lnurl_cb", switch_id=bitcoinswitch_id, pin=pin)
try:
callback_url = parse_obj_as(CallbackUrl, str(url))
Expand Down