Skip to content

Commit

Permalink
Update for 0.110
Browse files Browse the repository at this point in the history
  • Loading branch information
vigonotion committed May 10, 2020
1 parent 79aa155 commit 21b83e1
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 18 deletions.
2 changes: 1 addition & 1 deletion custom_components/simpleicons/data/si.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion hacs.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "simpleicons",
"render_readme": true,
"homeassistant": "0.109.0"
"homeassistant": "0.110.0"
}
25 changes: 9 additions & 16 deletions js/si.js
Original file line number Diff line number Diff line change
@@ -1,22 +1,15 @@
const simpleIcons = require('simple-icons');

async function getIcon(name) {
var si = simpleIcons.get(name);

var x = 2
if (si === undefined) return {};

var svg = "<svg><defs>";

for(var icon of Object.entries(simpleIcons)) {
var path = icon[1].path;
var slug = icon[1].slug;

var g = "<g id=\"" + slug + "\" viewBox=\"-1 -1 26 26\"><path d=\"" + path + "\"/></g>";
svg += g;
return {
path: si.path,
viewBox: "-1 -1 26 26",
};
}

svg += "</defs></svg>"

const iconset = document.createElement("ha-iconset-svg");
iconset.name="si";
iconset.size=1024;
iconset.innerHTML = svg;
document.body.appendChild(iconset);
window.customIconsets = window.customIconsets || {};
window.customIconsets["si"] = getIcon;

0 comments on commit 21b83e1

Please sign in to comment.