Make work with Cast
This commit is contained in:
@@ -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>
|
||||
`;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -13,6 +13,7 @@ export const ConnectionMixin = (SuperClass) => {
|
||||
public browserEntities = {};
|
||||
|
||||
LOG(...args) {
|
||||
return;
|
||||
const dt = new Date();
|
||||
console.log(`${dt.toLocaleTimeString()}`, ...args);
|
||||
}
|
||||
|
||||
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user