aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar Bernhard <bernhard@kralofsky.com>2022-06-07 13:59:08 +0200
committerLibravatar GitHub <noreply@github.com>2022-06-07 12:59:08 +0100
commit256254e15e1bcd642054b90d25463707688ff52c (patch)
tree8b8988fcfbf8db636d11f50433889028cb8b4537
parent[Whatsapp] Remove max width limit of 1600px (#49) (diff)
downloadferdium-recipes-256254e15e1bcd642054b90d25463707688ff52c.tar.gz
ferdium-recipes-256254e15e1bcd642054b90d25463707688ff52c.tar.zst
ferdium-recipes-256254e15e1bcd642054b90d25463707688ff52c.zip
Add home assistant recipe (#47)
-rw-r--r--recipes/home-assistant/icon.svg25
-rw-r--r--recipes/home-assistant/index.js1
-rw-r--r--recipes/home-assistant/package.json10
-rw-r--r--recipes/home-assistant/webview.js12
4 files changed, 48 insertions, 0 deletions
diff --git a/recipes/home-assistant/icon.svg b/recipes/home-assistant/icon.svg
new file mode 100644
index 0000000..9912764
--- /dev/null
+++ b/recipes/home-assistant/icon.svg
@@ -0,0 +1,25 @@
1<?xml version="1.0" encoding="UTF-8"?>
2<svg width="500px" height="500px" viewBox="0 0 500 500" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
3 <!-- Generator: Sketch 47.1 (45422) - http://www.bohemiancoding.com/sketch -->
4 <title>logo</title>
5 <desc>Created with Sketch.</desc>
6 <defs>
7 <path d="M44.0413786,343.222285 L44.0413786,209.580164 L9.28835533,209.580164 L9.28835533,209.580164 C4.13373935,209.580164 -0.0449025165,205.401522 -0.0449025165,200.246906 C-0.0449025165,197.799 0.916807526,195.44908 2.63299007,193.703526 L189.638621,3.49741401 L189.638621,3.49741401 C194.155882,-1.09715691 201.542481,-1.15982907 206.137052,3.35743182 C206.177422,3.39712258 206.217502,3.43710666 206.25729,3.47738089 L303.858318,102.271219 L303.858318,83.9738632 L303.858318,83.9738632 C303.858318,79.6783499 307.34052,76.1961483 311.636033,76.1961483 L344.046808,76.1961483 L344.046808,76.1961483 C348.342321,76.1961483 351.824523,79.6783499 351.824523,83.9738632 L351.824523,151.111829 L393.392628,193.730131 C396.991743,197.420176 396.91803,203.329208 393.227985,206.928324 C391.484825,208.628529 389.146225,209.580164 386.71121,209.580164 L351.824523,209.580164 L351.824523,343.222285 C351.824523,347.517798 348.342321,351 344.046808,351 L51.8190935,351 C47.5235802,351 44.0413786,347.517798 44.0413786,343.222285 L44.0413786,343.222285 Z M250.434105,179.96197 C251.370539,177.998139 251.89493,175.798639 251.89493,173.47622 C251.89493,165.168029 245.18393,158.43291 236.905492,158.43291 C228.627053,158.43291 221.916053,165.168029 221.916053,173.47622 C221.916053,181.78441 228.627053,188.51953 236.905492,188.51953 C239.219594,188.51953 241.411218,187.993254 243.368015,187.053454 L264.885777,208.648549 L264.885777,229.566637 L237.904787,256.644595 L237.904787,236.805016 C243.726647,234.739889 247.897747,229.167651 247.897747,222.617699 C247.897747,214.309508 241.186746,207.574389 232.908308,207.574389 C224.629869,207.574389 217.918869,214.309508 217.918869,222.617699 C217.918869,229.167651 222.089968,234.739889 227.911828,236.805016 L227.911828,266.673469 L202.92943,291.745652 L202.92943,144.46376 L223.447896,123.871552 C225.404694,124.811352 227.596318,125.337628 229.91042,125.337628 C238.188859,125.337628 244.899859,118.602508 244.899859,110.294318 C244.899859,101.986127 238.188859,95.2510076 229.91042,95.2510076 C221.631982,95.2510076 214.920981,101.986127 214.920981,110.294318 C214.920981,112.616737 215.445373,114.816237 216.381807,116.780068 L197.932951,135.295228 L179.484094,116.780068 C180.420529,114.816237 180.94492,112.616737 180.94492,110.294318 C180.94492,101.986127 174.23392,95.2510076 165.955481,95.2510076 C157.677043,95.2510076 150.966042,101.986127 150.966042,110.294318 C150.966042,118.602508 157.677043,125.337628 165.955481,125.337628 C168.269583,125.337628 170.461207,124.811352 172.418005,123.871552 L192.936471,144.46376 L192.936471,249.624384 L156.961818,213.52044 L156.961818,184.654875 C162.783678,182.589747 166.954777,177.017509 166.954777,170.467558 C166.954777,162.159367 160.243777,155.424248 151.965338,155.424248 C143.6869,155.424248 136.975899,162.159367 136.975899,170.467558 C136.975899,177.017509 141.146999,182.589747 146.968859,184.654875 L146.968859,203.491567 L118.988573,175.410721 L118.988573,147.548043 C124.810433,145.482916 128.981532,139.910678 128.981532,133.360726 C128.981532,125.052536 122.270532,118.317416 113.992093,118.317416 C105.713655,118.317416 99.0026543,125.052536 99.0026543,133.360726 C99.0026543,139.910678 103.173754,145.482916 108.995614,147.548043 L108.995614,179.564817 L139.902769,210.583051 L122.132829,210.583051 C120.075097,204.740268 114.522813,200.554178 107.996318,200.554178 C99.7178792,200.554178 93.0068788,207.289297 93.0068788,215.597488 C93.0068788,223.905678 99.7178792,230.640798 107.996318,230.640798 C114.522813,230.640798 120.075097,226.454708 122.132829,220.611924 L149.895729,220.611924 L192.936471,263.807353 L192.936471,338.881357 L169.952665,315.814948 L169.952665,286.949383 C175.774525,284.884255 179.945624,279.312017 179.945624,272.762066 C179.945624,264.453875 173.234624,257.718756 164.956185,257.718756 C156.677747,257.718756 149.966746,264.453875 149.966746,272.762066 C149.966746,279.312017 154.137846,284.884255 159.959706,286.949383 L159.959706,305.786075 L126.52141,272.227604 C127.457845,270.263774 127.982236,268.064273 127.982236,265.741854 C127.982236,257.433664 121.271236,250.698544 112.992797,250.698544 C104.714359,250.698544 98.0033584,257.433664 98.0033584,265.741854 C98.0033584,274.050045 104.714359,280.785164 112.992797,280.785164 C115.306899,280.785164 117.498524,280.258889 119.455321,279.319089 L152.893616,312.877559 L135.123676,312.877559 C133.065944,307.034776 127.51366,302.848686 120.987165,302.848686 C112.708726,302.848686 105.997726,309.583805 105.997726,317.891996 C105.997726,326.200187 112.708726,332.935306 120.987165,332.935306 C127.51366,332.935306 133.065944,328.749216 135.123676,322.906433 L162.886576,322.906433 L190.866861,350.987278 L204.99904,350.987278 L233.978622,321.903545 L260.742225,321.903545 C262.799958,327.746329 268.352241,331.932419 274.878737,331.932419 C283.157175,331.932419 289.868175,325.197299 289.868175,316.889109 C289.868175,308.580918 283.157175,301.845799 274.878737,301.845799 C268.352241,301.845799 262.799958,306.031888 260.742225,311.874672 L229.839402,311.874672 L202.92943,338.881357 L202.92943,305.928621 L234.977917,273.764953 L286.723919,273.764953 C288.781651,279.607737 294.333935,283.793826 300.860431,283.793826 C309.138869,283.793826 315.849869,277.058707 315.849869,268.750516 C315.849869,260.442326 309.138869,253.707206 300.860431,253.707206 C294.333935,253.707206 288.781651,257.893296 286.723919,263.73608 L244.970877,263.73608 L274.878737,233.720733 L274.878737,208.648549 L296.396498,187.053454 C298.353296,187.993254 300.54492,188.51953 302.859022,188.51953 C311.137461,188.51953 317.848461,181.78441 317.848461,173.47622 C317.848461,165.168029 311.137461,158.43291 302.859022,158.43291 C294.580584,158.43291 287.869584,165.168029 287.869584,173.47622 C287.869584,175.798639 288.393975,177.998139 289.330409,179.96197 L274.878737,194.465581 L274.878737,148.550931 C280.700596,146.485803 284.871696,140.913565 284.871696,134.363614 C284.871696,126.055423 278.160695,119.320304 269.882257,119.320304 C261.603818,119.320304 254.892818,126.055423 254.892818,134.363614 C254.892818,140.913565 259.063917,146.485803 264.885777,148.550931 L264.885777,194.465581 L250.434105,179.96197 Z M120.987165,323.90932 C117.675789,323.90932 114.991389,321.215272 114.991389,317.891996 C114.991389,314.56872 117.675789,311.874672 120.987165,311.874672 C124.29854,311.874672 126.98294,314.56872 126.98294,317.891996 C126.98294,321.215272 124.29854,323.90932 120.987165,323.90932 Z M164.956185,278.77939 C161.64481,278.77939 158.96041,276.085342 158.96041,272.762066 C158.96041,269.43879 161.64481,266.744742 164.956185,266.744742 C168.267561,266.744742 170.951961,269.43879 170.951961,272.762066 C170.951961,276.085342 168.267561,278.77939 164.956185,278.77939 Z M112.992797,271.759178 C109.681422,271.759178 106.997022,269.065131 106.997022,265.741854 C106.997022,262.418578 109.681422,259.72453 112.992797,259.72453 C116.304173,259.72453 118.988573,262.418578 118.988573,265.741854 C118.988573,269.065131 116.304173,271.759178 112.992797,271.759178 Z M107.996318,221.614812 C104.684942,221.614812 102.000542,218.920764 102.000542,215.597488 C102.000542,212.274211 104.684942,209.580164 107.996318,209.580164 C111.307693,209.580164 113.992093,212.274211 113.992093,215.597488 C113.992093,218.920764 111.307693,221.614812 107.996318,221.614812 Z M232.908308,228.635023 C229.596932,228.635023 226.912532,225.940975 226.912532,222.617699 C226.912532,219.294423 229.596932,216.600375 232.908308,216.600375 C236.219683,216.600375 238.904083,219.294423 238.904083,222.617699 C238.904083,225.940975 236.219683,228.635023 232.908308,228.635023 Z M300.860431,274.76784 C297.549055,274.76784 294.864655,272.073793 294.864655,268.750516 C294.864655,265.42724 297.549055,262.733192 300.860431,262.733192 C304.171806,262.733192 306.856206,265.42724 306.856206,268.750516 C306.856206,272.073793 304.171806,274.76784 300.860431,274.76784 Z M274.878737,322.906433 C271.567361,322.906433 268.882961,320.212385 268.882961,316.889109 C268.882961,313.565832 271.567361,310.871785 274.878737,310.871785 C278.190112,310.871785 280.874512,313.565832 280.874512,316.889109 C280.874512,320.212385 278.190112,322.906433 274.878737,322.906433 Z M302.859022,179.493544 C299.547647,179.493544 296.863247,176.799496 296.863247,173.47622 C296.863247,170.152943 299.547647,167.458896 302.859022,167.458896 C306.170398,167.458896 308.854798,170.152943 308.854798,173.47622 C308.854798,176.799496 306.170398,179.493544 302.859022,179.493544 Z M269.882257,140.380938 C266.570882,140.380938 263.886481,137.68689 263.886481,134.363614 C263.886481,131.040337 266.570882,128.34629 269.882257,128.34629 C273.193632,128.34629 275.878032,131.040337 275.878032,134.363614 C275.878032,137.68689 273.193632,140.380938 269.882257,140.380938 Z M229.91042,116.311642 C226.599045,116.311642 223.914645,113.617594 223.914645,110.294318 C223.914645,106.971041 226.599045,104.276994 229.91042,104.276994 C233.221795,104.276994 235.906196,106.971041 235.906196,110.294318 C235.906196,113.617594 233.221795,116.311642 229.91042,116.311642 Z M165.955481,116.311642 C162.644106,116.311642 159.959706,113.617594 159.959706,110.294318 C159.959706,106.971041 162.644106,104.276994 165.955481,104.276994 C169.266856,104.276994 171.951257,106.971041 171.951257,110.294318 C171.951257,113.617594 169.266856,116.311642 165.955481,116.311642 Z M113.992093,139.37805 C110.680718,139.37805 107.996318,136.684003 107.996318,133.360726 C107.996318,130.03745 110.680718,127.343402 113.992093,127.343402 C117.303469,127.343402 119.987869,130.03745 119.987869,133.360726 C119.987869,136.684003 117.303469,139.37805 113.992093,139.37805 Z M151.965338,176.484882 C148.653963,176.484882 145.969563,173.790834 145.969563,170.467558 C145.969563,167.144281 148.653963,164.450234 151.965338,164.450234 C155.276714,164.450234 157.961114,167.144281 157.961114,170.467558 C157.961114,173.790834 155.276714,176.484882 151.965338,176.484882 Z M236.905492,179.493544 C233.594116,179.493544 230.909716,176.799496 230.909716,173.47622 C230.909716,170.152943 233.594116,167.458896 236.905492,167.458896 C240.216867,167.458896 242.901267,170.152943 242.901267,173.47622 C242.901267,176.799496 240.216867,179.493544 236.905492,179.493544 Z" id="path-1"></path>
8 </defs>
9 <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
10 <g id="logo">
11 <g id="fill/blue" fill="#41BDF5">
12 <rect id="Rectangle-2" x="0" y="0" width="500" height="500"></rect>
13 </g>
14 <g id="house-with-large-tree" transform="translate(52.000000, 70.000000)">
15 <mask id="mask-2" fill="white">
16 <use xlink:href="#path-1"></use>
17 </mask>
18 <g id="large-tree" fill-rule="nonzero"></g>
19 <g id="fill/white" mask="url(#mask-2)" fill-rule="evenodd" fill="#FFFFFF">
20 <rect id="Rectangle-2" x="0" y="0" width="396" height="351"></rect>
21 </g>
22 </g>
23 </g>
24 </g>
25</svg> \ No newline at end of file
diff --git a/recipes/home-assistant/index.js b/recipes/home-assistant/index.js
new file mode 100644
index 0000000..dd41f72
--- /dev/null
+++ b/recipes/home-assistant/index.js
@@ -0,0 +1 @@
module.exports = Ferdium => Ferdium;
diff --git a/recipes/home-assistant/package.json b/recipes/home-assistant/package.json
new file mode 100644
index 0000000..60e06e0
--- /dev/null
+++ b/recipes/home-assistant/package.json
@@ -0,0 +1,10 @@
1{
2 "id": "home-assistant",
3 "name": "Home Assistant",
4 "version": "1.0.0",
5 "license": "MIT",
6 "config": {
7 "hasCustomUrl": true,
8 "hasNotificationSound": true
9 }
10}
diff --git a/recipes/home-assistant/webview.js b/recipes/home-assistant/webview.js
new file mode 100644
index 0000000..a449cc4
--- /dev/null
+++ b/recipes/home-assistant/webview.js
@@ -0,0 +1,12 @@
1module.exports = Ferdium => {
2 const getMessages = () => {
3 const badges = document.querySelector("home-assistant").shadowRoot.querySelector("home-assistant-main").shadowRoot.querySelector("ha-sidebar").shadowRoot.querySelectorAll(".notification-badge");
4 if (badges.length > 0) {
5 var count = Ferdium.safeParseInt(badges[0].textContent.replace(/[^\p{N}]/gu, ''));
6 Ferdium.setBadge(count)
7 } else {
8 Ferdium.setBadge(0)
9 }
10 };
11 Ferdium.loop(getMessages);
12};