You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be nice if auto enable/disable by sunrise/sunset is implemented, just like how iOS 13 does.
I've managed to make it work by respecting night shift settings(that means no more CoreLocation stuff needed):
@interface CBBlueLightClient : NSObject typedef struct { int hour; int minute; } Time; typedef struct { Time fromTime; Time toTime; } Schedule; typedef struct { BOOL active; BOOL enabled; BOOL sunSchedulePermitted; int mode; Schedule schedule; unsigned long long disableFlags; BOOL available; } Status; -(CBBlueLightClient *)initWithClientObj:(id)arg1 ; @end
Yes, I will add an option to sync with Night Shift. I'm planning to also add a separate automatic mode though so users can chose a different time or if they don't use Night Shift.
Skittyblock
changed the title
[Todo] Add automatic settings
Sync with Night Shift
Sep 29, 2019
It would be nice if auto enable/disable by sunrise/sunset is implemented, just like how iOS 13 does.
I've managed to make it work by respecting night shift settings(that means no more CoreLocation stuff needed):
@interface CBBlueLightClient : NSObject
typedef struct {
int hour;
int minute;
} Time;
typedef struct {
Time fromTime;
Time toTime;
} Schedule;
typedef struct {
BOOL active;
BOOL enabled;
BOOL sunSchedulePermitted;
int mode;
Schedule schedule;
unsigned long long disableFlags;
BOOL available;
} Status;
-(CBBlueLightClient *)initWithClientObj:(id)arg1 ;
@end
%hook CBBlueLightClient
-(CBBlueLightClient *)initWithClientObj:(id)arg1 {
CBBlueLightClient *client = %orig;
void (^notificationBlock)() = ^() {
Status status;
[client getBlueLightStatus:&status];
if (status.mode == 1) { //mode 1 means sunset/sunrise mode
if (status.enabled) notify_post(@"xyz.skitty.dune.enabled".UTF8String);
else notify_post(@"xyz.skitty.dune.disabled".UTF8String);
}
};
[client setStatusNotificationBlock:notificationBlock];
return %orig;
}
%end
The text was updated successfully, but these errors were encountered: