Skip to content

Commit

Permalink
Merge pull request #9 from cgiesche/streamdeck-homeassistant-8
Browse files Browse the repository at this point in the history
Fixes #8: Use switch button layout for entities of type "input_boolean"
  • Loading branch information
cgiesche committed Feb 6, 2021
2 parents f4cd6eb + 1032382 commit e7807ed
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
2 changes: 1 addition & 1 deletion public/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"Name": "Home Assistant",
"Icon": "images/ha-button",
"URL": "https://github.com/cgiesche/streamdeck-homeassistant",
"Version": "1.0.2",
"Version": "1.1.0",
"OS": [
{
"Platform": "mac",
Expand Down
14 changes: 5 additions & 9 deletions src/modules/plugin/imageUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,11 @@ export const IconFactory = {
},

light: {
default: (state, attributes, labelTemplate) => {
let icon;
if (state === "on") {
icon = Icon.switchOn;
} else {
icon = Icon.switchOff;
}
return Icon.labelledIcon(state, attributes, labelTemplate || IconFactory.switch._defaultLabelTemplate, icon)
}
default: (state, attributes, labelTemplate) => IconFactory.switch.default(state, attributes, labelTemplate)
},

input_boolean: {
default: (state, attributes, labelTemplate) => IconFactory.switch.default(state, attributes, labelTemplate)
},

binary_sensor: {
Expand Down

0 comments on commit e7807ed

Please sign in to comment.