Skip to content

Commit

Permalink
Update to lit 2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasloven committed Dec 26, 2022
1 parent c84a0ad commit 1e39d67
Show file tree
Hide file tree
Showing 8 changed files with 922 additions and 44 deletions.
7 changes: 7 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<!--
Please do not include compiled distribution files in the PR (i.e. slider-entity-row.js).
I like to be able to know exactly what goes into those.
/ Thomas
-->
34 changes: 22 additions & 12 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
Expand Up @@ -27,7 +27,7 @@
},
"dependencies": {
"card-tools": "github:thomasloven/lovelace-card-tools",
"lit-element": "^3.0.1",
"lit": "^2.2.2",
"tslib": "^2.3.1"
}
}
907 changes: 882 additions & 25 deletions slider-entity-row.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/controllers/controller.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { html } from "lit-element";
import { html } from "lit";

export interface ControllerConfig {
entity: string;
Expand Down
1 change: 0 additions & 1 deletion src/controllers/media-player-controller.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { html } from "lit-element";
import { Controller } from "./controller";

export class MediaPlayerController extends Controller {
Expand Down
11 changes: 8 additions & 3 deletions src/main.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { LitElement, html, css, property } from "lit-element";
import { LitElement, html, css } from "lit";
import { property } from "lit/decorators.js";

import { getController } from "./controllers/get-controller";
import { Controller, ControllerConfig } from "./controllers/controller";
Expand All @@ -22,7 +23,7 @@ class SliderEntityRow extends LitElement {

async resized() {
await this.updateComplete;
if (!this.shadowRoot) return;
if (!this.shadowRoot || !this.parentElement) return;
this.hide_state = this._config.full_row
? this.parentElement.clientWidth <= 180
: this.parentElement.clientWidth <= 335;
Expand Down Expand Up @@ -107,7 +108,11 @@ class SliderEntityRow extends LitElement {
else return content;

return html`
<hui-generic-entity-row .hass=${this.hass} .config=${this._config}>
<hui-generic-entity-row
.hass=${this.hass}
.config=${this._config}
.catchInteraction=${false}
>
${content}
</hui-generic-entity-row>
`;
Expand Down
2 changes: 1 addition & 1 deletion test/.env
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
HASS_USERNAME=dev
HASS_PASSWORD=dev
LOVELACE_LOCAL_FILES=slider-entity-row.js
LOVELACE_PLUGINS=
LOVELACE_PLUGINS="thomasloven/lovelace-card-mod thomasloven/lovelace-auto-entities"

0 comments on commit 1e39d67

Please sign in to comment.