File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1042,17 +1042,18 @@ function handleBackgroundUpdate() {
10421042 // Check if event is not later than current time, last event time, or last found time
10431043 if ( hour >= eventHour || ( hour == eventHour && minute >= eventMinute ) ) {
10441044 // Check if found event is greater than last found event
1045- if ( foundEvent === false || foundEvent . hour < eventHour || ! ( foundEvent . hour == eventHour && foundEvent . minute > eventMinute ) ) {
1046- foundEvent = Object . assign ( event , { } )
1045+ if ( foundEvent === false || foundEvent . hour < eventHour || ( foundEvent . hour == eventHour && foundEvent . minute <= eventMinute ) ) {
1046+ foundEvent = Object . assign ( { } , event )
10471047 foundEvent . minute = eventMinute
10481048 foundEvent . hour = eventHour
1049+ console . log ( foundEvent )
10491050 }
10501051 }
10511052 }
10521053 if ( foundEvent ) {
10531054 if ( lastTimeEvent == false || lastTimeEvent . hour < foundEvent . hour || ( lastTimeEvent . hour == foundEvent . hour && lastTimeEvent . minute < foundEvent . minute ) ) {
10541055 console . log ( "Adjusting brightness automatically" , foundEvent )
1055- lastTimeEvent = foundEvent
1056+ lastTimeEvent = Object . assign ( { } , foundEvent )
10561057 lastTimeEvent . day = new Date ( ) . getDate ( )
10571058 refreshMonitors ( ) . then ( ( ) => {
10581059 transitionBrightness ( foundEvent . brightness , ( foundEvent . monitors ? foundEvent . monitors : { } ) )
You can’t perform that action at this time.
0 commit comments