Make work with Cast

This commit is contained in:
2022-07-24 18:54:22 +00:00
parent 02c8f91690
commit 1cb64a2c8d
10 changed files with 85 additions and 18 deletions

View File

@@ -28,7 +28,7 @@ class BrowserModRegisteredBrowsersCard extends LitElement {
window.browser_mod.showPopup(
"Unregister browser",
`Are you sure you want to unregister browser ${browserID}?`,
`Are you sure you want to unregister Browser ${browserID}?`,
{
right_button: "Yes",
right_button_action: unregisterCallback,
@@ -37,6 +37,13 @@ class BrowserModRegisteredBrowsersCard extends LitElement {
);
}
register_cast() {
window.browser_mod.connection.sendMessage({
type: "browser_mod/register",
browserID: "CAST",
});
}
render() {
return html`
<ha-card header="Registered Browsers" outlined>
@@ -57,6 +64,15 @@ class BrowserModRegisteredBrowsersCard extends LitElement {
</ha-settings-row>`
)}
</div>
${window.browser_mod.browsers["CAST"] === undefined
? html`
<div class="card-actions">
<mwc-button @click=${this.register_cast}>
Register CAST Browser
</mwc-button>
</div>
`
: ""}
</ha-card>
`;
}

View File

@@ -21,6 +21,7 @@ export const BrowserIDMixin = (SuperClass) => {
}
get browserID() {
if (document.querySelector("hc-main")) return "CAST";
if (localStorage[ID_STORAGE_KEY]) return localStorage[ID_STORAGE_KEY];
this.browserID = "";
return this.browserID;

View File

@@ -13,6 +13,7 @@ export const ConnectionMixin = (SuperClass) => {
public browserEntities = {};
LOG(...args) {
return;
const dt = new Date();
console.log(`${dt.toLocaleTimeString()}`, ...args);
}

View File

@@ -60,12 +60,12 @@ import { BrowserIDMixin } from "./browserID";
x Title templates
- Tweaks
- Quickbar tweaks (ctrl+enter)?
- Card-mod preload
x Card-mod preload
- Video player?
- Media_seek
- Screensavers
- IMPORTANT: FIX DEFAULT HIDING OF ENTITIES
- Check functionality with CAST - may need to add frontend part as a lovelace resource
X Check functionality with CAST - may need to add frontend part as a lovelace resource
*/
export class BrowserMod extends ServicesMixin(
PopupMixin(