Comments (1)
Hi!
The word "icon" sounds very simple for what is going on in the code to generate them :). The stream deck api allows eihter to use exactly one or two predefined images that can be configured in the gui OR to use SVG-images.
Of course, i need more than two static images, so i am using SVG images. Sadly, i can not simply load svg images from files. I have to generate them in my code. Colors and text lines (except the tilte text) are part of the dynamic SVG templates. The "icon" you see above the Title is only a small part of the whole "button" image.
This is, how it looks like: https://github.com/cgiesche/streamdeck-homeassistant/blob/master/src/modules/plugin/imageUtils.js
Scroll down to take a look at hell :D
Currently I am using the same "icon" for different types of entities, but i could use different icons based on following logic:
[Domain][device_class (optional)][state (optional)]
[switch][*][on]
-> on-switch-image
[switch][*][off]
-> off-switch-image
[light][*][on]
-> defaults to [switch][*][on]
[light][*][off]
-> defaults to [switch][*][off]
[input_boolean][*][on]
-> defaults to [switch][*][on]
[input_boolean][*][off]
-> defaults to [switch][*][off]
[sensor][battery][*]
-> battery icon with loading state
[sensor][temperature][*]
-> thermometer icon
etc...
My main problem is: I am not good at making icons that are looking good, still looking good on the streamdeck button and looking uniformly.
Long story short: I could easily add different images for different types of entities (fan/light/switch/pressure sensor/...) but i did not find an iconset that doesn't look like a mess when scaled down to about 65 pixels in height.
Making icons customizable by the user will not happen in the near future :/
from streamdeck-homeassistant.
Related Issues (20)
- Actions now require (Optional) Entity HOT 2
- [Feature] Remove button background (-> transparent on dial display)
- [Feature] Add "heat" as active state for custom icons.
- Custom title ignored on knobs? HOT 3
- Not all HA icons are supported? HOT 2
- Plugin failing to communicate HOT 30
- Weather domain is showing wrong unit HOT 1
- Custom icon entities ignore actual state when pressed HOT 5
- Plugin Starts Disconnected HOT 5
- Improve Entity selection
- Update not in Elgato Store HOT 2
- Improve display image rendering. HOT 1
- Unable to use any actions HOT 5
- server settings do not save HOT 2
- [Styles] Add style for binary_sensor.door
- [Styles] Add style for sensor.voltage
- Unable to save configuration HOT 1
- Font color for Entity (custom icons) in "on" state always resets to white HOT 1
- rotationPercent and rotationAbsolute resets after page change or screen lock
- Unable to launch any service since last Home Assistant update HOT 9
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from streamdeck-homeassistant.