fix: Rationalize custom icons to avoid duplication (#1639)

This commit is contained in:
Dermot Duffy
2024-10-13 16:24:51 -07:00
committed by GitHub
parent 0ec9afbad2
commit 7895de96d2
29 changed files with 573 additions and 272 deletions
+1 -1
View File
@@ -1,4 +1,4 @@
![logo](images/frigate-logo.svg)
![logo](images/icons/frigate.svg)
# Frigate Card <small>6.0.0</small>
+8 -8
View File
@@ -37,7 +37,7 @@ Configuration is similar to a stock [Picture Elements Icon](https://www.home-ass
| `type` | | Must be `custom:frigate-card-menu-icon`. |
| `enabled` | `true` | Whether or not to show this menu item. |
| `entity` | | An optional Home Assistant entity for use with actions. |
| `icon` | | An required icon to display, e.g. `mdi:car` |
| `icon` | | An required icon to display, e.g. `mdi:car`. See also [custom icons](../../../usage/custom-icons.md). |
| `permanent` | `false` | If `false` the menu item is hidden when the menu has the `hidden` style and the menu is closed, otherwise it is shown (and sorted to the front). |
| `priority` | `50` | The menu item priority. Higher priority item are ordered closer to the start of the menu alignment (i.e. a button with priority `70` will order further to the left than a button with priority `60`, when the menu alignment is `left`). Minimum `0`, maximum `100`. |
| `style` | | Position and style the element using CSS. |
@@ -59,7 +59,7 @@ elements:
| `type` | | Must be `custom:frigate-card-menu-submenu`. |
| `enabled` | `true` | Whether or not to show this menu item. |
| `entity` | | An optional Home Assistant entity for use with actions. |
| `icon` | | An required icon to display, e.g. `mdi:car` |
| `icon` | | An required icon to display, e.g. `mdi:car`. See also [custom icons](../../../usage/custom-icons.md). |
| `items` | | A list of menu items, as described below. |
| `permanent` | `false` | If `false` the menu item is hidden when the menu has the `hidden` style and the menu is closed, otherwise it is shown (and sorted to the front). |
| `priority` | `50` | The menu item priority. Higher priority item are ordered closer to the start of the menu alignment (i.e. a button with priority `70` will order further to the left than a button with priority `60`, when the menu alignment is `left`). Minimum `0`, maximum `100`. |
@@ -70,10 +70,10 @@ elements:
### Submenu items
| Parameter | Default | Description |
| ------------------------------------------------------------------------ | ------- | ------------------------------------------------------------------------------------------------- |
| ------------------------------------------------------------------------ | ------- | ---------------------------------------------------------------------------------------------------------- |
| `enabled` | `true` | Whether or not to show this item as enabled / selectable. |
| `entity` | | An optional Home Assistant entity from which title, icon and style can be automatically computed. |
| `icon` | | An optional item icon to display, e.g. `mdi:car` |
| `icon` | | An optional item icon to display, e.g. `mdi:car`. See also [custom icons](../../../usage/custom-icons.md). |
| `selected` | `false` | Whether or not to show this item as selected. |
| `state_color` | `true` | Whether or not the title and icon should be stylized based on state. |
| `style` | | Position and style the element using CSS. |
@@ -95,7 +95,7 @@ elements:
| `type` | | Must be `custom:frigate-card-menu-submenu-select`. |
| `enabled` | `true` | Whether or not to show this menu item. |
| `entity` | | An optional Home Assistant entity for use with actions. |
| `icon` | | An required icon to display, e.g. `mdi:car` |
| `icon` | | An required icon to display, e.g. `mdi:car`. See also [custom icons](../../../usage/custom-icons.md). |
| `options` | | An optional dictionary of overrides keyed by the option name that the given select entity supports. These options can be used to set or override submenu item parameters on a per-option basis. The format is as described in [Submenu Items](./README.md?id=submenu-items) above. |
| `permanent` | `false` | If `false` the menu item is hidden when the menu has the `hidden` style and the menu is closed, otherwise it is shown (and sorted to the front). |
| `priority` | `50` | The menu item priority. Higher priority item are ordered closer to the start of the menu alignment (i.e. a button with priority `70` will order further to the left than a button with priority `60`, when the menu alignment is `left`). Minimum `0`, maximum `100`. |
@@ -105,7 +105,7 @@ elements:
See the `select` [submenu example](../../../examples.md?id=select-submenu).
## `state-icon`
## `menu-state-icon`
Add a state icon to the Frigate Card menu that represents the state of a Home Assistant entity.
@@ -122,7 +122,7 @@ Configuration is similar to a stock [Picture Elements State Icon](https://www.ho
| `type` | | Must be `custom:frigate-card-menu-state-icon`. |
| `enabled` | `true` | Whether or not to show this menu item. |
| `entity` | | An optional Home Assistant entity for use with actions. |
| `icon` | | An required icon to display, e.g. `mdi:car` |
| `icon` | | An required icon to display, e.g. `mdi:car`. See also [custom icons](../../../usage/custom-icons.md). |
| `permanent` | `false` | If `false` the menu item is hidden when the menu has the `hidden` style and the menu is closed, otherwise it is shown (and sorted to the front). |
| `priority` | `50` | The menu item priority. Higher priority item are ordered closer to the start of the menu alignment (i.e. a button with priority `70` will order further to the left than a button with priority `60`, when the menu alignment is `left`). Minimum `0`, maximum `100`. |
| `tap_action`, `double_tap_action`, `hold_action`, `start_tap`, `end_tap` | | The [actions](../../actions/README.md) to take when this item is interacted with. |
@@ -147,7 +147,7 @@ elements:
| `enabled` | `true` | `true` to enable this status bar item, `false` to disable. |
| `exclusive` | `false` | Whether or not this item should evict non-exclusive items from the status bar. |
| `expand` | `false` | If `false` this status bar item will consume the minimum possible space, if `true` will expand to the available space. |
| `icon` | | The icon to show in the status bar, e.g. `mdi:camera-front`. |
| `icon` | | The icon to show in the status bar, e.g. `mdi:camera-front`. See also [custom icons](../../../usage/custom-icons.md). |
| `priority` | `50` | The item priority. Higher priority items are ordered closer to the start of the status bar (i.e. an item with priority `70` will order further to the left than an item with priority `60`). Minimum `0`, maximum `100`. |
| `sufficient` | `false` | Whether or not this item is sufficient to display the status bar if it's otherwise hidden (e.g. with the `popup` [status bar style](../../status-bar.md)). |
+1 -1
View File
@@ -55,7 +55,7 @@ menu:
| ----------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `alignment` | `matching` | Whether this button should have an alignment that is `matching` the menu alignment or `opposing` the menu. Can be used to create two separate groups of buttons on the menu. `priority` orders buttons within a given `alignment`. |
| `enabled` | `true` for `frigate`, `cameras`, `substreams`, `live`, `clips`, `snapshots`, `timeline`, `download`, `camera_ui`, `fullscreen`, `media_player`, `display_mode` and `ptz_home`. `false` for `image`, `expand`, `microphone`, `mute`, `play`, `recordings`, `screenshot`, `ptz_controls` | Whether or not to show the button. |
| `icon` | | An icon to overriding the default for that button, e.g. `mdi:camera-front`. |
| `icon` | | An icon to overriding the default for that button, e.g. `mdi:camera-front`. See also [custom icons](../usage/custom-icons.md). |
| `permanent` | `false` | If `false` the menu item is hidden when the menu has the `hidden` style and the menu is closed, otherwise it is shown (and sorted to the front). |
## `style`
@@ -6,8 +6,8 @@
fill="none"
version="1.1"
id="svg54"
sodipodi:docname="logo.svg"
inkscape:version="1.1.1 (1:1.1+202109281949+c3084ef5ed)"
sodipodi:docname="frigate.svg"
inkscape:version="1.2.2 (b0a8486541, 2022-12-01)"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
@@ -16,28 +16,30 @@
id="defs58" />
<sodipodi:namedview
id="namedview56"
pagecolor="#ffffff"
pagecolor="#da4040"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageshadow="2"
inkscape:pageopacity="0.0"
inkscape:pageopacity="0"
inkscape:pagecheckerboard="0"
showgrid="false"
width="24px"
inkscape:zoom="45.254834"
inkscape:cx="0.11048543"
inkscape:cy="9.9547376"
inkscape:window-width="3768"
inkscape:window-height="1536"
inkscape:window-x="72"
inkscape:window-y="27"
inkscape:cx="-0.03314563"
inkscape:cy="9.9768347"
inkscape:window-width="3840"
inkscape:window-height="1527"
inkscape:window-x="1080"
inkscape:window-y="227"
inkscape:window-maximized="1"
inkscape:current-layer="svg54"
showguides="true" />
showguides="true"
inkscape:showpageshadow="2"
inkscape:deskcolor="#d1d1d1" />
<path
d="m 4.8759466,22.743573 c 0.0866,0.69274 0.811811,1.16359 0.37885,1.27183 -0.43297,0.10824 -2.32718,-3.43665 -2.7601492,-4.95202 -0.4329602,-1.51538 -0.6764993,-3.22017 -0.5682593,-4.19434 0.1082301,-0.97417 5.7097085,-2.48955 5.7097085,-2.89545 0,-0.4059 -1.81304,-0.0271 -1.89422,-0.35178 -0.0812,-0.32472 1.36925,-0.12989 1.75892,-0.64945 0.60885,-0.81181 1.3800713,-0.6765 1.8671505,-1.1094696 0.4870902,-0.4329599 1.0824089,-2.0836399 1.1906589,-2.7871996 0.108241,-0.70357 -1.0824084,-1.51538 -1.4071389,-2.05658 -0.3247195,-0.54121 0.7035702,-0.92005 3.1931099,-1.94834 2.48954,-1.02829 10.39114,-3.30134994 10.49938,-3.03074994 0.10824,0.27061 -2.59779,1.40713994 -4.492,2.11069994 -1.89422,0.70357 -4.97909,2.05658 -4.97909,2.43542 0,0.37885 0.16236,0.67651 0.0541,1.54244 -0.10824,0.86593 -0.12123,1.2702597 -0.32472,1.8400997 -0.1353,0.37884 -0.2706,1.27183 0,2.0836295 0.21648,0.64945 0.92005,1.13653 1.24477,1.24478 0.2706,0.018 1.01746,0.0433 1.8401,0 1.02829,-0.0541 2.48954,0.0541 2.48954,0.32472 0,0.2706 -2.21894,0.10824 -2.21894,0.48708 0,0.37885 2.27306,-0.0541 2.21894,0.32473 -0.0541,0.37884 -1.89422,0.21648 -2.86839,0.21648 -0.77933,0 -1.93031,-0.0361 -2.43542,-0.21648 l -0.10824,0.37884 c -0.18038,0 -0.55744,0.10824 -0.94711,0.10824 -0.48708,0 -0.51414,0.16236 -1.40713,0.16236 -0.892989,0 -0.622391,-0.0541 -1.4341894,-0.10824 -0.81181,-0.0541 -3.842561,2.27306 -4.383761,3.03075 -0.54121,0.75768 -0.21649,2.59778 -0.21649,3.43665 0,0.75379 -0.10824,2.43542 0,3.30135 z"
fill="#000000"
id="path330"
style="fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.1;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
style="fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:0.1;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
sodipodi:nodetypes="csccscccccsscscccccsscsccssccscc" />
</svg>

Before

Width:  |  Height:  |  Size: 2.7 KiB

After

Width:  |  Height:  |  Size: 2.8 KiB

@@ -2,36 +2,44 @@
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
id="svg2"
version="1.1"
inkscape:version="0.91 r13725"
width="64"
height="64"
inkscape:version="1.2.2 (b0a8486541, 2022-12-01)"
width="24"
height="24"
xml:space="preserve"
sodipodi:docname="motioneye-icon.svg"
sodipodi:docname="motioneye.svg"
inkscape:export-filename="/home/ccrisan/projects/motioneye/static/img/motioneye-logo.png"
inkscape:export-xdpi="960"
inkscape:export-ydpi="960"><metadata
inkscape:export-ydpi="960"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:dc="http://purl.org/dc/elements/1.1/"><metadata
id="metadata8"><rdf:RDF><cc:Work
rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title /></cc:Work></rdf:RDF></metadata><defs
rdf:resource="http://purl.org/dc/dcmitype/StillImage" /></cc:Work></rdf:RDF></metadata><defs
id="defs6"><linearGradient
id="linearGradient4351"
inkscape:collect="always"><stop
id="stop4353"
inkscape:collect="always"
id="linearGradient2058"><stop
style="stop-color:#ffffff;stop-opacity:1;"
offset="0"
style="stop-color:#737373;stop-opacity:1" /><stop
id="stop4355"
id="stop2054" /><stop
style="stop-color:#585858;stop-opacity:1"
offset="1"
style="stop-color:#585858;stop-opacity:1" /></linearGradient><linearGradient
id="stop2056" /></linearGradient><linearGradient
inkscape:collect="always"
id="linearGradient2005"><stop
style="stop-color:#ffffff;stop-opacity:1;"
offset="0"
id="stop2001" /><stop
style="stop-color:#808080;stop-opacity:1;"
offset="1"
id="stop2003" /></linearGradient><linearGradient
inkscape:collect="always"
id="linearGradient4205"><stop
style="stop-color:#4aa3e0;stop-opacity:1"
@@ -42,21 +50,13 @@
id="stop4209" /></linearGradient><linearGradient
inkscape:collect="always"
id="linearGradient4197"><stop
style="stop-color:#787878;stop-opacity:1"
style="stop-color:#ffffff;stop-opacity:1;"
offset="0"
id="stop4199" /><stop
style="stop-color:#585858;stop-opacity:1"
offset="1"
id="stop4201" /></linearGradient><linearGradient
inkscape:collect="always"
xlink:href="#linearGradient4351"
id="linearGradient4203"
x1="26.445793"
y1="47.517574"
x2="26.445793"
y2="3.8183768"
gradientUnits="userSpaceOnUse" /><linearGradient
inkscape:collect="always"
xlink:href="#linearGradient4205"
id="linearGradient4211"
x1="26.602072"
@@ -65,7 +65,7 @@
y2="29.466328"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(0.96428571,0,0,0.96428571,0.91428571,0.91428571)" /><filter
style="color-interpolation-filters:sRGB;"
style="color-interpolation-filters:sRGB"
inkscape:label="Drop Shadow"
id="filter4285"><feFlood
flood-opacity="0.588235"
@@ -91,7 +91,7 @@
result="composite2"
id="feComposite4295" /></filter><linearGradient
inkscape:collect="always"
xlink:href="#linearGradient4197"
xlink:href="#linearGradient2005"
id="linearGradient4309"
gradientUnits="userSpaceOnUse"
x1="26.445793"
@@ -107,18 +107,20 @@
x2="26.445793"
y2="3.8183768" /><linearGradient
inkscape:collect="always"
xlink:href="#linearGradient4197"
xlink:href="#linearGradient2058"
id="linearGradient4313"
gradientUnits="userSpaceOnUse"
x1="26.445793"
y1="47.517574"
x2="26.445793"
y2="3.8183768" /><filter
style="color-interpolation-filters:sRGB;"
style="color-interpolation-filters:sRGB"
inkscape:label="Drop Shadow"
id="filter4315"
x="-0.10000000000000001"
y="-0.16000000000000003"><feFlood
x="-0.03618178"
y="-0.20783284"
width="1.0723636"
height="1.3304883"><feFlood
flood-opacity="0.588235"
flood-color="rgb(0,0,0)"
result="flood"
@@ -141,9 +143,13 @@
operator="over"
result="composite2"
id="feComposite4325" /></filter><filter
style="color-interpolation-filters:sRGB;"
style="color-interpolation-filters:sRGB"
inkscape:label="Drop Shadow"
id="filter4327"><feFlood
id="filter4327"
x="-0.27857143"
y="-0.4720238"
width="1.5571429"
height="1.7505952"><feFlood
flood-opacity="0.588235"
flood-color="rgb(0,0,0)"
result="flood"
@@ -166,9 +172,13 @@
operator="over"
result="composite2"
id="feComposite4337" /></filter><filter
style="color-interpolation-filters:sRGB;"
style="color-interpolation-filters:sRGB"
inkscape:label="Drop Shadow"
id="filter4339"><feFlood
id="filter4339"
x="-0.0202507"
y="-0.13980794"
width="1.0405014"
height="1.2082853"><feFlood
flood-opacity="0.588235"
flood-color="rgb(0,0,0)"
result="flood"
@@ -191,7 +201,7 @@
operator="over"
result="composite2"
id="feComposite4349" /></filter></defs><sodipodi:namedview
pagecolor="#ffffff"
pagecolor="#ff0d0d"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
@@ -199,44 +209,51 @@
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1920"
inkscape:window-height="1025"
inkscape:window-width="3840"
inkscape:window-height="1527"
id="namedview4"
showgrid="false"
inkscape:zoom="2"
inkscape:cx="-94.597631"
inkscape:cy="10.226517"
inkscape:window-x="0"
inkscape:window-y="27"
inkscape:zoom="29.890116"
inkscape:cx="19.973158"
inkscape:cy="16.577386"
inkscape:window-x="1080"
inkscape:window-y="227"
inkscape:window-maximized="1"
inkscape:current-layer="g10"
showguides="true"
inkscape:guide-bbox="true" /><g
inkscape:guide-bbox="true"
inkscape:showpageshadow="true"
inkscape:pagecheckerboard="false"
inkscape:deskcolor="#d1d1d1" /><g
id="g10"
inkscape:groupmode="layer"
inkscape:label="ink_ext_XXXXXX"
transform="matrix(1.25,0,0,-1.25,0,64)"><g
id="g4170"
style="fill:url(#linearGradient4203);fill-opacity:1;filter:url(#filter4327)"
transform="matrix(0.96428571,0,0,0.96428571,0.91428571,0.91428571)"><path
id="g4823"
transform="matrix(1.0344694,0,0,1.0344694,-3.551886,-0.86695248)"><path
id="path4244"
d="M 8.9346154,40.515385 C 5.3647588,36.547307 3.2,31.357779 3.2,25.6 3.2,13.228821 13.228821,3.2 25.6,3.2 37.971179,3.2 48,13.228821 48,25.6 c 0,5.736682 -2.161128,10.952493 -5.707692,14.915385 -1.695935,-0.623286 -3.387833,-1.349065 -5.061539,-2.288462 3.2394,-0.937363 5.6,-3.937988 5.6,-7.457692 0,-4.260339 -3.469626,-7.753846 -7.753846,-7.753846 -3.633936,0 -6.690552,2.51055 -7.538461,5.869231 l -3.876924,0 c -0.840685,-3.360193 -3.903443,-5.869231 -7.538461,-5.869231 -4.284219,0 -7.7807693,3.493507 -7.7807693,7.753846 0,3.56112 2.4570323,6.5856 5.7615383,7.484616 -1.676267,0.912203 -3.404813,1.620556 -5.1692306,2.261538 z M 25.6,26.461538 c 0.532632,-1.981435 1.101793,-3.947553 3.446154,-5.16923 L 25.6,16.123077 22.153846,21.292308 c 2.053593,1.454966 3.000771,3.237758 3.446154,5.16923 z"
style="fill:url(#linearGradient4309);fill-opacity:1;stroke:none"
inkscape:connector-curvature="0" /><path
d="M 8.9346154,40.515385 C 5.3647588,36.547307 3.2,31.357779 3.2,25.6 3.2,13.228821 13.228821,3.2 25.6,3.2 37.971179,3.2 48,13.228821 48,25.6 c 0,5.736682 -2.161128,10.952493 -5.707692,14.915385 -1.695935,-0.623286 -3.387833,-1.349065 -5.061539,-2.288462 3.2394,-0.937363 5.6,-3.937988 5.6,-7.457692 0,-4.260339 -3.469626,-7.753846 -7.753846,-7.753846 -3.633936,0 -6.690552,2.51055 -7.538461,5.869231 h -3.876924 c -0.840685,-3.360193 -3.903443,-5.869231 -7.538461,-5.869231 -4.284219,0 -7.7807693,3.493507 -7.7807693,7.753846 0,3.56112 2.4570323,6.5856 5.7615383,7.484616 -1.676267,0.912203 -3.404813,1.620556 -5.1692306,2.261538 z M 25.6,26.461538 c 0.532632,-1.981435 1.101793,-3.947553 3.446154,-5.16923 L 25.6,16.123077 22.153846,21.292308 c 2.053593,1.454966 3.000771,3.237758 3.446154,5.16923 z"
style="fill:url(#linearGradient4309);fill-opacity:1;stroke:none;filter:url(#filter4327)"
inkscape:connector-curvature="0"
transform="matrix(0.38078533,0,0,0.38078533,2.9655495,31.335499)" /><path
id="path4242"
d="m 16.123077,33.353847 c -1.427443,0 -2.584616,-1.157173 -2.584616,-2.584616 0,-1.427444 1.157173,-2.584615 2.584616,-2.584615 1.427444,0 2.584615,1.157171 2.584615,2.584615 0,1.427443 -1.157171,2.584616 -2.584615,2.584616 z"
style="fill:url(#linearGradient4311);fill-opacity:1;stroke:none"
inkscape:connector-curvature="0" /><path
style="fill:url(#linearGradient4311);fill-opacity:1;stroke:none;filter:url(#filter4327)"
inkscape:connector-curvature="0"
transform="matrix(0.38078533,0,0,0.38078533,2.9655495,31.335499)" /><path
id="path4240"
d="m 35.076923,33.353847 c -1.427443,0 -2.584615,-1.157173 -2.584615,-2.584616 0,-1.427444 1.157172,-2.584615 2.584615,-2.584615 1.427443,0 2.584616,1.157171 2.584616,2.584615 0,1.427443 -1.157173,2.584616 -2.584616,2.584616 z"
style="fill:url(#linearGradient4313);fill-opacity:1;stroke:none"
inkscape:connector-curvature="0" /></g><path
style="fill:url(#linearGradient4313);fill-opacity:1;stroke:none;filter:url(#filter4327)"
inkscape:connector-curvature="0"
style="fill:#737373;fill-opacity:1;stroke:none;filter:url(#filter4339)"
transform="matrix(0.38078533,0,0,0.38078533,2.9655495,31.335499)" /><path
inkscape:connector-curvature="0"
style="fill:#d9d9d9;fill-opacity:1;stroke:none;filter:url(#filter4339)"
d="m 25.6,47.2 c -4.373944,0 -8.437159,-1.399808 -11.838461,-3.634616 3.677605,-0.394237 7.305921,-1.342945 11.423077,-3.375 4.166157,2.122533 8.434154,3.008875 12.279808,3.452886 C 34.057131,45.890032 29.986674,47.2 25.6,47.2 Z"
id="path4248" /><path
id="path4248"
transform="matrix(0.39488848,0,0,0.39488848,2.6045087,30.974457)" /><path
inkscape:connector-curvature="0"
style="fill:url(#linearGradient4211);fill-opacity:1;stroke:none;filter:url(#filter4315)"
d="M 39.723077,42.552884 C 35.394064,42.5242 29.479588,40.397223 25.184616,38.432418 20.668821,40.064102 16.035448,42.649343 10.801923,42.526924 10.453022,42.51873 10.118061,42.50105 9.7634616,42.475 L 5.6615384,42.1375 9.5557693,40.839424 c 5.3417977,-1.74056 10.0398397,-2.851302 14.1749997,-10.025963 0.959101,0 2.845924,-4.15e-4 3.738462,-4.15e-4 4.11884,7.134039 9.059296,8.324614 14.149039,10.026378 L 45.460577,42.085577 41.4625,42.475 c -0.544847,0.05181 -1.120992,0.08198 -1.739423,0.07788 z"
id="path4246"
sodipodi:nodetypes="cccccccccccc" /></g></svg>
sodipodi:nodetypes="cccccccccccc"
transform="matrix(0.39488848,0,0,0.39488848,2.6045087,30.974457)" /></g></g></svg>

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 11 KiB

+7 -1
View File
@@ -28,6 +28,12 @@
:root {
--content-max-width: 95vw;
}
.svg-icon {
background-color: rgb(255, 255, 255);
vertical-align: middle;
background: repeating-conic-gradient(#8080804f 0% 25%, transparent 0% 50%) 50% /
4px 4px;
}
</style>
</head>
<body>
@@ -42,7 +48,7 @@
// The overall documentation name.
name: 'Frigate Card',
logo: 'images/frigate-logo.svg',
logo: 'images/icons/frigate.svg',
// Automatically go to the top of a page on route change.
auto2top: true,
+4
View File
@@ -11,6 +11,10 @@ See [2-way audio](2-way-audio.md) for documentation on using 2-way audio.
See [Casting](casting.md) for documentation on casting the card.
### Custom Icons
See [Custom Icons](custom-icons.md) for custom icons this card supports.
### URL Actions
See [URL Actions](url-actions.md) for documentation on acting based on URL contents.
+1
View File
@@ -6,6 +6,7 @@
- [Usage](README.md)
- [2-way audio](2-way-audio.md)
- [Casting](casting.md)
- [Custom Icons](custom-icons.md)
- [Keyboard Shortcuts](keyboard-shortcuts.md)
- [URL Actions](url-actions.md)
+11
View File
@@ -0,0 +1,11 @@
# Custom Icons
The [`menu`](../configuration/menu.md) and
[`status_bar`](../configuration/status-bar.md) both support a small set of
builtin custom items not found in the traditional [Material Design Icons
(`mdi`)](https://pictogrammers.com/library/mdi/) set by setting the relevant `icon` paramter to the following values.
| Icon Name | Resulting Icon |
| ----------- | --------------------------------------------------------------------------- |
| `frigate` | ![Frigate Icon](../images/icons/frigate.svg ':size=24 :class=svg-icon') |
| `motioneye` | ![motionEye Icon](../images/icons/motioneye.svg ':size=24 :class=svg-icon') |
+16
View File
@@ -0,0 +1,16 @@
#!/bin/bash
# This script copies icons out of the source tree for documentation.
FRIGATE="./src/camera-manager/frigate/assets/frigate.svg"
MOTIONEYE="./src/camera-manager/motioneye/assets/motioneye.svg"
DIR_ICONS="./docs/images/icons"
copy() {
PATH="$1"
echo "Copying image $PATH to $DIR_ICONS"
/bin/cp "$PATH" "$DIR_ICONS"
}
copy "$FRIGATE"
copy "$MOTIONEYE"
@@ -1,3 +0,0 @@
<svg width="512" height="512" viewBox="0 0 512 512" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M130 446.5C131.6 459.3 145 468 137 470C129 472 94 406.5 86 378.5C78 350.5 73.5 319 75.4999 301C77.4999 283 181 255 181 247.5C181 240 147.5 247 146 241C144.5 235 171.3 238.6 178.5 229C189.75 214 204 216.5 213 208.5C222 200.5 233 170 235 157C237 144 215 129 209 119C203 109 222 102 268 83C314 64 460 22 462 27C464 32 414 53 379 66C344 79 287 104 287 111C287 118 290 123.5 288 139.5C286 155.5 285.76 162.971 282 173.5C279.5 180.5 277 197 282 212C286 224 299 233 305 235C310 235.333 323.8 235.8 339 235C358 234 385 236 385 241C385 246 344 243 344 250C344 257 386 249 385 256C384 263 350 260 332 260C317.6 260 296.333 259.333 287 256L285 263C281.667 263 274.7 265 267.5 265C258.5 265 258 268 241.5 268C225 268 230 267 215 266C200 265 144 308 134 322C124 336 130 370 130 385.5C130 399.428 128 430.5 130 446.5Z" fill="white"/>
</svg>

Before

Width:  |  Height:  |  Size: 936 B

@@ -0,0 +1,45 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
width="24"
height="24"
viewBox="0 0 24 24"
fill="none"
version="1.1"
id="svg54"
sodipodi:docname="frigate.svg"
inkscape:version="1.2.2 (b0a8486541, 2022-12-01)"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg">
<defs
id="defs58" />
<sodipodi:namedview
id="namedview56"
pagecolor="#da4040"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageshadow="2"
inkscape:pageopacity="0"
inkscape:pagecheckerboard="0"
showgrid="false"
width="24px"
inkscape:zoom="45.254834"
inkscape:cx="-0.03314563"
inkscape:cy="9.9768347"
inkscape:window-width="3840"
inkscape:window-height="1527"
inkscape:window-x="1080"
inkscape:window-y="227"
inkscape:window-maximized="1"
inkscape:current-layer="svg54"
showguides="true"
inkscape:showpageshadow="2"
inkscape:deskcolor="#d1d1d1" />
<path
d="m 4.8759466,22.743573 c 0.0866,0.69274 0.811811,1.16359 0.37885,1.27183 -0.43297,0.10824 -2.32718,-3.43665 -2.7601492,-4.95202 -0.4329602,-1.51538 -0.6764993,-3.22017 -0.5682593,-4.19434 0.1082301,-0.97417 5.7097085,-2.48955 5.7097085,-2.89545 0,-0.4059 -1.81304,-0.0271 -1.89422,-0.35178 -0.0812,-0.32472 1.36925,-0.12989 1.75892,-0.64945 0.60885,-0.81181 1.3800713,-0.6765 1.8671505,-1.1094696 0.4870902,-0.4329599 1.0824089,-2.0836399 1.1906589,-2.7871996 0.108241,-0.70357 -1.0824084,-1.51538 -1.4071389,-2.05658 -0.3247195,-0.54121 0.7035702,-0.92005 3.1931099,-1.94834 2.48954,-1.02829 10.39114,-3.30134994 10.49938,-3.03074994 0.10824,0.27061 -2.59779,1.40713994 -4.492,2.11069994 -1.89422,0.70357 -4.97909,2.05658 -4.97909,2.43542 0,0.37885 0.16236,0.67651 0.0541,1.54244 -0.10824,0.86593 -0.12123,1.2702597 -0.32472,1.8400997 -0.1353,0.37884 -0.2706,1.27183 0,2.0836295 0.21648,0.64945 0.92005,1.13653 1.24477,1.24478 0.2706,0.018 1.01746,0.0433 1.8401,0 1.02829,-0.0541 2.48954,0.0541 2.48954,0.32472 0,0.2706 -2.21894,0.10824 -2.21894,0.48708 0,0.37885 2.27306,-0.0541 2.21894,0.32473 -0.0541,0.37884 -1.89422,0.21648 -2.86839,0.21648 -0.77933,0 -1.93031,-0.0361 -2.43542,-0.21648 l -0.10824,0.37884 c -0.18038,0 -0.55744,0.10824 -0.94711,0.10824 -0.48708,0 -0.51414,0.16236 -1.40713,0.16236 -0.892989,0 -0.622391,-0.0541 -1.4341894,-0.10824 -0.81181,-0.0541 -3.842561,2.27306 -4.383761,3.03075 -0.54121,0.75768 -0.21649,2.59778 -0.21649,3.43665 0,0.75379 -0.10824,2.43542 0,3.30135 z"
fill="#000000"
id="path330"
style="fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:0.1;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
sodipodi:nodetypes="csccscccccsscscccccsscsccssccscc" />
</svg>

After

Width:  |  Height:  |  Size: 2.8 KiB

+1 -1
View File
@@ -58,7 +58,7 @@ import {
RecordingSegmentsQueryResultsMap,
} from '../types';
import { getDefaultGo2RTCEndpoint } from '../utils/go2rtc-endpoint';
import frigateLogo from './assets/frigate-logo-dark.svg';
import frigateLogo from './assets/frigate.svg';
import { FrigateCamera, isBirdseye } from './camera';
import { FrigateEventWatcher } from './event-watcher';
import { FrigateViewMediaFactory } from './media';
-20
View File
@@ -1,20 +0,0 @@
export const FRIGATE_ICON_SVG_PATH =
'm 4.8759466,22.743573 c 0.0866,0.69274 0.811811,1.16359 0.37885,1.27183 ' +
'-0.43297,0.10824 -2.32718,-3.43665 -2.7601492,-4.95202 -0.4329602,-1.51538 ' +
'-0.6764993,-3.22017 -0.5682593,-4.19434 0.1082301,-0.97417 5.7097085,-2.48955 ' +
'5.7097085,-2.89545 0,-0.4059 -1.81304,-0.0271 -1.89422,-0.35178 -0.0812,-0.32472 ' +
'1.36925,-0.12989 1.75892,-0.64945 0.60885,-0.81181 1.3800713,-0.6765 1.8671505,' +
'-1.1094696 0.4870902,-0.4329599 1.0824089,-2.0836399 1.1906589,-2.7871996 0.108241,' +
'-0.70357 -1.0824084,-1.51538 -1.4071389,-2.05658 -0.3247195,-0.54121 0.7035702,' +
'-0.92005 3.1931099,-1.94834 2.48954,-1.02829 10.39114,-3.30134994 10.49938,' +
'-3.03074994 0.10824,0.27061 -2.59779,1.40713994 -4.492,2.11069994 -1.89422,0.70357 ' +
'-4.97909,2.05658 -4.97909,2.43542 0,0.37885 0.16236,0.67651 0.0541,1.54244 -0.10824,' +
'0.86593 -0.12123,1.2702597 -0.32472,1.8400997 -0.1353,0.37884 -0.2706,1.27183 ' +
'0,2.0836295 0.21648,0.64945 0.92005,1.13653 1.24477,1.24478 0.2706,0.018 1.01746,' +
'0.0433 1.8401,0 1.02829,-0.0541 2.48954,0.0541 2.48954,0.32472 0,0.2706 -2.21894,' +
'0.10824 -2.21894,0.48708 0,0.37885 2.27306,-0.0541 2.21894,0.32473 -0.0541,0.37884 ' +
'-1.89422,0.21648 -2.86839,0.21648 -0.77933,0 -1.93031,-0.0361 -2.43542,-0.21648 ' +
'l -0.10824,0.37884 c -0.18038,0 -0.55744,0.10824 -0.94711,0.10824 -0.48708,0 ' +
'-0.51414,0.16236 -1.40713,0.16236 -0.892989,0 -0.622391,-0.0541 -1.4341894,-0.10824 ' +
'-0.81181,-0.0541 -3.842561,2.27306 -4.383761,3.03075 -0.54121,0.75768 ' +
'-0.21649,2.59778 -0.21649,3.43665 0,0.75379 -0.10824,2.43542 0,3.30135 z';
@@ -0,0 +1,259 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
id="svg2"
version="1.1"
inkscape:version="1.2.2 (b0a8486541, 2022-12-01)"
width="24"
height="24"
xml:space="preserve"
sodipodi:docname="motioneye.svg"
inkscape:export-filename="/home/ccrisan/projects/motioneye/static/img/motioneye-logo.png"
inkscape:export-xdpi="960"
inkscape:export-ydpi="960"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:dc="http://purl.org/dc/elements/1.1/"><metadata
id="metadata8"><rdf:RDF><cc:Work
rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" /></cc:Work></rdf:RDF></metadata><defs
id="defs6"><linearGradient
inkscape:collect="always"
id="linearGradient2058"><stop
style="stop-color:#ffffff;stop-opacity:1;"
offset="0"
id="stop2054" /><stop
style="stop-color:#585858;stop-opacity:1"
offset="1"
id="stop2056" /></linearGradient><linearGradient
inkscape:collect="always"
id="linearGradient2005"><stop
style="stop-color:#ffffff;stop-opacity:1;"
offset="0"
id="stop2001" /><stop
style="stop-color:#808080;stop-opacity:1;"
offset="1"
id="stop2003" /></linearGradient><linearGradient
inkscape:collect="always"
id="linearGradient4205"><stop
style="stop-color:#4aa3e0;stop-opacity:1"
offset="0"
id="stop4207" /><stop
style="stop-color:#3096db;stop-opacity:1"
offset="1"
id="stop4209" /></linearGradient><linearGradient
inkscape:collect="always"
id="linearGradient4197"><stop
style="stop-color:#ffffff;stop-opacity:1;"
offset="0"
id="stop4199" /><stop
style="stop-color:#585858;stop-opacity:1"
offset="1"
id="stop4201" /></linearGradient><linearGradient
inkscape:collect="always"
xlink:href="#linearGradient4205"
id="linearGradient4211"
x1="26.602072"
y1="43.034946"
x2="26.602072"
y2="29.466328"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(0.96428571,0,0,0.96428571,0.91428571,0.91428571)" /><filter
style="color-interpolation-filters:sRGB"
inkscape:label="Drop Shadow"
id="filter4285"><feFlood
flood-opacity="0.588235"
flood-color="rgb(0,0,0)"
result="flood"
id="feFlood4287" /><feComposite
in="flood"
in2="SourceGraphic"
operator="in"
result="composite1"
id="feComposite4289" /><feGaussianBlur
in="composite1"
stdDeviation="0.6"
result="blur"
id="feGaussianBlur4291" /><feOffset
dx="0"
dy="-1"
result="offset"
id="feOffset4293" /><feComposite
in="SourceGraphic"
in2="offset"
operator="over"
result="composite2"
id="feComposite4295" /></filter><linearGradient
inkscape:collect="always"
xlink:href="#linearGradient2005"
id="linearGradient4309"
gradientUnits="userSpaceOnUse"
x1="26.445793"
y1="47.517574"
x2="26.445793"
y2="3.8183768" /><linearGradient
inkscape:collect="always"
xlink:href="#linearGradient4197"
id="linearGradient4311"
gradientUnits="userSpaceOnUse"
x1="26.445793"
y1="47.517574"
x2="26.445793"
y2="3.8183768" /><linearGradient
inkscape:collect="always"
xlink:href="#linearGradient2058"
id="linearGradient4313"
gradientUnits="userSpaceOnUse"
x1="26.445793"
y1="47.517574"
x2="26.445793"
y2="3.8183768" /><filter
style="color-interpolation-filters:sRGB"
inkscape:label="Drop Shadow"
id="filter4315"
x="-0.03618178"
y="-0.20783284"
width="1.0723636"
height="1.3304883"><feFlood
flood-opacity="0.588235"
flood-color="rgb(0,0,0)"
result="flood"
id="feFlood4317" /><feComposite
in="flood"
in2="SourceGraphic"
operator="in"
result="composite1"
id="feComposite4319" /><feGaussianBlur
in="composite1"
stdDeviation="0.6"
result="blur"
id="feGaussianBlur4321" /><feOffset
dx="0"
dy="-1"
result="offset"
id="feOffset4323" /><feComposite
in="SourceGraphic"
in2="offset"
operator="over"
result="composite2"
id="feComposite4325" /></filter><filter
style="color-interpolation-filters:sRGB"
inkscape:label="Drop Shadow"
id="filter4327"
x="-0.27857143"
y="-0.4720238"
width="1.5571429"
height="1.7505952"><feFlood
flood-opacity="0.588235"
flood-color="rgb(0,0,0)"
result="flood"
id="feFlood4329" /><feComposite
in="flood"
in2="SourceGraphic"
operator="in"
result="composite1"
id="feComposite4331" /><feGaussianBlur
in="composite1"
stdDeviation="0.6"
result="blur"
id="feGaussianBlur4333" /><feOffset
dx="0"
dy="-1"
result="offset"
id="feOffset4335" /><feComposite
in="SourceGraphic"
in2="offset"
operator="over"
result="composite2"
id="feComposite4337" /></filter><filter
style="color-interpolation-filters:sRGB"
inkscape:label="Drop Shadow"
id="filter4339"
x="-0.0202507"
y="-0.13980794"
width="1.0405014"
height="1.2082853"><feFlood
flood-opacity="0.588235"
flood-color="rgb(0,0,0)"
result="flood"
id="feFlood4341" /><feComposite
in="flood"
in2="SourceGraphic"
operator="in"
result="composite1"
id="feComposite4343" /><feGaussianBlur
in="composite1"
stdDeviation="0.2"
result="blur"
id="feGaussianBlur4345" /><feOffset
dx="0"
dy="-0.5"
result="offset"
id="feOffset4347" /><feComposite
in="SourceGraphic"
in2="offset"
operator="over"
result="composite2"
id="feComposite4349" /></filter></defs><sodipodi:namedview
pagecolor="#ff0d0d"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="3840"
inkscape:window-height="1527"
id="namedview4"
showgrid="false"
inkscape:zoom="29.890116"
inkscape:cx="19.973158"
inkscape:cy="16.577386"
inkscape:window-x="1080"
inkscape:window-y="227"
inkscape:window-maximized="1"
inkscape:current-layer="g10"
showguides="true"
inkscape:guide-bbox="true"
inkscape:showpageshadow="true"
inkscape:pagecheckerboard="false"
inkscape:deskcolor="#d1d1d1" /><g
id="g10"
inkscape:groupmode="layer"
inkscape:label="ink_ext_XXXXXX"
transform="matrix(1.25,0,0,-1.25,0,64)"><g
id="g4823"
transform="matrix(1.0344694,0,0,1.0344694,-3.551886,-0.86695248)"><path
id="path4244"
d="M 8.9346154,40.515385 C 5.3647588,36.547307 3.2,31.357779 3.2,25.6 3.2,13.228821 13.228821,3.2 25.6,3.2 37.971179,3.2 48,13.228821 48,25.6 c 0,5.736682 -2.161128,10.952493 -5.707692,14.915385 -1.695935,-0.623286 -3.387833,-1.349065 -5.061539,-2.288462 3.2394,-0.937363 5.6,-3.937988 5.6,-7.457692 0,-4.260339 -3.469626,-7.753846 -7.753846,-7.753846 -3.633936,0 -6.690552,2.51055 -7.538461,5.869231 h -3.876924 c -0.840685,-3.360193 -3.903443,-5.869231 -7.538461,-5.869231 -4.284219,0 -7.7807693,3.493507 -7.7807693,7.753846 0,3.56112 2.4570323,6.5856 5.7615383,7.484616 -1.676267,0.912203 -3.404813,1.620556 -5.1692306,2.261538 z M 25.6,26.461538 c 0.532632,-1.981435 1.101793,-3.947553 3.446154,-5.16923 L 25.6,16.123077 22.153846,21.292308 c 2.053593,1.454966 3.000771,3.237758 3.446154,5.16923 z"
style="fill:url(#linearGradient4309);fill-opacity:1;stroke:none;filter:url(#filter4327)"
inkscape:connector-curvature="0"
transform="matrix(0.38078533,0,0,0.38078533,2.9655495,31.335499)" /><path
id="path4242"
d="m 16.123077,33.353847 c -1.427443,0 -2.584616,-1.157173 -2.584616,-2.584616 0,-1.427444 1.157173,-2.584615 2.584616,-2.584615 1.427444,0 2.584615,1.157171 2.584615,2.584615 0,1.427443 -1.157171,2.584616 -2.584615,2.584616 z"
style="fill:url(#linearGradient4311);fill-opacity:1;stroke:none;filter:url(#filter4327)"
inkscape:connector-curvature="0"
transform="matrix(0.38078533,0,0,0.38078533,2.9655495,31.335499)" /><path
id="path4240"
d="m 35.076923,33.353847 c -1.427443,0 -2.584615,-1.157173 -2.584615,-2.584616 0,-1.427444 1.157172,-2.584615 2.584615,-2.584615 1.427443,0 2.584616,1.157171 2.584616,2.584615 0,1.427443 -1.157173,2.584616 -2.584616,2.584616 z"
style="fill:url(#linearGradient4313);fill-opacity:1;stroke:none;filter:url(#filter4327)"
inkscape:connector-curvature="0"
transform="matrix(0.38078533,0,0,0.38078533,2.9655495,31.335499)" /><path
inkscape:connector-curvature="0"
style="fill:#d9d9d9;fill-opacity:1;stroke:none;filter:url(#filter4339)"
d="m 25.6,47.2 c -4.373944,0 -8.437159,-1.399808 -11.838461,-3.634616 3.677605,-0.394237 7.305921,-1.342945 11.423077,-3.375 4.166157,2.122533 8.434154,3.008875 12.279808,3.452886 C 34.057131,45.890032 29.986674,47.2 25.6,47.2 Z"
id="path4248"
transform="matrix(0.39488848,0,0,0.39488848,2.6045087,30.974457)" /><path
inkscape:connector-curvature="0"
style="fill:url(#linearGradient4211);fill-opacity:1;stroke:none;filter:url(#filter4315)"
d="M 39.723077,42.552884 C 35.394064,42.5242 29.479588,40.397223 25.184616,38.432418 20.668821,40.064102 16.035448,42.649343 10.801923,42.526924 10.453022,42.51873 10.118061,42.50105 9.7634616,42.475 L 5.6615384,42.1375 9.5557693,40.839424 c 5.3417977,-1.74056 10.0398397,-2.851302 14.1749997,-10.025963 0.959101,0 2.845924,-4.15e-4 3.738462,-4.15e-4 4.11884,7.134039 9.059296,8.324614 14.149039,10.026378 L 45.460577,42.085577 41.4625,42.475 c -0.544847,0.05181 -1.120992,0.08198 -1.739423,0.07788 z"
id="path4246"
sodipodi:nodetypes="cccccccccccc"
transform="matrix(0.39488848,0,0,0.39488848,2.6045087,30.974457)" /></g></g></svg>

After

Width:  |  Height:  |  Size: 11 KiB

@@ -41,7 +41,7 @@ import {
QueryResultsType,
QueryReturnType,
} from '../types';
import motioneyeLogo from './assets/motioneye-logo.svg';
import motioneyeLogo from './assets/motioneye.svg';
import { MotionEyeEventQueryResults } from './types';
class MotionEyeQueryResultsClassifier {
-51
View File
@@ -1,51 +0,0 @@
// Converted from https://raw.githubusercontent.com/motioneye-project/motioneye/python2/motioneye/static/img/motioneye-icon.svg .
export const MOTIONEYE_ICON_SVG_VIEWBOX = '0 0 64 64';
export const MOTIONEYE_ICON_SVG_PATH =
'M 49.65,10.81 ' +
'C 44.24,10.84 36.85,13.50 31.48,15.96 ' +
'25.84,13.92 20.04,10.69 13.50,10.84 ' +
'13.07,10.85 12.65,10.87 12.20,10.91 ' +
'12.20,10.91 7.08,11.33 7.08,11.33 ' +
'7.08,11.33 11.94,12.95 11.94,12.95 ' +
'18.62,15.13 24.49,16.51 29.66,25.48 ' +
'30.86,25.48 33.22,25.48 34.34,25.48 ' +
'39.49,16.57 45.66,15.08 52.02,12.95 ' +
'52.02,12.95 56.83,11.39 56.83,11.39 ' +
'56.83,11.39 51.83,10.91 51.83,10.91 ' +
'51.15,10.84 50.43,10.80 49.65,10.81 ' +
'49.65,10.81 49.65,10.81 49.65,10.81 Z ' +
'M 32.00,5.00 ' +
'C 26.53,5.00 21.45,6.75 17.20,9.54 ' +
'21.80,10.04 26.33,11.22 31.48,13.76 ' +
'36.69,11.11 42.02,10.00 46.83,9.45 ' +
'42.57,6.64 37.48,5.00 32.00,5.00 Z ' +
'M 43.42,22.65 ' +
'C 41.70,22.65 40.31,24.05 40.31,25.77 ' +
'40.31,27.49 41.70,28.88 43.42,28.88 ' +
'45.14,28.88 46.54,27.49 46.54,25.77 ' +
'46.54,24.05 45.14,22.65 43.42,22.65 Z ' +
'M 20.58,22.65 ' +
'C 18.86,22.65 17.46,24.05 17.46,25.77 ' +
'17.46,27.49 18.86,28.88 20.58,28.88 ' +
'22.30,28.88 23.69,27.49 23.69,25.77 ' +
'23.69,24.05 22.30,22.65 20.58,22.65 Z ' +
'M 11.91,14.02 ' +
'C 7.61,18.80 5.00,25.06 5.00,32.00 ' +
'5.00,46.91 17.09,59.00 32.00,59.00 ' +
'46.91,59.00 59.00,46.91 59.00,32.00 ' +
'59.00,25.09 56.40,18.80 52.12,14.02 ' +
'50.08,14.77 48.04,15.65 46.02,16.78 ' +
'49.92,17.91 52.77,21.53 52.77,25.77 ' +
'52.77,30.90 48.59,35.12 43.42,35.12 ' +
'39.04,35.12 35.36,32.09 34.34,28.04 ' +
'34.34,28.04 29.66,28.04 29.66,28.04 ' +
'28.65,32.09 24.96,35.12 20.58,35.12 ' +
'15.41,35.12 11.20,30.90 11.20,25.77 ' +
'11.20,21.48 14.16,17.83 18.14,16.75 ' +
'16.12,15.65 14.04,14.79 11.91,14.02 ' +
'11.91,14.02 11.91,14.02 11.91,14.02 Z ' +
'M 32.00,30.96 ' +
'C 32.64,33.35 33.33,35.72 36.15,37.19 ' +
'36.15,37.19 32.00,43.42 32.00,43.42 ' +
'32.00,43.42 27.85,37.19 27.85,37.19 ' +
'30.32,35.44 31.46,33.29 32.00,30.96 Z';
-6
View File
@@ -1,7 +1,6 @@
import { HASSDomEvent, HomeAssistant } from '@dermotduffy/custom-card-helpers';
import { LitElement } from 'lit';
import { orderBy } from 'lodash-es';
import { FRIGATE_ICON_SVG_PATH } from '../camera-manager/frigate/icon.js';
import { dispatchActionExecutionRequest } from '../card-controller/actions/utils/execution-request.js';
import {
FRIGATE_MENU_PRIORITY_MAX,
@@ -10,7 +9,6 @@ import {
type MenuConfig,
type MenuItem,
} from '../config/types.js';
import { FRIGATE_BUTTON_MENU_ICON } from '../const.js';
import { StateParameters } from '../types.js';
import {
convertActionToCardCustomAction,
@@ -167,10 +165,6 @@ export class MenuController {
: stateParameters;
}
public getSVGPath(button: MenuItem): string {
return button.icon === FRIGATE_BUTTON_MENU_ICON ? FRIGATE_ICON_SVG_PATH : '';
}
protected _sortButtons(): void {
this._buttons = orderBy(
this._buttons,
+4 -3
View File
@@ -8,6 +8,7 @@ import { MenuController } from '../components-lib/menu-controller.js';
import type { MenuConfig, MenuItem } from '../config/types.js';
import menuStyle from '../scss/menu.scss';
import { frigateCardHasAction } from '../utils/action.js';
import { getCustomIconURL } from '../utils/custom-icons.js';
import { EntityRegistryManager } from '../utils/ha/registry/entity/index.js';
import './submenu.js';
@@ -72,7 +73,7 @@ export class FrigateCardMenu extends LitElement {
// (`data-state`). This looks up a CSS style in `menu.scss`.
const buttonState = this._controller.getFreshButtonState(this.hass, button);
const svgPath = this._controller.getSVGPath(button);
const customImageURL = getCustomIconURL(buttonState.icon);
return html` <ha-icon-button
data-domain=${ifDefined(buttonState.data_domain)}
@@ -86,8 +87,8 @@ export class FrigateCardMenu extends LitElement {
.label=${buttonState.title || ''}
@action=${(ev) => this._controller.actionHandler(ev, button)}
>
${svgPath
? html`<ha-svg-icon .path="${svgPath}"></ha-svg-icon>`
${customImageURL
? html`<img src="${customImageURL}" />`
: html`<ha-icon
icon="${buttonState.icon || 'mdi:gesture-tap-button'}"
></ha-icon>`}
+10 -1
View File
@@ -13,6 +13,7 @@ import { StatusBarController } from '../components-lib/status-bar-controller';
import { StatusBarConfig, StatusBarItem } from '../config/types';
import statusStyle from '../scss/status.scss';
import { frigateCardHasAction } from '../utils/action';
import { getCustomIconURL } from '../utils/custom-icons.js';
@customElement('frigate-card-status-bar')
export class FrigateCardStatusBar extends LitElement {
@@ -67,7 +68,15 @@ export class FrigateCardStatusBar extends LitElement {
${item.string}
</div>`;
} else if (item.type === 'custom:frigate-card-status-bar-icon') {
return html`<ha-icon
const customIconURL = getCustomIconURL(item.icon);
return customIconURL
? html`<img
.actionHandler=${handler}
class="${classes}"
src="${customIconURL}"
@action=${(ev) => this._controller.actionHandler(ev, item.actions)}
/>`
: html`<ha-icon
.actionHandler=${handler}
class="${classes}"
icon="${item.icon}"
+11 -1
View File
@@ -18,6 +18,7 @@ import {
frigateCardHasAction,
stopEventFromActivatingCardWideActions,
} from '../utils/action.js';
import { getCustomIconURL } from '../utils/custom-icons.js';
import { isHassDifferent, refreshDynamicStateParameters } from '../utils/ha';
import { getEntityStateTranslation } from '../utils/ha/entity-state-translation.js';
import { EntityRegistryManager } from '../utils/ha/registry/entity/index.js';
@@ -40,7 +41,16 @@ export class FrigateCardSubmenu extends LitElement {
} as StateParameters);
const getIcon = (stateParameters: StateParameters): TemplateResult => {
if (stateParameters.icon) {
return html` <ha-icon
const url = getCustomIconURL(stateParameters.icon);
return url
? html`<img
style="${styleMap(stateParameters.style || {})}"
data-domain=${ifDefined(stateParameters.data_domain)}
data-state=${ifDefined(stateParameters.data_state)}
slot="graphic"
src=${url}
/>`
: html` <ha-icon
style="${styleMap(stateParameters.style || {})}"
data-domain=${ifDefined(stateParameters.data_domain)}
data-state=${ifDefined(stateParameters.data_state)}
+38 -49
View File
@@ -6,11 +6,6 @@ import {
import { CSSResultGroup, html, LitElement, TemplateResult, unsafeCSS } from 'lit';
import { customElement, property, state } from 'lit/decorators.js';
import { classMap } from 'lit/directives/class-map.js';
import { FRIGATE_ICON_SVG_PATH } from './camera-manager/frigate/icon.js';
import {
MOTIONEYE_ICON_SVG_PATH,
MOTIONEYE_ICON_SVG_VIEWBOX,
} from './camera-manager/motioneye/icon.js';
import './components/key-assigner.js';
import { KeyboardShortcut } from './config/keyboard-shortcuts.js';
import {
@@ -230,6 +225,7 @@ import { localize } from './localize/localize.js';
import frigate_card_editor_style from './scss/editor.scss';
import { arrayMove, prettifyTitle } from './utils/basic.js';
import { getCameraID } from './utils/camera.js';
import { getCustomIconURL } from './utils/custom-icons.js';
import {
getEntitiesFromHASS,
getEntityTitle,
@@ -1100,7 +1096,7 @@ export class FrigateCardEditor extends LitElement implements LovelaceCardEditor
MENU_VIEW_DEFAULT_RESET,
true,
`config.${CONF_VIEW_DEFAULT_RESET}.editor_label`,
{ name: 'mdi:restart' },
'mdi:restart',
html`
${this._renderSwitch(
CONF_VIEW_DEFAULT_RESET_AFTER_INTERACTION,
@@ -1130,7 +1126,7 @@ export class FrigateCardEditor extends LitElement implements LovelaceCardEditor
MENU_VIEW_TRIGGERS,
true,
`config.${CONF_VIEW_TRIGGERS}.editor_label`,
{ name: 'mdi:target-account' },
'mdi:target-account',
html`
${this._renderSwitch(
CONF_VIEW_TRIGGERS_FILTER_SELECTED_CAMERA,
@@ -1153,7 +1149,7 @@ export class FrigateCardEditor extends LitElement implements LovelaceCardEditor
MENU_VIEW_TRIGGERS_ACTIONS,
true,
`config.${CONF_VIEW_TRIGGERS_ACTIONS}.editor_label`,
{ name: 'mdi:cogs' },
'mdi:cogs',
html` ${this._renderOptionSelector(
CONF_VIEW_TRIGGERS_ACTIONS_TRIGGER,
this._triggersActionsTrigger,
@@ -1198,7 +1194,7 @@ export class FrigateCardEditor extends LitElement implements LovelaceCardEditor
MENU_VIEW_KEYBOARD_SHORTCUTS,
true,
`config.${CONF_VIEW_KEYBOARD_SHORTCUTS}.editor_label`,
{ name: 'mdi:keyboard' },
'mdi:keyboard',
html`
${this._renderSwitch(
CONF_VIEW_KEYBOARD_SHORTCUTS_ENABLED,
@@ -1244,7 +1240,7 @@ export class FrigateCardEditor extends LitElement implements LovelaceCardEditor
MENU_STATUS_BAR_ITEMS,
item,
`config.status_bar.items.${item}`,
{ name: 'mdi:feature-search' },
'mdi:feature-search',
html`
${this._renderSwitch(
`${CONF_STATUS_BAR_ITEMS}.${item}.enabled`,
@@ -1276,7 +1272,7 @@ export class FrigateCardEditor extends LitElement implements LovelaceCardEditor
MENU_MENU_BUTTONS,
button,
`config.menu.buttons.${button}`,
{ name: 'mdi:gesture-tap-button' },
'mdi:gesture-tap-button',
html`
${this._renderSwitch(
`${CONF_MENU_BUTTONS}.${button}.enabled`,
@@ -1325,11 +1321,7 @@ export class FrigateCardEditor extends LitElement implements LovelaceCardEditor
domain: string,
key: unknown,
labelPath: string,
icon: {
name?: string;
path?: string;
viewBox?: string;
},
icon: string,
template: TemplateResult,
): TemplateResult {
const selected = this._expandedMenus[domain] === key;
@@ -1338,6 +1330,7 @@ export class FrigateCardEditor extends LitElement implements LovelaceCardEditor
selected: selected,
};
const customIconURL = getCustomIconURL(icon);
return html` <div class="${classMap(submenuClasses)}">
<div
class="submenu-header"
@@ -1345,13 +1338,9 @@ export class FrigateCardEditor extends LitElement implements LovelaceCardEditor
.domain=${domain}
.key=${key}
>
${icon.name
? html` <ha-icon .icon=${icon.name}></ha-icon> `
: icon.path
? html`
<ha-svg-icon .viewBox=${icon.viewBox} .path="${icon.path}"></ha-svg-icon>
`
: ``}
${customIconURL
? html` <img src=${customIconURL} /> `
: html` <ha-icon .icon=${icon}></ha-icon> `}
<span>${localize(labelPath)}</span>
</div>
${selected ? html`<div class="values">${template}</div>` : ''}
@@ -1385,7 +1374,7 @@ export class FrigateCardEditor extends LitElement implements LovelaceCardEditor
domain,
true,
labelPath,
{ name: 'mdi:page-layout-body' },
'mdi:page-layout-body',
html`
${this._renderNumberInput(configPathZoom, {
min: 0,
@@ -1410,7 +1399,7 @@ export class FrigateCardEditor extends LitElement implements LovelaceCardEditor
`${domain}.position`,
true,
'config.cameras.dimensions.layout.position.editor_label',
{ name: 'mdi:aspect-ratio' },
'mdi:aspect-ratio',
html` ${this._renderNumberInput(configPathPositionX, {
min: 0,
max: 100,
@@ -1426,7 +1415,7 @@ export class FrigateCardEditor extends LitElement implements LovelaceCardEditor
`${domain}.view_box`,
true,
'config.cameras.dimensions.layout.view_box.editor_label',
{ name: 'mdi:crop' },
'mdi:crop',
html`
${this._renderNumberInput(configPathViewBoxTop, {
min: 0,
@@ -1525,7 +1514,7 @@ export class FrigateCardEditor extends LitElement implements LovelaceCardEditor
domain,
true,
'config.common.controls.timeline.editor_label',
{ name: 'mdi:chart-gantt' },
'mdi:chart-gantt',
html` ${this._renderOptionSelector(configPathMode, this._miniTimelineModes, {
label: localize('config.common.controls.timeline.mode'),
})}
@@ -1563,7 +1552,7 @@ export class FrigateCardEditor extends LitElement implements LovelaceCardEditor
domain,
true,
'config.common.display.editor_label',
{ name: 'mdi:palette-swatch' },
'mdi:palette-swatch',
html`
${this._renderOptionSelector(configPathMode, this._displayModes, {
label: localize('config.common.display.mode'),
@@ -1604,7 +1593,7 @@ export class FrigateCardEditor extends LitElement implements LovelaceCardEditor
domain,
true,
'config.common.controls.next_previous.editor_label',
{ name: 'mdi:arrow-right-bold-circle' },
'mdi:arrow-right-bold-circle',
html`
${this._renderOptionSelector(
configPathStyle,
@@ -1659,7 +1648,7 @@ export class FrigateCardEditor extends LitElement implements LovelaceCardEditor
domain,
true,
'config.common.controls.thumbnails.editor_label',
{ name: 'mdi:image-text' },
'mdi:image-text',
html`
${options?.configPathMode
? html`${this._renderOptionSelector(
@@ -1735,7 +1724,7 @@ export class FrigateCardEditor extends LitElement implements LovelaceCardEditor
domain,
true,
'config.common.controls.filter.editor_label',
{ name: 'mdi:filter-cog' },
'mdi:filter-cog',
html`
${configPathMode
? html`${this._renderOptionSelector(configPathMode, this._filterModes, {
@@ -1946,12 +1935,12 @@ export class FrigateCardEditor extends LitElement implements LovelaceCardEditor
MENU_CAMERAS_ENGINE,
true,
'config.cameras.engines.editor_label',
{ name: 'mdi:engine' },
'mdi:engine',
html`${this._putInSubmenu(
MENU_CAMERAS_FRIGATE,
cameraIndex,
'config.cameras.frigate.editor_label',
{ path: FRIGATE_ICON_SVG_PATH },
'frigate',
html`
${this._renderStringInput(
getArrayConfigPath(
@@ -1990,7 +1979,7 @@ export class FrigateCardEditor extends LitElement implements LovelaceCardEditor
MENU_CAMERAS_MOTIONEYE,
cameraIndex,
'config.cameras.motioneye.editor_label',
{ path: MOTIONEYE_ICON_SVG_PATH, viewBox: MOTIONEYE_ICON_SVG_VIEWBOX },
'motioneye',
html`
${this._renderStringInput(
getArrayConfigPath(CONF_CAMERAS_ARRAY_MOTIONEYE_URL, cameraIndex),
@@ -2026,12 +2015,12 @@ export class FrigateCardEditor extends LitElement implements LovelaceCardEditor
MENU_CAMERAS_LIVE_PROVIDER,
true,
'config.cameras.live_provider_options.editor_label',
{ name: 'mdi:cctv' },
'mdi:cctv',
html` ${this._putInSubmenu(
MENU_CAMERAS_GO2RTC,
cameraIndex,
'config.cameras.go2rtc.editor_label',
{ name: 'mdi:alpha-g-circle' },
'mdi:alpha-g-circle',
html`${this._renderOptionSelector(
getArrayConfigPath(CONF_CAMERAS_ARRAY_GO2RTC_MODES, cameraIndex),
this._go2rtcModes,
@@ -2048,7 +2037,7 @@ export class FrigateCardEditor extends LitElement implements LovelaceCardEditor
MENU_CAMERAS_IMAGE,
true,
'config.cameras.image.editor_label',
{ name: 'mdi:image' },
'mdi:image',
this._renderImageOptions(
getArrayConfigPath(CONF_CAMERAS_ARRAY_IMAGE_MODE, cameraIndex),
getArrayConfigPath(CONF_CAMERAS_ARRAY_IMAGE_URL, cameraIndex),
@@ -2067,7 +2056,7 @@ export class FrigateCardEditor extends LitElement implements LovelaceCardEditor
MENU_CAMERAS_WEBRTC_CARD,
cameraIndex,
'config.cameras.webrtc_card.editor_label',
{ name: 'mdi:webrtc' },
'mdi:webrtc',
html`${this._renderEntitySelector(
getArrayConfigPath(
CONF_CAMERAS_ARRAY_WEBRTC_CARD_ENTITY,
@@ -2084,7 +2073,7 @@ export class FrigateCardEditor extends LitElement implements LovelaceCardEditor
MENU_CAMERAS_DEPENDENCIES,
cameraIndex,
'config.cameras.dependencies.editor_label',
{ name: 'mdi:graph' },
'mdi:graph',
html` ${this._renderSwitch(
getArrayConfigPath(
CONF_CAMERAS_ARRAY_DEPENDENCIES_ALL_CAMERAS,
@@ -2107,7 +2096,7 @@ export class FrigateCardEditor extends LitElement implements LovelaceCardEditor
MENU_CAMERAS_TRIGGERS,
cameraIndex,
'config.cameras.triggers.editor_label',
{ name: 'mdi:magnify-scan' },
'mdi:magnify-scan',
html`
${this._renderSwitch(
getArrayConfigPath(
@@ -2144,7 +2133,7 @@ export class FrigateCardEditor extends LitElement implements LovelaceCardEditor
MENU_CAMERAS_CAST,
cameraIndex,
'config.cameras.cast.editor_label',
{ name: 'mdi:cast' },
'mdi:cast',
html`
${this._renderOptionSelector(
getArrayConfigPath(CONF_CAMERAS_ARRAY_CAST_METHOD, cameraIndex),
@@ -2168,7 +2157,7 @@ export class FrigateCardEditor extends LitElement implements LovelaceCardEditor
MENU_CAMERAS_DIMENSIONS,
cameraIndex,
'config.cameras.dimensions.editor_label',
{ name: 'mdi:aspect-ratio' },
'mdi:aspect-ratio',
html`
${this._renderStringInput(
getArrayConfigPath(
@@ -2226,7 +2215,7 @@ export class FrigateCardEditor extends LitElement implements LovelaceCardEditor
MENU_CAMERAS_CAPABILITIES,
cameraIndex,
'config.cameras.capabilities.editor_label',
{ name: 'mdi:cog-stop' },
'mdi:cog-stop',
html`
${this._renderOptionSelector(
getArrayConfigPath(
@@ -2538,7 +2527,7 @@ export class FrigateCardEditor extends LitElement implements LovelaceCardEditor
MENU_LIVE_CONTROLS,
true,
'config.live.controls.editor_label',
{ name: 'mdi:gamepad' },
'mdi:gamepad',
html`
${this._renderSwitch(
CONF_LIVE_CONTROLS_BUILTIN,
@@ -2585,7 +2574,7 @@ export class FrigateCardEditor extends LitElement implements LovelaceCardEditor
MENU_LIVE_CONTROLS_PTZ,
true,
'config.live.controls.ptz.editor_label',
{ name: 'mdi:pan' },
'mdi:pan',
html`
${this._renderOptionSelector(
CONF_LIVE_CONTROLS_PTZ_MODE,
@@ -2628,7 +2617,7 @@ export class FrigateCardEditor extends LitElement implements LovelaceCardEditor
MENU_LIVE_MICROPHONE,
true,
'config.live.microphone.editor_label',
{ name: 'mdi:microphone' },
'mdi:microphone',
html`
${this._renderNumberInput(CONF_LIVE_MICROPHONE_DISCONNECT_SECONDS)}
${this._renderSwitch(
@@ -2723,7 +2712,7 @@ export class FrigateCardEditor extends LitElement implements LovelaceCardEditor
MENU_MEDIA_VIEWER_CONTROLS,
true,
'config.media_viewer.controls.editor_label',
{ name: 'mdi:gamepad' },
'mdi:gamepad',
html`
${this._renderSwitch(
CONF_MEDIA_VIEWER_CONTROLS_BUILTIN,
@@ -2830,7 +2819,7 @@ export class FrigateCardEditor extends LitElement implements LovelaceCardEditor
MENU_PERFORMANCE_FEATURES,
true,
'config.performance.features.editor_label',
{ name: 'mdi:feature-search' },
'mdi:feature-search',
html`
${this._renderSwitch(
CONF_PERFORMANCE_FEATURES_ANIMATED_PROGRESS_INDICATOR,
@@ -2851,7 +2840,7 @@ export class FrigateCardEditor extends LitElement implements LovelaceCardEditor
MENU_PERFORMANCE_STYLE,
true,
'config.performance.style.editor_label',
{ name: 'mdi:palette-swatch-variant' },
'mdi:palette-swatch-variant',
html`
${this._renderSwitch(
CONF_PERFORMANCE_STYLE_BORDER_RADIUS,
+1 -1
View File
@@ -71,7 +71,7 @@ div.upgrade span {
}
.submenu-header ha-icon,
.submenu-header ha-svg-icon {
.submenu-header img {
padding-right: 15px;
}
+13
View File
@@ -0,0 +1,13 @@
import frigateSVG from '../camera-manager/frigate/assets/frigate.svg';
import motioneyeSVG from '../camera-manager/motioneye/assets/motioneye.svg';
export const getCustomIconURL = (icon?: string): string | null => {
switch (icon) {
case 'frigate':
return frigateSVG;
case 'motioneye':
return motioneyeSVG;
default:
return null;
}
};
-1
View File
@@ -306,7 +306,6 @@ export const sideLoadHomeAssistantElements = async (): Promise<boolean> => {
'ha-icon',
'ha-menu-button',
'ha-selector',
'ha-svg-icon',
'ha-web-rtc-player',
];
@@ -1,6 +1,5 @@
import { handleActionConfig } from '@dermotduffy/custom-card-helpers';
import { beforeEach, describe, expect, it, vi } from 'vitest';
import { FRIGATE_ICON_SVG_PATH } from '../../src/camera-manager/frigate/icon';
import { MenuController } from '../../src/components-lib/menu-controller';
import { MenuConfig, menuConfigSchema } from '../../src/config/types';
import { StateParameters } from '../../src/types';
@@ -395,26 +394,6 @@ describe('MenuController', () => {
});
});
describe('should get svg path', () => {
it('frigate icon', () => {
const controller = new MenuController(createLitElement());
const button = {
type: 'custom:frigate-card-menu-icon' as const,
icon: 'frigate',
};
expect(controller.getSVGPath(button)).toEqual(FRIGATE_ICON_SVG_PATH);
});
it('non-frigate icon', () => {
const controller = new MenuController(createLitElement());
const button = {
type: 'custom:frigate-card-menu-icon' as const,
icon: 'mdi:cow',
};
expect(controller.getSVGPath(button)).toBeFalsy();
});
});
describe('should handle actions', () => {
it('should bail without config', () => {
const controller = new MenuController(createLitElement());
+22
View File
@@ -0,0 +1,22 @@
import { describe, expect, it } from 'vitest';
import frigateSVG from '../../src/camera-manager/frigate/assets/frigate.svg';
import motioneyeSVG from '../../src/camera-manager/motioneye/assets/motioneye.svg';
import { getCustomIconURL } from '../../src/utils/custom-icons';
describe('getCustomIconURL', () => {
it('should return frigate SVG for frigate icon', () => {
expect(getCustomIconURL('frigate')).toBe(frigateSVG);
});
it('should return motioneye SVG for motioneye icon', () => {
expect(getCustomIconURL('motioneye')).toBe(motioneyeSVG);
});
it('should return null for mdi icon', () => {
expect(getCustomIconURL('mdi:car')).toBeNull();
});
it('should return null for undefined icon', () => {
expect(getCustomIconURL()).toBeNull();
});
});
-1
View File
@@ -31,7 +31,6 @@
"ha-icon-button",
"ha-icon",
"ha-selector",
"ha-svg-icon",
"mwc-button",
"mwc-list-item"
],
+1 -2
View File
@@ -5,11 +5,9 @@ const FULL_COVERAGE_FILES_RELATIVE = [
'camera-manager/*.ts',
'camera-manager/browse-media/camera.ts',
'camera-manager/frigate/camera.ts',
'camera-manager/frigate/icon.ts',
'camera-manager/frigate/requests.ts',
'camera-manager/frigate/util.ts',
'camera-manager/generic/*.ts',
'camera-manager/motioneye/icon.ts',
'camera-manager/utils/*.ts',
'card-controller/**/*.ts',
'components-lib/**/!(timeline-source.ts)',
@@ -20,6 +18,7 @@ const FULL_COVERAGE_FILES_RELATIVE = [
'utils/audio.ts',
'utils/basic.ts',
'utils/camera.ts',
'utils/custom-icons.ts',
'utils/debug.ts',
'utils/diagnostics.ts',
'utils/download.ts',