Skip to content

Commit

Permalink
Merge pull request #132 from cgiesche/streamdeck-homeassistant-109
Browse files Browse the repository at this point in the history
Fixed #109: Icons for lock entities and their state
  • Loading branch information
cgiesche committed Jan 27, 2023
2 parents 3ffc938 + 38ed9aa commit f27243d
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions src/modules/plugin/entityButtonImageFactory.js
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,32 @@ export class EntityConfigFactory {
}
}

lock = {
"default": (state, attributes, templates) => {
let icon = Mdi.mdiLockQuestion;
let color = this.colors.unavailable;

if (state === 'locked') {
icon = Mdi.mdiLock;
color = this.colors.ok;
} else if (state === 'locking') {
icon = Mdi.mdiLockClock;
color = this.colors.active;
} else if (state === 'unlocked') {
icon = Mdi.mdiLockOpen;
color = this.colors.warn;
}

return {
state,
attributes,
templates,
icon,
color
}
}
}

vacuum = {
"default": (state, attributes, templates) => {
const icon = Mdi.mdiRobotVacuum;
Expand Down

0 comments on commit f27243d

Please sign in to comment.