2.0
Juraj Nyíri 3 years ago
parent 76aed359f6
commit 5b35249491

@ -19268,6 +19268,27 @@ class PlexMeetsHomeAssistantEditor extends HTMLElement {
token.label = 'Plex Token'; token.label = 'Plex Token';
token.value = this.config.token; token.value = this.config.token;
this.content.appendChild(token); this.content.appendChild(token);
const port = document.createElement('paper-input');
port.label = 'Plex Port';
port.value = this.config.port;
port.type = 'number';
this.content.appendChild(port);
const addLibraryItem = (text) => {
const libraryItem = document.createElement('paper-item');
libraryItem.innerHTML = text;
return libraryItem;
};
const library = document.createElement('paper-dropdown-menu');
const libraryItems = document.createElement('paper-listbox');
libraryItems.appendChild(addLibraryItem('Continue Watching'));
libraryItems.appendChild(addLibraryItem('Deck'));
libraryItems.appendChild(addLibraryItem('Recently Added'));
libraryItems.appendChild(addLibraryItem('Watch Next'));
libraryItems.slot = 'dropdown-content';
library.label = 'Plex Library';
library.appendChild(libraryItems);
library.style.width = '100%';
this.content.appendChild(library);
this.appendChild(this.content); this.appendChild(this.content);
this.fireEvent(this, 'config-changed', { config: this.config }); // todo remove me this.fireEvent(this, 'config-changed', { config: this.config }); // todo remove me
}; };

137
package-lock.json generated

@ -88,6 +88,35 @@
"@polymer/polymer": "^3.0.0" "@polymer/polymer": "^3.0.0"
} }
}, },
"@polymer/iron-checked-element-behavior": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/@polymer/iron-checked-element-behavior/-/iron-checked-element-behavior-3.0.1.tgz",
"integrity": "sha512-aDr0cbCNVq49q+pOqa6CZutFh+wWpwPMLpEth9swx+GkAj+gCURhuQkaUYhIo5f2egDbEioR1aeHMnPlU9dQZA==",
"requires": {
"@polymer/iron-form-element-behavior": "^3.0.0-pre.26",
"@polymer/iron-validatable-behavior": "^3.0.0-pre.26",
"@polymer/polymer": "^3.0.0"
}
},
"@polymer/iron-dropdown": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/@polymer/iron-dropdown/-/iron-dropdown-3.0.1.tgz",
"integrity": "sha512-22yLhepfcKjuQMfFmRHi/9MPKTqkzgRrmWWW0P5uqK++xle53k2QBO5VYUAYiCN3ZcxIi9lEhZ9YWGeQj2JBig==",
"requires": {
"@polymer/iron-behaviors": "^3.0.0-pre.26",
"@polymer/iron-overlay-behavior": "^3.0.0-pre.27",
"@polymer/neon-animation": "^3.0.0-pre.26",
"@polymer/polymer": "^3.0.0"
}
},
"@polymer/iron-fit-behavior": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/@polymer/iron-fit-behavior/-/iron-fit-behavior-3.1.0.tgz",
"integrity": "sha512-ABcgIYqrjhmUT8tiuolqeGttF/8pd3sEymUDrO1vXbZu4FWIvoLNndrMDFvs++AGd12Mjf5pYy84NJc6dB8Vig==",
"requires": {
"@polymer/polymer": "^3.0.0"
}
},
"@polymer/iron-flex-layout": { "@polymer/iron-flex-layout": {
"version": "3.0.1", "version": "3.0.1",
"resolved": "https://registry.npmjs.org/@polymer/iron-flex-layout/-/iron-flex-layout-3.0.1.tgz", "resolved": "https://registry.npmjs.org/@polymer/iron-flex-layout/-/iron-flex-layout-3.0.1.tgz",
@ -104,6 +133,25 @@
"@polymer/polymer": "^3.0.0" "@polymer/polymer": "^3.0.0"
} }
}, },
"@polymer/iron-icon": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/@polymer/iron-icon/-/iron-icon-3.0.1.tgz",
"integrity": "sha512-QLPwirk+UPZNaLnMew9VludXA4CWUCenRewgEcGYwdzVgDPCDbXxy6vRJjmweZobMQv/oVLppT2JZtJFnPxX6g==",
"requires": {
"@polymer/iron-flex-layout": "^3.0.0-pre.26",
"@polymer/iron-meta": "^3.0.0-pre.26",
"@polymer/polymer": "^3.0.0"
}
},
"@polymer/iron-iconset-svg": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/@polymer/iron-iconset-svg/-/iron-iconset-svg-3.0.1.tgz",
"integrity": "sha512-XNwURbNHRw6u2fJe05O5fMYye6GSgDlDqCO+q6K1zAnKIrpgZwf2vTkBd5uCcZwsN0FyCB3mvNZx4jkh85dRDw==",
"requires": {
"@polymer/iron-meta": "^3.0.0-pre.26",
"@polymer/polymer": "^3.0.0"
}
},
"@polymer/iron-input": { "@polymer/iron-input": {
"version": "3.0.1", "version": "3.0.1",
"resolved": "https://registry.npmjs.org/@polymer/iron-input/-/iron-input-3.0.1.tgz", "resolved": "https://registry.npmjs.org/@polymer/iron-input/-/iron-input-3.0.1.tgz",
@ -122,6 +170,33 @@
"@polymer/polymer": "^3.0.0" "@polymer/polymer": "^3.0.0"
} }
}, },
"@polymer/iron-overlay-behavior": {
"version": "3.0.3",
"resolved": "https://registry.npmjs.org/@polymer/iron-overlay-behavior/-/iron-overlay-behavior-3.0.3.tgz",
"integrity": "sha512-Q/Fp0+uOQQ145ebZ7T8Cxl4m1tUKYjyymkjcL2rXUm+aDQGb1wA1M1LYxUF5YBqd+9lipE0PTIiYwA2ZL/sznA==",
"requires": {
"@polymer/iron-a11y-keys-behavior": "^3.0.0-pre.26",
"@polymer/iron-fit-behavior": "^3.0.0-pre.26",
"@polymer/iron-resizable-behavior": "^3.0.0-pre.26",
"@polymer/polymer": "^3.0.0"
}
},
"@polymer/iron-resizable-behavior": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/@polymer/iron-resizable-behavior/-/iron-resizable-behavior-3.0.1.tgz",
"integrity": "sha512-FyHxRxFspVoRaeZSWpT3y0C9awomb4tXXolIJcZ7RvXhMP632V5lez+ch5G5SwK0LpnAPkg35eB0LPMFv+YMMQ==",
"requires": {
"@polymer/polymer": "^3.0.0"
}
},
"@polymer/iron-selector": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/@polymer/iron-selector/-/iron-selector-3.0.1.tgz",
"integrity": "sha512-sBVk2uas6prW0glUe2xEJJYlvxmYzM40Au9OKbfDK2Qekou/fLKcBRyIYI39kuI8zWRaip8f3CI8qXcUHnKb1A==",
"requires": {
"@polymer/polymer": "^3.0.0"
}
},
"@polymer/iron-validatable-behavior": { "@polymer/iron-validatable-behavior": {
"version": "3.0.1", "version": "3.0.1",
"resolved": "https://registry.npmjs.org/@polymer/iron-validatable-behavior/-/iron-validatable-behavior-3.0.1.tgz", "resolved": "https://registry.npmjs.org/@polymer/iron-validatable-behavior/-/iron-validatable-behavior-3.0.1.tgz",
@ -131,6 +206,45 @@
"@polymer/polymer": "^3.0.0" "@polymer/polymer": "^3.0.0"
} }
}, },
"@polymer/neon-animation": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/@polymer/neon-animation/-/neon-animation-3.0.1.tgz",
"integrity": "sha512-cDDc0llpVCe0ATbDS3clDthI54Bc8YwZIeTGGmBJleKOvbRTUC5+ssJmRL+VwVh+VM5FlnQlx760ppftY3uprg==",
"requires": {
"@polymer/iron-resizable-behavior": "^3.0.0-pre.26",
"@polymer/iron-selector": "^3.0.0-pre.26",
"@polymer/polymer": "^3.0.0"
}
},
"@polymer/paper-behaviors": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/@polymer/paper-behaviors/-/paper-behaviors-3.0.1.tgz",
"integrity": "sha512-6knhj69fPJejv8qR0kCSUY+Q0XjaUf0OSnkjRjmTJPAwSrRYtgqE+l6P1FfA+py1X/cUjgne9EF5rMZAKJIg1g==",
"requires": {
"@polymer/iron-behaviors": "^3.0.0-pre.26",
"@polymer/iron-checked-element-behavior": "^3.0.0-pre.26",
"@polymer/paper-ripple": "^3.0.0-pre.26",
"@polymer/polymer": "^3.0.0"
}
},
"@polymer/paper-dropdown-menu": {
"version": "3.2.0",
"resolved": "https://registry.npmjs.org/@polymer/paper-dropdown-menu/-/paper-dropdown-menu-3.2.0.tgz",
"integrity": "sha512-2ohwSHF+RLSK6kA0UkkMiMQF6EZcaEYWAA25kfisI6DWie7yozKrpQNsqvwfOEHU6DdDMIotrOtH1TM88YS8Zg==",
"requires": {
"@polymer/iron-a11y-keys-behavior": "^3.0.0-pre.26",
"@polymer/iron-form-element-behavior": "^3.0.0-pre.26",
"@polymer/iron-icon": "^3.0.0-pre.26",
"@polymer/iron-iconset-svg": "^3.0.0-pre.26",
"@polymer/iron-validatable-behavior": "^3.0.0-pre.26",
"@polymer/paper-behaviors": "^3.0.0-pre.27",
"@polymer/paper-input": "^3.1.0",
"@polymer/paper-menu-button": "^3.1.0",
"@polymer/paper-ripple": "^3.0.0-pre.26",
"@polymer/paper-styles": "^3.0.0-pre.26",
"@polymer/polymer": "^3.3.1"
}
},
"@polymer/paper-input": { "@polymer/paper-input": {
"version": "3.2.1", "version": "3.2.1",
"resolved": "https://registry.npmjs.org/@polymer/paper-input/-/paper-input-3.2.1.tgz", "resolved": "https://registry.npmjs.org/@polymer/paper-input/-/paper-input-3.2.1.tgz",
@ -145,6 +259,29 @@
"@polymer/polymer": "^3.0.0" "@polymer/polymer": "^3.0.0"
} }
}, },
"@polymer/paper-menu-button": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/@polymer/paper-menu-button/-/paper-menu-button-3.1.0.tgz",
"integrity": "sha512-q0G0/rvYD/FFmIBMGCQWjfXzRqwFw9+WHSYV4uOQzM1Ln8LMXSAd+2CENsbVwtMh6fmBePj15ZlU8SM2dt1WDQ==",
"requires": {
"@polymer/iron-a11y-keys-behavior": "^3.0.0-pre.26",
"@polymer/iron-behaviors": "^3.0.0-pre.26",
"@polymer/iron-dropdown": "^3.0.0-pre.26",
"@polymer/iron-fit-behavior": "^3.1.0",
"@polymer/neon-animation": "^3.0.0-pre.26",
"@polymer/paper-styles": "^3.0.0-pre.26",
"@polymer/polymer": "^3.0.0"
}
},
"@polymer/paper-ripple": {
"version": "3.0.2",
"resolved": "https://registry.npmjs.org/@polymer/paper-ripple/-/paper-ripple-3.0.2.tgz",
"integrity": "sha512-DnLNvYIMsiayeICroYxx6Q6Hg1cUU8HN2sbutXazlemAlGqdq80qz3TIaVdbpbt/pvjcFGX2HtntMlPstCge8Q==",
"requires": {
"@polymer/iron-a11y-keys-behavior": "^3.0.0-pre.26",
"@polymer/polymer": "^3.0.0"
}
},
"@polymer/paper-styles": { "@polymer/paper-styles": {
"version": "3.0.1", "version": "3.0.1",
"resolved": "https://registry.npmjs.org/@polymer/paper-styles/-/paper-styles-3.0.1.tgz", "resolved": "https://registry.npmjs.org/@polymer/paper-styles/-/paper-styles-3.0.1.tgz",

@ -22,6 +22,7 @@
}, },
"homepage": "https://github.com/JurajNyiri/PlexMeetsHomeAssistant#readme", "homepage": "https://github.com/JurajNyiri/PlexMeetsHomeAssistant#readme",
"dependencies": { "dependencies": {
"@polymer/paper-dropdown-menu": "^3.2.0",
"@polymer/paper-input": "^3.2.1", "@polymer/paper-input": "^3.2.1",
"@polymer/polymer": "^3.4.1", "@polymer/polymer": "^3.4.1",
"@vercel/ncc": "^0.28.5", "@vercel/ncc": "^0.28.5",

@ -41,6 +41,29 @@ class PlexMeetsHomeAssistantEditor extends HTMLElement {
token.value = this.config.token; token.value = this.config.token;
this.content.appendChild(token); this.content.appendChild(token);
const port: any = document.createElement('paper-input');
port.label = 'Plex Port';
port.value = this.config.port;
port.type = 'number';
this.content.appendChild(port);
const addLibraryItem = (text: string): HTMLElement => {
const libraryItem: any = document.createElement('paper-item');
libraryItem.innerHTML = text;
return libraryItem;
};
const library: any = document.createElement('paper-dropdown-menu');
const libraryItems: any = document.createElement('paper-listbox');
libraryItems.appendChild(addLibraryItem('Continue Watching'));
libraryItems.appendChild(addLibraryItem('Deck'));
libraryItems.appendChild(addLibraryItem('Recently Added'));
libraryItems.appendChild(addLibraryItem('Watch Next'));
libraryItems.slot = 'dropdown-content';
library.label = 'Plex Library';
library.appendChild(libraryItems);
library.style.width = '100%';
this.content.appendChild(library);
this.appendChild(this.content); this.appendChild(this.content);
this.fireEvent(this, 'config-changed', { config: this.config }); // todo remove me this.fireEvent(this, 'config-changed', { config: this.config }); // todo remove me

Loading…
Cancel
Save