Skip to content

Commit

Permalink
remove pointer events polyfill since any device old enough to not sup…
Browse files Browse the repository at this point in the history
…port pointer events is too old to support HA frontend, change key action hold_secs to 1 second to support Apple TV hold actions
  • Loading branch information
Nerwyn committed Jan 26, 2025
1 parent 2752e02 commit 9c4b193
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 18 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ Actions follow the [Home Assistant actions](https://www.home-assistant.io/dashbo
| URL | Navigate to an external URL. |
| Perform action | Call any Home Assistant service action. |
| Assist | Open the assist dialog. Uses the mobile dialog if available, like in the Home Assistant app. The pipeline ID and start listening options only work in the mobile assist dialog. |
| Key | Send a key to the media platform via the action `remote.send_command`. If no hold action is defined, then `hold_secs: 0.5` is added when a hold action is fired. |
| Key | Send a key to the media platform via the action `remote.send_command`. If no hold action is defined, then `hold_secs: 1` is added when a hold action is fired. |
| Source | Open a source via the action `remote.turn_on`. |
| Keyboard | Open a dialog for sending seamless keyboard input. |
| Textbox | Open a dialog for sending bulk keyboard input. |
Expand Down
4 changes: 2 additions & 2 deletions dist/universal-remote-card.min.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "universal-remote-card",
"version": "4.3.7",
"version": "4.3.8",
"description": "Universal Remote Card",
"main": "./dist/universal-remote-card.min.js",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion src/classes/base-remote-element.ts
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ export class BaseRemoteElement extends LitElement {
(!this.config.hold_action ||
this.config.hold_action.action == 'none')
) {
data.hold_secs = 0.5;
data.hold_secs = 1;
}
this.hass.callService('remote', 'send_command', data);
break;
Expand Down
18 changes: 7 additions & 11 deletions src/universal-remote-card.ts
Original file line number Diff line number Diff line change
Expand Up @@ -665,18 +665,14 @@ class UniversalRemoteCard extends LitElement {
`
: '';

const polyfillPointerEvents = !window.PointerEvent
? html`<script src="https://cdn.jsdelivr.net/npm/@wessberg/pointer-events@1.0.9/dist/index.min.js"></script>`
: '';

return html`<ha-card
class="${this.editMode ? ' edit-mode' : ''}"
.header="${this.renderTemplate(
this.config.title as string,
context,
)}"
>${content}${this.buildDialog()}${styles}</ha-card
>${polyfillPointerEvents}`;
class="${this.editMode ? ' edit-mode' : ''}"
.header="${this.renderTemplate(
this.config.title as string,
context,
)}"
>${content}${this.buildDialog()}${styles}</ha-card
>`;
}

static get styles() {
Expand Down

0 comments on commit 9c4b193

Please sign in to comment.