Permalink
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
50 lines (47 sloc) 1.38 KB
[Module Metadata]
AUTHOR=Sarah Edwards/mac4n6.com/@iamevltwin
MODULE_NOTES=Screen Brightness Percentage
[Database Metadata]
DATABASE=CurrentPowerlog.PLSQL
PLATFORMS=IOS
VERSIONS=9,10,11,12
[Query Metadata]
QUERY_NAME=powerlog_display_brightness
ACTIVITY=Device Status
KEY_TIMESTAMP=ADJUSTED_TIMESTAMP
[SQL Query 9,10,11,12]
QUERY=
SELECT
DATETIME(BRIGHTNESS_TIMESTAMP + SYSTEM, 'unixepoch') AS ADJUSTED_TIMESTAMP,
BRIGHTNESS,
DATETIME(BRIGHTNESS_TIMESTAMP, 'unixepoch') AS ORIGINAL_BRIGHTNESS_TIMESTAMP,
DATETIME(TIME_OFFSET_TIMESTAMP, 'unixepoch') AS OFFSET_TIMESTAMP,
SYSTEM AS TIME_OFFSET,
BRIGHTNESS_ID AS "PLDISPLAYAGENT_EVENTFORWARD_DISPLAY TABLE ID"
FROM
(
SELECT
BRIGHTNESS_ID,
BRIGHTNESS_TIMESTAMP,
TIME_OFFSET_TIMESTAMP,
MAX(TIME_OFFSET_ID) AS MAX_ID,
BRIGHTNESS,
SYSTEM
FROM
(
SELECT
PLDISPLAYAGENT_EVENTFORWARD_DISPLAY.TIMESTAMP AS BRIGHTNESS_TIMESTAMP,
BRIGHTNESS,
PLDISPLAYAGENT_EVENTFORWARD_DISPLAY.ID AS "BRIGHTNESS_ID" ,
PLSTORAGEOPERATOR_EVENTFORWARD_TIMEOFFSET.TIMESTAMP AS TIME_OFFSET_TIMESTAMP,
PLSTORAGEOPERATOR_EVENTFORWARD_TIMEOFFSET.ID AS TIME_OFFSET_ID,
PLSTORAGEOPERATOR_EVENTFORWARD_TIMEOFFSET.SYSTEM
FROM
PLDISPLAYAGENT_EVENTFORWARD_DISPLAY
LEFT JOIN
PLSTORAGEOPERATOR_EVENTFORWARD_TIMEOFFSET
)
AS BRIGHTNESS_STATE
GROUP BY
BRIGHTNESS_ID
)