Giter Site home page Giter Site logo

Comments (1)

cgiesche avatar cgiesche commented on May 30, 2024 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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.