Skip to content

feat: WiFi BSSID based alarm cancellation (Addition to Smart Controls) #822

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

kushchoudhary98
Copy link
Contributor

Description

This PR adds a new condition, WiFi Based alarm cancellation, to the Smart Controls.

By using this feature, the user will be able to auto-cancel the alarm when their device is connected to the specified Wi-Fi network.

There may occur three different conditions when alarm is about to ring (when this feature is turned ON):

  • Device connected to the same Wi-Fi Network.
  • Device connected to a different Wi-Fi Network.
  • Device not connected to any Wi-Fi Network.

Screenshot 2025-04-17 at 6 54 50 PM

Proposed Changes

  • To the Alarm Model & Profile Model

isWifiEnabled INTEGER NOT NULL DEFAULT 0,
wifiName TEXT,
wifiBSSID TEXT
  • A new file wifi_based_tile.dart
  • A new Service WifiManagerService.kt

Fixes #802

Screenshots

Screenshot 2025-04-17 at 7 09 52 PM

Screenshot 2025-04-17 at 7 11 32 PM

Checklist

  • Tests have been added or updated to cover the changes
  • Documentation has been updated to reflect the changes
  • Code follows the established coding style guidelines
  • All tests are passing

@kushchoudhary98
Copy link
Contributor Author

Hey @MarkisDev, can you please review this.
And lemme know if anything is out of its place :)

@mahendra-918
Copy link
Contributor

Hii @kushchoudhary98 i have tested the wifi SSID based in my device iam getting an issue

WhatsApp.Video.2025-04-18.at.02.27.14.mp4

the issue is when clicking on the WiFi SSID smart control, it's calling the controller's checkAndRequestPermission() method which is designed for location permissions, not WiFi permissions. This is why the dialog isn't properly opening.

@kushchoudhary98
Copy link
Contributor Author

@mahendra-918 as a matter of fact, this is also an issue with Location-Based & Weather-Based conditions.
I think it's an issue with the checkAndRequestPermission(), right? I used this function since the wifi state permissions are the same as those for location.

Screenshot 2025-04-21 at 1 25 54 PM

In the below video I denied Location access and it still allows me to select the Weather Types and opens the menu for Location Selection.

WhatsApp.Video.2025-04-21.at.13.15.52.mp4

And If I go ahead with it, the app crashes...

WhatsApp Image 2025-04-21 at 13 15 38

@kushchoudhary98
Copy link
Contributor Author

I will soon be raising a PR for this. Great find @mahendra-918.

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.

Feature: Add conditions to being connected or not connected to specific WiFi's SSID
2 participants