Skip to content

hd-lock

Live preview

<hd-lock locked="{{ cap.locked }}" size="48px"></hd-lock>

Attributes and example

hd-lock

A lock that locks and unlocks with a springy motion (the shackle drops in and bounces, swings open). While busy the shackle wiggles; when a busy lock ends where it began (refused, or never answered) it shakes.

AttributeWhat it is
lockedtrue is locked, false unlocked; a change plays the motion. Or a live capability of any device, followed: {{ settings.x.cap.onoff }}.Default true.
busyA command is on its way to the Homey.
sizeCSS size, e.g. 48px; or set --size.Default 1em.
labelAccessible label; otherwise “Locked” or “Unlocked”.
<hd-lock locked="{{ cap.locked }}" size="48px"></hd-lock>

Styling

Set CSS variables on the component element. Its internal elements live in Shadow DOM; only the exposed named parts can be styled with ::part.

--hd-ease-out
The easing of most movement.
--hd-good
All is well: locked, closed, cheap.
--hd-lock-locked
CSS input read by hd-lock.
--hd-lock-tempo
CSS input read by hd-lock.
--hd-lock-unlocked
CSS input read by hd-lock.
--hd-motion-tempo
CSS input read by hd-lock.
--hd-warn
Worth a look: a low battery, a door open for a while.

Style the host

hd-lock {  --hd-accent: #2563eb;  max-width: 100%;}
Theme variables