Update readme

This commit is contained in:
2020-10-24 23:17:09 +02:00
parent 7d17efd961
commit b1e64c3b93
7 changed files with 19 additions and 11 deletions

View File

@@ -21,7 +21,7 @@ export const BrowserModBrowserMixin = (C) => class extends C {
fullyKiosk: this.isFully,
width: window.innerWidth,
height: window.innerHeight,
battery: this.isFully ? window.fully.getBatteryLevel() : battery ? battery.level*100 : undefined,
battery_level: this.isFully ? window.fully.getBatteryLevel() : battery ? battery.level*100 : undefined,
charging: this.isFully ? window.fully.isPlugged() : battery ? battery.charging : undefined,
}});
});

View File

@@ -77,7 +77,7 @@ class BrowserMod extends ext(BrowserModConnection, [
set_theme(msg){
if(!msg.theme) msg.theme = "default";
fireEvent("settheme", msg.theme, document.querySelector("home-assistant"));
fireEvent("settheme", {theme: msg.theme}, document.querySelector("home-assistant"));
}
lovelace_reload(msg) {
@@ -107,5 +107,4 @@ class BrowserMod extends ext(BrowserModConnection, [
const bases = [customElements.whenDefined('home-assistant'), customElements.whenDefined('hc-main')];
Promise.race(bases).then(() => {
window.browser_mod = window.browser_mod || new BrowserMod();
window.bm = (cmd) => window.browser_mod.msg_callback(cmd);
});