diff --git a/src/dialogs/more-info/controls/more-info-lock.js b/src/dialogs/more-info/controls/more-info-lock.js
deleted file mode 100644
index 346e1a8625..0000000000
--- a/src/dialogs/more-info/controls/more-info-lock.js
+++ /dev/null
@@ -1,80 +0,0 @@
-import "@material/mwc-button";
-import "@polymer/paper-input/paper-input";
-import { html } from "@polymer/polymer/lib/utils/html-tag";
-/* eslint-plugin-disable lit */
-import { PolymerElement } from "@polymer/polymer/polymer-element";
-import "../../../components/ha-attributes";
-import LocalizeMixin from "../../../mixins/localize-mixin";
-
-/*
- * @appliesMixin LocalizeMixin
- */
-class MoreInfoLock extends LocalizeMixin(PolymerElement) {
- static get template() {
- return html`
-
-
-
-
- [[localize('ui.card.lock.unlock')]]
- [[localize('ui.card.lock.lock')]]
-
-
- `;
- }
-
- static get properties() {
- return {
- hass: Object,
- stateObj: {
- type: Object,
- observer: "stateObjChanged",
- },
- enteredCode: {
- type: String,
- value: "",
- },
- isLocked: Boolean,
- };
- }
-
- stateObjChanged(newVal) {
- if (newVal) {
- this.isLocked = newVal.state === "locked";
- }
- }
-
- callService(ev) {
- const service = ev.target.getAttribute("data-service");
- const data = {
- entity_id: this.stateObj.entity_id,
- code: this.enteredCode,
- };
- this.hass.callService("lock", service, data);
- }
-}
-
-customElements.define("more-info-lock", MoreInfoLock);
diff --git a/src/dialogs/more-info/controls/more-info-lock.ts b/src/dialogs/more-info/controls/more-info-lock.ts
new file mode 100644
index 0000000000..0c380d267f
--- /dev/null
+++ b/src/dialogs/more-info/controls/more-info-lock.ts
@@ -0,0 +1,70 @@
+import "@material/mwc-button";
+import type { HassEntity } from "home-assistant-js-websocket";
+import { css, html, LitElement, TemplateResult } from "lit";
+import { customElement, property, query } from "lit/decorators";
+import "../../../components/ha-attributes";
+import "../../../components/ha-textfield";
+import type { HaTextField } from "../../../components/ha-textfield";
+import type { HomeAssistant } from "../../../types";
+
+@customElement("more-info-lock")
+class MoreInfoLock extends LitElement {
+ @property({ attribute: false }) public hass!: HomeAssistant;
+
+ @property({ attribute: false }) public stateObj?: HassEntity;
+
+ @query("ha-textfield") private _textfield?: HaTextField;
+
+ protected render(): TemplateResult {
+ if (!this.hass || !this.stateObj) {
+ return html``;
+ }
+ return html`
+ ${this.stateObj.attributes.code_format
+ ? html`
+
+ ${this.stateObj.state === "locked"
+ ? html`${this.hass.localize("ui.card.lock.unlock")}`
+ : html`${this.hass.localize("ui.card.lock.lock")}`}
+ `
+ : ""}
+
+ `;
+ }
+
+ private _callService(ev) {
+ const service = ev.target.getAttribute("data-service");
+ const data = {
+ entity_id: this.stateObj!.entity_id,
+ code: this._textfield?.value,
+ };
+ this.hass.callService("lock", service, data);
+ }
+
+ static styles = css`
+ :host {
+ display: flex;
+ align-items: center;
+ }
+ `;
+}
+
+declare global {
+ interface HTMLElementTagNameMap {
+ "more-info-lock": MoreInfoLock;
+ }
+}