Fork sync
This commit is contained in:
		
						commit
						7256f16346
					
				
							
								
								
									
										14
									
								
								README.md
									
									
									
									
									
								
							
							
						
						
									
										14
									
								
								README.md
									
									
									
									
									
								
							| @ -432,5 +432,19 @@ Some of [my lovelace plugins](https://github.com/thomasloven/hass-config/wiki/My | ||||
| 
 | ||||
| Basically, just replace `service_data` with `data` or `data_template`, whichever fits your needs. | ||||
| 
 | ||||
| ### My Fully Kiosk Browser device goes unavailable after the screen has been turned off for five minutes | ||||
| 
 | ||||
| This seems to be a problem with Android, and not much to do about it. | ||||
| As a workaround you can add the following to your configuration: | ||||
| 
 | ||||
| ```yaml | ||||
| browser_mod: | ||||
|   devices: | ||||
|     d2fc860c-16379d23: # DeviceID of your FKB device | ||||
|       force_stay_awake: true | ||||
| ``` | ||||
| 
 | ||||
| That will make the screen turn on and off again for a second regularly to stop the five minute timer from running out. | ||||
| 
 | ||||
| --- | ||||
| <a href="https://www.buymeacoffee.com/uqD6KHCdJ" target="_blank"><img src="https://www.buymeacoffee.com/assets/img/custom_images/white_img.png" alt="Buy Me A Coffee" style="height: auto !important;width: auto !important;" ></a> | ||||
|  | ||||
| @ -11,15 +11,33 @@ export const FullyKioskMixin = (C) => class extends C { | ||||
|         this._fullyMotion = false; | ||||
|         this._motionTimeout = undefined; | ||||
| 
 | ||||
|         for (const event of ["screenOn", "screenOff", "pluggedAC", "pluggedUSB", "onBatteryLevelChanged", "unplugged", "networkReconnect"]) { | ||||
|             fully.bind(event, "window.browser_mod.fully_update();"); | ||||
|         for (const ev of ["screenOn", "screenOff", "pluggedAC", "pluggedUSB", "onBatteryLevelChanged", "unplugged", "networkReconnect", "onMotion"]) { | ||||
|             window.fully.bind(ev, `window.browser_mod.fully_update("${ev}");`); | ||||
|         } | ||||
| 
 | ||||
|         window.fully.bind("onMotion", "window.browser_mod.fullyMotionTriggered();"); | ||||
|         this._keepingAlive = false; | ||||
|     } | ||||
| 
 | ||||
|     fully_update() { | ||||
|     fully_update(event) { | ||||
|         if(!this.isFully) return | ||||
|         if(event === "screenOn") { | ||||
|             window.clearTimeout(this._keepAliveTimer); | ||||
|             if(!this._keepingAlive) | ||||
|                 this.screen_update(); | ||||
|         } else if (event === "screenOff") { | ||||
|             this.screen_update(); | ||||
|             this._keepingAlive = false; | ||||
|             if(this.config.force_stay_awake) { | ||||
|                 this._keepAliveTimer = window.setTimeout(() => { | ||||
|                     this._keepingAlive = true; | ||||
|                     window.fully.turnScreenOn(); | ||||
|                     window.fully.turnScreenOff(); | ||||
|                 }, 270000); | ||||
|             } | ||||
|         } else if (event === "onMotion") { | ||||
|             this.fullyMotionTriggered(); | ||||
|         } | ||||
| 
 | ||||
|         this.sendUpdate({fully: { | ||||
|             battery: window.fully.getBatteryLevel(), | ||||
|             charging: window.fully.isPlugged(), | ||||
|  | ||||
| @ -95,6 +95,7 @@ class BrowserMod extends ext(BrowserModConnection, [ | ||||
|       if(msg.camera) { | ||||
|         this.setup_camera(); | ||||
|       } | ||||
|       this.config = {...this.config, ...msg}; | ||||
|     } | ||||
|     this.player_update(); | ||||
|     this.fully_update(); | ||||
|  | ||||
| @ -42,7 +42,7 @@ export const BrowserModPopupsMixin = (C) => class extends C { | ||||
| 
 | ||||
|         const open = () => { | ||||
|             popUp( | ||||
|                 cfg.tile, | ||||
|                 cfg.title, | ||||
|                 cfg.card, | ||||
|                 cfg.large, | ||||
|                 cfg.style, | ||||
|  | ||||
| @ -29,10 +29,6 @@ export const BrowserModScreensaverMixin = (C) => class extends C { | ||||
|         `;
 | ||||
|         document.body.appendChild(this._blackout_panel); | ||||
| 
 | ||||
|         if(this.isFully) { | ||||
|             window.fully.bind("screenOn", "window.browser_mod.screen_update();"); | ||||
|             window.fully.bind("screenOff", "window.browser_mod.screen_update();"); | ||||
|         } | ||||
|     } | ||||
| 
 | ||||
|     screensaver_set(fn, clearfn, time) { | ||||
| @ -92,7 +88,7 @@ export const BrowserModScreensaverMixin = (C) => class extends C { | ||||
|         this.screensaver_set( | ||||
|             () => { | ||||
|                 if(this.isFully) | ||||
|                     window.fully.turnScreenOff(); | ||||
|                     window.fully.turnScreenOff(true); | ||||
|                 else | ||||
|                     this._blackout_panel.style.display = "block"; | ||||
|                 this.screen_update(); | ||||
| @ -109,6 +105,8 @@ export const BrowserModScreensaverMixin = (C) => class extends C { | ||||
|     } | ||||
| 
 | ||||
|     no_blackout() { | ||||
|         if(this.isFully) | ||||
|             window.fully.turnScreenOn(); | ||||
|         this.screensaver_stop(); | ||||
|     } | ||||
| 
 | ||||
|  | ||||
| @ -1,7 +1,7 @@ | ||||
| { | ||||
|   "name": "browser_mod", | ||||
|   "private": true, | ||||
|   "version": "1.2.0", | ||||
|   "version": "1.2.1", | ||||
|   "description": "", | ||||
|   "scripts": { | ||||
|     "build": "webpack", | ||||
|  | ||||
| @ -8,6 +8,8 @@ browser_mod: | ||||
|       camera: true | ||||
|     testdevice: | ||||
|       alias: test | ||||
|     fully: | ||||
|       force_stay_awake: true | ||||
| 
 | ||||
| 
 | ||||
| lovelace: | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user