Skip to content

Commit

Permalink
Fix #58
Browse files Browse the repository at this point in the history
  • Loading branch information
dmunozv04 committed Oct 13, 2023
1 parent d7a8303 commit d0846b7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions iSponsorBlockTV/setup_wizard.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,12 +226,12 @@ def handle_switch_buttons(self, event: Button.Pressed) -> None:

@on(Input.Changed, "#pairing-code-input")
def changed_pairing_code(self, event: Input.Changed):
self.query_one("#add-device-button").disabled = not event.validation_result.is_valid
self.query_one("#add-device-pin-add-button").disabled = not event.validation_result.is_valid

@on(Input.Submitted, "#pairing-code-input")
@on(Button.Pressed, "#add-device-pin-add-button")
async def handle_add_device_pin(self) -> None:
self.query_one("#add-device-button").disabled = True
self.query_one("#add-device-pin-add-button").disabled = True
lounge_controller = ytlounge.YtLoungeApi("iSponsorBlockTV")
pairing_code = self.query_one("#pairing-code-input").value
pairing_code = int(pairing_code.replace("-", "").replace(" ", "")) # remove dashes and spaces
Expand All @@ -253,7 +253,7 @@ async def handle_add_device_pin(self) -> None:
self.dismiss([device])
else:
self.query_one("#pairing-code-input").value = ""
self.query_one("#add-device-button").disabled = False
self.query_one("#add-device-pin-add-button").disabled = False
self.query_one("#add-device-info").update("[#ff0000]Failed to add device")

@on(Button.Pressed, "#add-device-dial-add-button")
Expand Down

0 comments on commit d0846b7

Please sign in to comment.