Skip to content

allow disable repeater adverts#115

Merged
zjs81 merged 4 commits into
mainfrom
advert-intervals
Feb 2, 2026
Merged

allow disable repeater adverts#115
zjs81 merged 4 commits into
mainfrom
advert-intervals

Conversation

@446564

@446564 446564 commented Jan 30, 2026

Copy link
Copy Markdown
Collaborator

Adds checkbox toggle switches to disable adverts and flood adverts

Also updates flood avert range to new max of 168 hours

closes #90

Adds checkbox to disable adverts and flood adverts

Also updates flood avert range to new max of 168 hours
@446564

446564 commented Jan 30, 2026

Copy link
Copy Markdown
Collaborator Author

sorry not sorry re: formatting

lines 1206-1268 are actual changes

@446564

446564 commented Jan 30, 2026

Copy link
Copy Markdown
Collaborator Author

see #90 (comment) for screens

@446564

446564 commented Jan 30, 2026

Copy link
Copy Markdown
Collaborator Author

Question: should I change the text for the subtitle to read DISABLED instead on 0 hours?

446564 and others added 3 commits January 31, 2026 17:07
move style to align with other toggles and use a switch instead of a checkbox
…alized when settings were refreshed from the device. The code would correctly update the interval values themselves, but failed to set the corresponding boolean flags that control whether the toggles appear as "on" or "off". This meant that if you refreshed settings from a device that had advertisements disabled (with an interval of zero), the toggles would incorrectly show as enabled even though the device was actually broadcasting no advertisements. We fixed this by adding two lines that explicitly set _advertEnable = _advertInterval > 0 and _floodAdvertEnable = _floodAdvertInterval > 0 after parsing the interval values from device responses.

The second critical bug was in the validation logic that checks whether responses from the device contain valid data. The validator was rejecting any interval values of zero because it checked interval > 0, but zero is now a meaningful and valid value that indicates advertisements are disabled. Without this fix, any time a device reported back that advertisements were disabled, the app would silently discard that information as invalid, leaving the UI out of sync with reality. We changed the validation to use interval >= 0 instead and updated the comment to explicitly document that zero means disabled.

The third fix was a minor code style issue where a single-line if statement was missing braces, causing a linter warning. This doesn't affect functionality but ensures the code meets project standards.
@zjs81 zjs81 merged commit 1d4c9ad into main Feb 2, 2026
12 checks passed
@446564 446564 deleted the advert-intervals branch April 8, 2026 15:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Repeater Admin: Cannot set Local Advertisement or Flood Advertisement Intervals to 0 / Disabled

2 participants