forked from ioBroker/MMM-ioBroker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
MMM-Floorplan.njk
33 lines (32 loc) · 1.42 KB
/
MMM-Floorplan.njk
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<div class="flex-container small extra-width">
{% block devices %}
<div class="floorplan">
{% for device in config.devices %}
{% block device %}
{% for deviceState in device.deviceStates %}
{% block state %}
<div class="floorplan-item" style="left: {{ deviceState.left }}px; top:{{ deviceState.top }}px">
{% if deviceState.type == 'door' %}
<div class="value small bright">
<i class="dimmed {% if values[deviceState.id] == true %}fa fa-door-open open {% else %}fa fa-door-closed{% endif %}"></i>
</div>
{% elif deviceState.type == 'light' %}
<div class="value small bright">
<i class="dimmed fa fa-lightbulb {% if values[deviceState.id] == true %}light-on{% endif %}"></i>
</div>
{% else %}
<div class="value small bright">
{% if deviceState.icon %}<i class="dimmed {{ deviceState.icon }}"></i>{% endif %}
{{ values[deviceState.id] | default('---')}}{{ deviceState.suffix | default('') | safe }}
</div>
{% endif %}
{% endblock %}
</div>
{% else %}
{% endfor %}
{% endblock %}
{% else %}
{% endfor %}
</div>
{% endblock %}
</div>