Skip to content

Commit

Permalink
Merge pull request #14 from dbochicchio/main
Browse files Browse the repository at this point in the history
Dark mode fix
  • Loading branch information
lanrat authored Dec 21, 2023
2 parents 0aea492 + 2c7d285 commit 24b7a26
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Home Assistant related stuff:
| `HA_SCREENSHOT_URL` | `/lovelace/screensaver?kiosk` | yes | yes | Relative URL to take screenshot of (btw, the `?kiosk` parameter hides the nav bar using the [kiosk mode](https://github.com/maykar/kiosk-mode) project) |
| `HA_ACCESS_TOKEN` | `eyJ0...` | yes | no | Long-lived access token from Home Assistant, see [official docs](https://developers.home-assistant.io/docs/auth_api/#long-lived-access-token) |
| `LANGUAGE` | `en` | no | no | Language to set in browser and home assistant |
| `PREFERS_COLOR_SCHEME` | `light` | no | no | Enable browser dark mode, use `light` or `dark`. |
| `PREFERS_COLOR_SCHEME` | `light` | no | yes | Enable browser dark mode, use `light` or `dark`. |
| `CRON_JOB` | `* * * * *` | no | no | How often to take screenshot |
| `RENDERING_TIMEOUT` | `10000` | no | no | Timeout of render process, helpful if your HASS instance might be down |
| `RENDERING_DELAY` | `0` | no | yes | how long to wait between navigating to the page and taking the screenshot, in milliseconds |
Expand All @@ -43,7 +43,7 @@ Home Assistant related stuff:
| `DITHER` | `false` | no | yes | Apply a dither to the images. |
| `REAL_TIME` | `false` | no | no | Disables cron and renders images as they are requests to save CPU |
| `REAL_TIME_CACHE_SEC` | `60` | no | yes | How long to cache images for when `REAL_TIME` is set to true |
| `REMOVE_GAMMA` | `true` | no | no | Remove gamma correction from image. Computer images are normally gamma corrected since monitors expect gamma corrected data, however some E-Ink displays expect images not to have gamma correction. |
| `REMOVE_GAMMA` | `true` | no | no | Remove gamma correction from image. Computer images are normally gamma corrected since monitors expect gamma corrected data, however some E-Ink displays expect images not to have gamma correction. |
| `MQTT_SERVER` | `` | no | no | MQTT hostname to report values to |
| `MQTT_USERNAME` | `` | no | no | MQTT authentication username if required |
| `MQTT_PASSWORD` | `` | no | no | MQTT authentication password if required |
Expand Down
5 changes: 2 additions & 3 deletions config.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,14 @@ function getPagesConfig() {
),
renderingDelay: getEnvironmentVariable("RENDERING_DELAY", suffix) || 0,
renderingScreenSize: {
height:
getEnvironmentVariable("RENDERING_SCREEN_HEIGHT", suffix) || 800,
height: getEnvironmentVariable("RENDERING_SCREEN_HEIGHT", suffix) || 800,
width: getEnvironmentVariable("RENDERING_SCREEN_WIDTH", suffix) || 600,
},
grayscaleDepth: getEnvironmentVariable("GRAYSCALE_DEPTH", suffix) || 8,
removeGamma: getEnvironmentVariable("REMOVE_GAMMA", suffix) || false,
dither: getEnvironmentVariable("DITHER", suffix) || false,
colorMode: getEnvironmentVariable("COLOR_MODE", suffix) || "GrayScale",
refersColorScheme: getEnvironmentVariable("PREFERS_COLOR_SCHEME", suffix) || "light",
prefersColorScheme: getEnvironmentVariable("PREFERS_COLOR_SCHEME", suffix) || "light",
rotation: getEnvironmentVariable("ROTATION", suffix) || 0,
scaling: getEnvironmentVariable("SCALING", suffix) || 1,
batteryWebHook: getEnvironmentVariable("HA_BATTERY_WEBHOOK", suffix) || null,
Expand Down
1 change: 0 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,6 @@ async function renderAndConvertPageAsync(browser, pageConfig) {
pageCacheTimes[pageConfig.screenShotUrl] = new Date();
}


async function renderUrlToImageAsync(browser, pageConfig, url, path) {
let page;
try {
Expand Down

0 comments on commit 24b7a26

Please sign in to comment.