-
Notifications
You must be signed in to change notification settings - Fork 32
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
fix: trigger outside mobile cell event when connected cell is not any… #131
Conversation
… list When current connected mobile cell is not on any defined list, "Mobile cell sensor" with enabled "start when outside..." stay inactive. Adding this cell to any other list make this sensor work ok. In this form this feature has very limited usability. Problem is result of getting list of cells filtered by current connected cell (db.addMobileCellsToList(_cellsList, registeredCell)) and do next checks only when this list is not empty. If we are connected to unknown cell (list is empty), no more check are performed even when we check "outside". Now, when cells list is empty, default result depend on _whenOutside, so empty list and "outside" enabled trigger event. When "outside" is false, there is no change in behaviour.
But "Start when outside mobile cells" is ony for CONFIGURED mobile cells. Not configured are ignored. This is the same also for:
Not exists parameter similar to "Not configured..." and is not planed to implement it. |
Sorry, will not be merged. |
Hi, sorry, i couldn't answer earlier. Ok, but imho this behavior is at least confusing. Maybe this should be more highlighted. My usecase is quite simple - I have "home" cells list and want to set some profiles when I outside this area. I don't want to configure all cells in the world. (this is simplified - due to other rules I need to add many more rules to handle it; my change simplify it a lot). From other side - I not sure what is purpose to this switch - if I need to specify all "outside" cells in any list I guess I can simple select this "other" list and don't use "outside" switch at all. I don't use other sensors from list above, maybe there is different situation. However years ago (other soft) I have rule "when I have not connected to one of may trusted wifi network - start vpn". If I need add all "temporary" wifi networks to some list to get if work - imho something is wrong. Regards, |
Example: in event are configured all cells at home. This is 5-6 cells in my home. |
Yes, i try it already. But it not work. Cell must be added to any other list to trigger home + outside. So seems to be bug. Maybe I'm wrong, but looking into code you get |
Sorry, I do not understand. But: sensor uses only saved mobile cells, saved to db by mobile cells scanner. "db.addMobileCellsToList(_cellsList, registeredCell)" adds cells from DB to _cellsList. And if registeredCell is not 0, then adds only this cell. Mobile cells scanner is running in background and saves connected cells to db. And yes, if registeredCell is not in saved cells, then returned is empty list. |
Important: registeredCell is not cell saved to db by scanner or configured in sensor. It is cell returned by system. To this cell is mobile actually connected. |
Example: Mobile is connected to cell, which is not in sensor and in db. Then how to check it? If you are at home and mobile is connected to new, not saved, not configured cell, then is not possible to mark it as "inside" of home. It is unknown cell. It must be saved by scanner and added to configured cells in sensor. By me, better is ignoring this cell. |
I understand. There is no problem with ignoring cell when "Start when outside..." is off. But for rules with enable "outside", connection to unknown cell should not be ignored, and imo PPP should take it into consideration. After all we are "outside" given list (all lists to be precise). My patch change behavior only when "Start when outside..." is on - if current connected cell is not registered in PPP - result of sensor is positive. So rules are property activated. Anyway - this patch solve this problem for me, but if there is other idea for this - no problem. I thought this was a some kind of bug... regards, |
…n is checked "Start when outside mobile cell".
Hm, but. When mobile IS outside of home, then is better to set pass status to true. :-) Hm, Hm. |
Impleneted. If you want, install and test this beta version: |
Thank you. |
… list
When current connected mobile cell is not on any defined list, "Mobile cell sensor" with enabled "start when outside..." stay inactive. Adding this cell to any other list make this sensor work ok. In this form this feature has very limited usability.
Problem is result of getting list of cells filtered by current connected cell (db.addMobileCellsToList(_cellsList, registeredCell)) and do next checks only when this list is not empty. If we are connected to unknown cell (list is empty), no more check are performed even when we check "outside".
Now, when cells list is empty, default result depend on _whenOutside, so empty list and "outside" enabled trigger event. When "outside" is false, there is no change in behaviour.