Skip to content

Home Information - Your home, your data, organized.

Python

More event styling. Added microwave-oven entity type / icon.

Anthony Cassandra5866b5dd9d06
diff --git a/src/hi/apps/attribute/templates/attribute/panes/attribute_form_new.html b/src/hi/apps/attribute/templates/attribute/panes/attribute_form_new.html
index d3c170a7..25770da7 100644
--- a/src/hi/apps/attribute/templates/attribute/panes/attribute_form_new.html
+++ b/src/hi/apps/attribute/templates/attribute/panes/attribute_form_new.html
@@ -1,10 +1,22 @@
<div class="my-2">
- <a class="" data-toggle="collapse" href="#collapseExample"
- role="button" aria-expanded="false" aria-controls="collapseExample">
+ <a class="" data-toggle="collapse" href="#hi-attribute-new"
+ role="button" aria-expanded="false" aria-controls="hi-attribute-new">
<span class="plus-icon">&#43;</span> Add New Attribute
</a>
</div>
-<div class="collapse my-2" id="collapseExample">
+<div class="collapse my-2" id="hi-attribute-new">
+
+ {% for hidden in attribute_form.hidden_fields %}
+ {{ hidden }}
+ {% endfor %}
+
+ {% if attribute_form.non_field_errors %}
+ <div class="non-field-errors">
+ {% for err in attribute_form.non_field_errors %}
+ <p class="form-error text-danger">ERROR: {{ err }}</p>
+ {% endfor %}
+ </div>
+ {% endif %}
<div class="form-group" >
<label for="{{ attribute_form.name.id_for_label }}"><em>New {{ attribute_form.name.label }}</em></label>
diff --git a/src/hi/apps/entity/enums.py b/src/hi/apps/entity/enums.py
index c58fb334..68d9806a 100644
--- a/src/hi/apps/entity/enums.py
+++ b/src/hi/apps/entity/enums.py
@@ -44,6 +44,7 @@ class EntityType(LabeledEnum):
HYGROMETER = ( 'Hygrometer', '' )
LIGHT = ( 'Light', '' )
LIGHT_SENSOR = ( 'Light Sensor', '' )
+ MICROWAVE_OVEN = ( 'Microwave Oven', '' )
MODEM = ( 'Modem', '' )
MOTION_SENSOR = ( 'Motion Sensor', '' )
MOTOR = ( 'Motor', '' )
diff --git a/src/hi/apps/entity/templates/entity/svg/type.microwave_oven.svg b/src/hi/apps/entity/templates/entity/svg/type.microwave_oven.svg
new file mode 100644
index 00000000..0d2b5fa0
--- /dev/null
+++ b/src/hi/apps/entity/templates/entity/svg/type.microwave_oven.svg
@@ -0,0 +1,246 @@
+<rect class="hi-entity-bg" x="0" y="0" width="64" height="46" fill="none"/>
+ <path class="hi-entity-microwave-oven-background"
+ fill="#888888" stroke="black" stroke-width="0"
+ d="M 6.43,42.57
+ C 4.34,42.57 1.59,42.82 0.83,40.29
+ 0.70,39.86 0.71,39.44 0.71,39.00
+ 0.71,39.00 0.71,10.57 0.71,10.57
+ 0.71,10.57 0.71,3.86 0.71,3.86
+ 0.74,1.63 2.18,0.57 4.29,0.57
+ 4.29,0.57 49.57,0.57 49.57,0.57
+ 49.57,0.57 59.71,0.57 59.71,0.57
+ 62.08,0.58 63.28,1.78 63.29,4.14
+ 63.29,4.14 63.29,33.57 63.29,33.57
+ 63.29,33.57 63.29,37.86 63.29,37.86
+ 63.29,39.83 63.39,41.70 61.00,42.36
+ 60.46,42.51 59.99,42.56 59.43,42.57
+ 59.43,42.57 57.57,42.57 57.57,42.57
+ 57.57,43.37 57.68,44.31 57.06,44.92
+ 56.37,45.62 54.80,45.43 53.86,45.43
+ 53.09,45.43 50.41,45.51 49.86,45.30
+ 49.38,45.12 49.06,44.76 48.88,44.29
+ 48.67,43.77 48.71,43.12 48.71,42.57
+ 48.71,42.57 15.29,42.57 15.29,42.57
+ 15.29,43.12 15.33,43.77 15.12,44.29
+ 14.94,44.76 14.62,45.12 14.14,45.30
+ 13.59,45.51 10.91,45.43 10.14,45.43
+ 9.20,45.43 7.63,45.62 6.94,44.92
+ 6.32,44.31 6.43,43.37 6.43,42.57 Z" />
+ <path class="hi-entity-microwave-oven-window"
+ fill="#9cafd0" stroke="black" stroke-width="0"
+ d="M 8.29,7.25
+ C 9.08,7.06 10.82,7.14 11.71,7.14
+ 11.71,7.14 18.00,7.14 18.00,7.14
+ 18.00,7.14 38.43,7.14 38.43,7.14
+ 38.43,7.14 45.57,7.14 45.57,7.14
+ 47.08,7.16 47.28,7.79 47.29,9.14
+ 47.29,9.14 47.29,29.71 47.29,29.71
+ 47.29,29.71 47.29,34.14 47.29,34.14
+ 47.28,34.66 47.31,35.12 46.94,35.54
+ 46.49,36.05 45.90,36.00 45.29,36.00
+ 45.29,36.00 16.29,36.00 16.29,36.00
+ 16.29,36.00 9.14,36.00 9.14,36.00
+ 7.71,35.99 7.43,35.49 7.43,34.14
+ 7.43,34.14 7.43,13.86 7.43,13.86
+ 7.43,13.86 7.43,9.00 7.43,9.00
+ 7.43,8.11 7.45,7.71 8.29,7.25 Z" />
+ <path class="hi-entity-microwave-oven-controls"
+ fill="#d0d0d0" stroke="black" stroke-width="0"
+ d="M 54.43,7.94
+ C 55.39,7.77 56.22,7.86 56.92,8.62
+ 58.07,9.84 57.68,12.10 56.00,12.62
+ 52.74,13.64 51.26,9.04 54.43,7.94 Z
+ M 54.43,17.36
+ C 55.38,17.21 56.26,17.27 56.94,18.03
+ 58.08,19.29 57.63,21.68 55.86,22.09
+ 55.31,22.21 54.34,22.17 53.86,21.88
+ 52.12,20.83 52.29,18.05 54.43,17.36 Z
+ M 52.09,31.57
+ C 52.63,31.34 53.27,31.43 53.86,31.43
+ 53.86,31.43 57.14,31.43 57.14,31.43
+ 57.43,31.43 57.97,31.40 58.20,31.57
+ 58.47,31.78 58.43,32.27 58.43,32.57
+ 58.43,33.09 58.56,35.14 58.20,35.43
+ 57.97,35.60 57.43,35.57 57.14,35.57
+ 57.14,35.57 53.14,35.57 53.14,35.57
+ 52.81,35.57 52.23,35.63 52.00,35.34
+ 51.77,35.04 51.85,32.92 51.86,32.43
+ 51.87,31.99 51.83,31.93 52.09,31.57 Z" />
+ <path class="hi-entity-microwave-oven-lines"
+ fill="black" stroke="white" stroke-width="1"
+ d="M 6.43,42.57
+ C 4.33,42.57 1.60,42.84 0.83,40.29
+ 0.70,39.86 0.71,39.44 0.71,39.00
+ 0.71,39.00 0.71,10.57 0.71,10.57
+ 0.71,10.57 0.71,3.86 0.71,3.86
+ 0.74,1.62 2.16,0.57 4.29,0.57
+ 4.29,0.57 49.57,0.57 49.57,0.57
+ 49.57,0.57 59.71,0.57 59.71,0.57
+ 62.09,0.58 63.28,1.76 63.29,4.14
+ 63.29,4.14 63.29,33.57 63.29,33.57
+ 63.29,33.57 63.29,37.86 63.29,37.86
+ 63.29,39.85 63.39,41.70 61.00,42.39
+ 60.45,42.54 60.00,42.57 59.43,42.57
+ 59.43,42.57 57.57,42.57 57.57,42.57
+ 57.57,43.43 57.68,44.43 56.95,45.05
+ 56.31,45.60 54.70,45.43 53.86,45.43
+ 53.09,45.43 50.41,45.51 49.86,45.30
+ 49.39,45.12 49.05,44.75 48.86,44.29
+ 48.67,43.81 48.71,43.09 48.71,42.57
+ 48.71,42.57 15.29,42.57 15.29,42.57
+ 15.29,43.09 15.33,43.81 15.14,44.29
+ 14.95,44.75 14.61,45.12 14.14,45.30
+ 13.59,45.51 10.91,45.43 10.14,45.43
+ 9.30,45.43 7.69,45.60 7.05,45.05
+ 6.32,44.43 6.43,43.43 6.43,42.57 Z
+ M 3.57,2.16
+ C 3.05,2.34 2.74,2.50 2.47,3.00
+ 2.15,3.60 2.29,6.31 2.29,7.14
+ 2.29,7.14 2.29,22.71 2.29,22.71
+ 2.29,22.71 2.29,36.43 2.29,36.43
+ 2.29,37.09 2.22,39.37 2.39,39.86
+ 2.54,40.31 2.85,40.63 3.29,40.81
+ 3.78,41.01 4.34,41.00 4.86,41.00
+ 4.86,41.00 37.29,41.00 37.29,41.00
+ 37.29,41.00 56.00,41.00 56.00,41.00
+ 56.90,41.00 59.91,41.10 60.57,40.85
+ 60.99,40.70 61.34,40.40 61.55,40.00
+ 61.74,39.61 61.71,39.14 61.71,38.71
+ 61.71,38.71 61.71,10.57 61.71,10.57
+ 61.71,10.57 61.71,5.43 61.71,5.43
+ 61.71,4.83 61.80,3.49 61.55,3.00
+ 61.11,2.15 60.40,2.14 59.57,2.16
+ 59.57,2.16 22.29,2.16 22.29,2.16
+ 22.29,2.16 10.00,2.16 10.00,2.16
+ 10.00,2.16 3.57,2.16 3.57,2.16 Z
+ M 8.29,5.87
+ C 8.29,5.87 12.00,5.87 12.00,5.87
+ 12.00,5.87 18.71,5.87 18.71,5.87
+ 18.71,5.87 39.43,5.87 39.43,5.87
+ 39.43,5.87 44.43,5.87 44.43,5.87
+ 45.31,5.86 46.35,5.76 47.14,6.18
+ 48.34,6.82 48.57,7.91 48.57,9.14
+ 48.57,9.14 48.57,30.71 48.57,30.71
+ 48.57,30.71 48.57,33.14 48.57,33.14
+ 48.57,34.79 48.67,36.57 46.71,37.17
+ 46.30,37.30 45.86,37.29 45.43,37.29
+ 45.43,37.29 15.29,37.29 15.29,37.29
+ 15.29,37.29 10.14,37.29 10.14,37.29
+ 9.24,37.29 8.24,37.39 7.43,36.94
+ 6.32,36.32 6.14,35.29 6.14,34.14
+ 6.14,34.14 6.14,12.86 6.14,12.86
+ 6.14,12.86 6.14,10.00 6.14,10.00
+ 6.14,8.11 5.99,6.49 8.29,5.87 Z
+ M 54.43,6.64
+ C 55.78,6.45 57.04,6.80 57.95,7.86
+ 59.48,9.63 58.99,12.59 56.86,13.64
+ 56.20,13.96 55.58,14.02 54.86,14.00
+ 52.11,13.93 50.63,10.93 51.81,8.57
+ 52.38,7.43 53.22,6.92 54.43,6.64 Z
+ M 8.57,7.44
+ C 8.29,7.61 8.16,7.62 7.96,7.89
+ 7.58,8.39 7.71,10.17 7.71,10.86
+ 7.71,10.86 7.71,21.00 7.71,21.00
+ 7.71,21.00 7.71,32.14 7.71,32.14
+ 7.71,33.03 7.41,35.09 8.29,35.57
+ 8.61,35.74 9.07,35.71 9.43,35.71
+ 9.43,35.71 27.71,35.71 27.71,35.71
+ 27.71,35.71 42.43,35.71 42.43,35.71
+ 42.43,35.71 45.43,35.71 45.43,35.71
+ 45.94,35.71 46.41,35.70 46.75,35.25
+ 47.04,34.87 47.00,34.31 47.00,33.86
+ 47.00,33.86 47.00,13.57 47.00,13.57
+ 47.00,13.57 47.00,9.14 47.00,9.14
+ 46.99,8.67 46.99,8.14 46.64,7.78
+ 46.26,7.37 45.65,7.43 45.14,7.44
+ 45.14,7.44 20.71,7.44 20.71,7.44
+ 20.71,7.44 12.86,7.44 12.86,7.44
+ 12.86,7.44 8.57,7.44 8.57,7.44 Z
+ M 54.71,8.19
+ C 51.81,8.97 52.84,13.03 55.71,12.37
+ 57.21,12.03 57.69,10.21 56.84,9.03
+ 56.31,8.29 55.57,8.10 54.71,8.19 Z
+ M 54.43,16.07
+ C 55.95,15.86 57.42,16.38 58.27,17.71
+ 59.65,19.88 58.46,22.94 55.86,23.38
+ 54.65,23.59 53.33,23.28 52.45,22.40
+ 50.95,20.90 51.09,18.19 52.74,16.85
+ 53.27,16.41 53.77,16.22 54.43,16.07 Z
+ M 54.71,17.62
+ C 51.79,18.41 52.87,22.45 55.71,21.80
+ 57.06,21.49 57.66,19.88 56.99,18.71
+ 56.47,17.81 55.70,17.51 54.71,17.62 Z
+ M 51.57,30.24
+ C 51.57,30.24 57.71,30.14 57.71,30.14
+ 59.29,30.16 59.70,30.78 59.71,32.29
+ 59.71,32.29 59.71,34.57 59.71,34.57
+ 59.71,35.20 59.70,35.90 59.23,36.39
+ 58.74,36.89 57.93,36.86 57.29,36.86
+ 57.29,36.86 52.71,36.86 52.71,36.86
+ 52.18,36.85 51.64,36.86 51.17,36.54
+ 50.53,36.09 50.57,35.41 50.57,34.71
+ 50.57,33.90 50.44,31.48 50.78,30.87
+ 50.99,30.49 51.20,30.40 51.57,30.24 Z
+ M 58.14,31.71
+ C 58.14,31.71 52.14,31.71 52.14,31.71
+ 52.14,31.71 52.14,35.29 52.14,35.29
+ 52.14,35.29 56.86,35.29 56.86,35.29
+ 56.86,35.29 58.00,35.06 58.00,35.06
+ 58.00,35.06 58.14,34.00 58.14,34.00
+ 58.14,34.00 58.14,31.71 58.14,31.71 Z
+ M 13.71,42.57
+ C 13.71,42.57 8.00,42.57 8.00,42.57
+ 8.00,42.57 8.00,43.86 8.00,43.86
+ 8.00,43.86 13.71,43.86 13.71,43.86
+ 13.71,43.86 13.71,42.57 13.71,42.57 Z
+ M 56.00,42.57
+ C 56.00,42.57 50.29,42.57 50.29,42.57
+ 50.29,42.57 50.29,43.86 50.29,43.86
+ 50.29,43.86 56.00,43.86 56.00,43.86
+ 56.00,43.86 56.00,42.57 56.00,42.57 Z" />
+ <path class="hi-entity-microwave-oven-waves"
+ fill="#d01010" stroke="black" stroke-width="1"
+ d="M 33.14,13.92
+ C 35.61,13.61 37.82,13.95 40.00,15.16
+ 40.56,15.47 42.16,16.19 41.57,17.10
+ 41.23,17.58 40.56,17.36 40.14,17.10
+ 38.50,16.22 37.41,15.45 35.43,15.43
+ 33.06,15.40 31.46,15.78 29.29,16.76
+ 27.72,17.46 26.21,18.44 24.57,18.95
+ 23.06,19.42 21.84,19.45 20.29,19.43
+ 18.19,19.40 15.55,18.40 13.86,17.18
+ 13.31,16.79 12.07,15.96 12.37,15.16
+ 12.44,14.99 12.56,14.87 12.74,14.80
+ 13.46,14.52 14.54,15.69 15.14,16.08
+ 16.68,17.07 18.73,17.84 20.57,17.86
+ 26.01,17.92 27.18,14.89 33.14,13.92 Z
+ M 33.29,18.63
+ C 35.92,18.31 37.67,18.69 40.00,19.89
+ 40.56,20.18 42.34,21.06 41.49,21.91
+ 41.00,22.40 40.17,21.87 39.71,21.61
+ 38.17,20.74 37.12,20.16 35.29,20.14
+ 32.71,20.11 31.04,20.69 28.71,21.76
+ 26.92,22.58 26.40,23.13 24.29,23.72
+ 22.21,24.37 19.65,24.26 17.57,23.72
+ 15.93,23.24 14.62,22.53 13.29,21.48
+ 12.85,21.13 12.12,20.53 12.37,19.88
+ 12.58,19.35 13.16,19.42 13.57,19.63
+ 14.18,19.95 15.12,21.03 17.00,21.79
+ 19.19,22.68 21.72,22.87 24.00,22.18
+ 25.34,21.78 26.47,21.00 27.71,20.41
+ 29.59,19.53 31.24,18.97 33.29,18.63 Z
+ M 33.29,23.35
+ C 35.71,23.05 37.85,23.45 40.00,24.62
+ 40.55,24.91 42.34,25.77 41.49,26.63
+ 41.00,27.11 40.17,26.60 39.71,26.35
+ 38.09,25.44 37.06,24.88 35.14,24.86
+ 32.84,24.83 30.64,25.56 28.57,26.54
+ 27.23,27.17 26.47,27.77 25.00,28.27
+ 22.72,29.06 19.72,29.10 17.43,28.38
+ 15.93,27.91 14.51,27.23 13.29,26.22
+ 12.85,25.86 12.13,25.24 12.37,24.59
+ 12.58,24.06 13.16,24.13 13.57,24.36
+ 14.22,24.72 14.81,25.54 16.86,26.45
+ 19.08,27.43 21.83,27.59 24.14,26.85
+ 24.14,26.85 28.57,24.76 28.57,24.76
+ 30.07,24.07 31.67,23.61 33.29,23.35 Z" />
diff --git a/src/hi/apps/event/models.py b/src/hi/apps/event/models.py
index a09c34ff..5a69a4ed 100644
--- a/src/hi/apps/event/models.py
+++ b/src/hi/apps/event/models.py
@@ -76,7 +76,7 @@ class EventClause( models.Model ):
entity_state = models.ForeignKey(
EntityState,
related_name = '+',
- verbose_name = 'Entity State',
+ verbose_name = 'Item State',
on_delete = models.CASCADE,
)
value = models.CharField(
diff --git a/src/hi/apps/event/templates/event/edit/modals/event_definition_add.html b/src/hi/apps/event/templates/event/edit/modals/event_definition_add.html
index 213053ce..756e9657 100644
--- a/src/hi/apps/event/templates/event/edit/modals/event_definition_add.html
+++ b/src/hi/apps/event/templates/event/edit/modals/event_definition_add.html
@@ -8,7 +8,7 @@
{% endblock %}
{% block title_text %}
-New Event Definition
+New Event Rule
{% endblock %}
{% block body %}
diff --git a/src/hi/apps/event/templates/event/edit/modals/event_definition_delete.html b/src/hi/apps/event/templates/event/edit/modals/event_definition_delete.html
index 20ac380f..a0eacaeb 100644
--- a/src/hi/apps/event/templates/event/edit/modals/event_definition_delete.html
+++ b/src/hi/apps/event/templates/event/edit/modals/event_definition_delete.html
@@ -8,30 +8,42 @@
{% endblock %}
{% block title_text %}
-Delete Event Definition?
+Delete Event Rule?
{% endblock %}
{% block body %}
-<div>
-Please confirm that you want to delete this event definition.
-</div>
-<div>
+<p>
+Please confirm that you want to delete this event rule.
+</p>
+<p class="lead">
<ul>
- {{ event_definition.name }}
- {% for event_clause in event_definition.event_clauses.all %}
- <div>Clause: {{ event_clause.entity_state.name }} = {{ event_clause.value }} ({{ event_clause.entity_state.entity_state_type.label }})</div>
- {% endfor %}
- {% for alarm_action in event_definition.alarm_actions.all %}
- <div>Alarm: {{ alarm_action.security_level.label }} = {{ alarm_action.alarm_level.label }}</div>
- {% endfor %}
- {% for control_action in event_definition.control_actions.all %}
- <div>Control: {{ control_action.controller.name }} = {{ control_action.value }}</div>
- {% endfor %}
+ <li>Name: {{ event_definition.name }}</li>
+ <li>Clauses
+ <ul>
+ {% for event_clause in event_definition.event_clauses.all %}
+ <li>{{ event_clause.entity_state.name }} = {{ event_clause.value }} ({{ event_clause.entity_state.entity_state_type.label }})</li>
+ {% endfor %}
+ </ul>
+ </li>
+ <li>Alarm Actions
+ <ul>
+ {% for alarm_action in event_definition.alarm_actions.all %}
+ <li>Alarm: {{ alarm_action.security_level.label }} = {{ alarm_action.alarm_level.label }}</li>
+ {% endfor %}
+ </ul>
+ </li>
+ <li>Control Actions
+ <ul>
+ {% for control_action in event_definition.control_actions.all %}
+ <li>Control: {{ control_action.controller.name }} = {{ control_action.value }}</li>
+ {% endfor %}
+ </ul>
+ </li>
</ul>
-</div>
-<div class="text-danger">
+</p>
+<p class="text-danger">
This deletion cannot be undone.
-</div>
+</p>
{% endblock %}
{% block action_right %}
diff --git a/src/hi/apps/event/templates/event/edit/modals/event_definition_edit.html b/src/hi/apps/event/templates/event/edit/modals/event_definition_edit.html
index 447f0d74..86e1bb1a 100644
--- a/src/hi/apps/event/templates/event/edit/modals/event_definition_edit.html
+++ b/src/hi/apps/event/templates/event/edit/modals/event_definition_edit.html
@@ -8,7 +8,7 @@
{% endblock %}
{% block title_text %}
-Edit Event Definition
+Edit Event Rule
{% endblock %}
{% block body %}
diff --git a/src/hi/apps/event/templates/event/edit/panes/alarm_action_form.html b/src/hi/apps/event/templates/event/edit/panes/alarm_action_form.html
index 0fef4c2e..97f22f13 100644
--- a/src/hi/apps/event/templates/event/edit/panes/alarm_action_form.html
+++ b/src/hi/apps/event/templates/event/edit/panes/alarm_action_form.html
@@ -1,32 +1,68 @@
-{% for hidden in alarm_action_form.hidden_fields %}
-{{ hidden }}
-{% endfor %}
-
-{% if alarm_action_form.non_field_errors %}
-<div class="non-field-errors">
- {% for err in alarm_action_form.non_field_errors %}
- <p class="form-error text-danger">ERROR: {{ err }}</p>
- {% endfor %}
+{% if not alarm_action_form.instance.pk %}
+<div class="my-3">
+ <a class="" data-toggle="collapse" href="#hi-alarm-action-new"
+ role="button" aria-expanded="false" aria-controls="hi-alarm-action-new">
+ <span class="plus-icon">&#43;</span> Add Alarm Action
+ </a>
</div>
+<div class="collapse my-2" id="hi-alarm-action-new">
+{% else %}
+<div class="my-3">
{% endif %}
-<div>
- {{ alarm_action_form.security_level_str.label }}
- {{ alarm_action_form.security_level_str }}
- {{ alarm_action_form.security_level_str.errors }}
-</div>
-<div>
- {{ alarm_action_form.alarm_level_str.label }}
- {{ alarm_action_form.alarm_level_str }}
- {{ alarm_action_form.alarm_level_str.errors }}
-</div>
-<div>
- {{ alarm_action_form.alarm_lifetime_secs.label }}
- {{ alarm_action_form.alarm_lifetime_secs }}
- {{ alarm_action_form.alarm_lifetime_secs.errors }}
-</div>
-{% if alarm_action_form.instance.pk %}
-<div>
- {{ alarm_action_form.DELETE }} Delete
+ <div class="d-flex justify-content-between" >
+ <div class="h6"><em>Alarm Action {{ forloop.counter }}</em></div>
+ {% if alarm_action_form.instance.pk %}
+ <div class="">
+ {{ alarm_action_form.DELETE }}<span class="pl-2">Delete</span>
+ </div>
+ {% endif %}
+ </div>
+
+ <div class="pl-2">
+ {% for hidden in alarm_action_form.hidden_fields %}
+ {{ hidden }}
+ {% endfor %}
+
+ {% if alarm_action_form.non_field_errors %}
+ <div class="non-field-errors">
+ {% for err in alarm_action_form.non_field_errors %}
+ <p class="form-error text-danger">ERROR: {{ err }}</p>
+ {% endfor %}
+ </div>
+ {% endif %}
+
+ <div class="input-group mb-2 mr-sm-2">
+ <div class="input-group-prepend" >
+ <label for="{{ alarm_action_form.security.id_for_label }}"
+ class="input-group-text" >{{ alarm_action_form.security_level_str.label }}</label>
+ {{ alarm_action_form.security_level_str }}
+ <small class="form-error text-danger" >{{ alarm_action_form.security_level_str.errors }}</small>
+ </div>
+ </div>
+
+ <div class="input-group mb-2 mr-sm-2">
+ <div class="input-group-prepend" >
+ <label for="{{ alarm_action_form.alarm.id_for_label }}"
+ class="input-group-text" >{{ alarm_action_form.alarm_level_str.label }}</label>
+ {{ alarm_action_form.alarm_level_str }}
+ <small class="form-error text-danger" >{{ alarm_action_form.alarm_level_str.errors }}</small>
+ </div>
+ </div>
+
+ <div class="input-group mb-2 mr-sm-2">
+ <div class="input-group-prepend" >
+ <label for="{{ alarm_action_form.alarm.id_for_label }}"
+ class="input-group-text" >{{ alarm_action_form.alarm_lifetime_secs.label }}</label>
+ {{ alarm_action_form.alarm_lifetime_secs }}
+ <small class="form-error text-danger" >{{ alarm_action_form.alarm_lifetime_secs.errors }}</small>
+ </div>
+ </div>
+
+ {% if alarm_action_form.instance.pk %}
+ <div>
+ {{ alarm_action_form.DELETE }} Delete
+ </div>
+ {% endif %}
+ </div>
</div>
-{% endif %}
diff --git a/src/hi/apps/event/templates/event/edit/panes/control_action_form.html b/src/hi/apps/event/templates/event/edit/panes/control_action_form.html
index a74388cf..9604e512 100644
--- a/src/hi/apps/event/templates/event/edit/panes/control_action_form.html
+++ b/src/hi/apps/event/templates/event/edit/panes/control_action_form.html
@@ -1,27 +1,59 @@
-{% for hidden in control_action_form.hidden_fields %}
-{{ hidden }}
-{% endfor %}
-
-{% if control_action_form.non_field_errors %}
-<div class="non-field-errors">
- {% for err in control_action_form.non_field_errors %}
- <p class="form-error text-danger">ERROR: {{ err }}</p>
- {% endfor %}
+{% if not control_action_form.instance.pk %}
+<div class="my-3">
+ <a class="" data-toggle="collapse" href="#hi-control-action-new"
+ role="button" aria-expanded="false" aria-controls="hi-control-action-new">
+ <span class="plus-icon">&#43;</span> Add Control Action
+ </a>
</div>
+<div class="collapse my-2" id="hi-control-action-new">
+{% else %}
+<div class="my-3">
{% endif %}
-<div>
- {{ control_action_form.controller.label }}
- {{ control_action_form.controller }}
- {{ control_action_form.controller.errors }}
-</div>
-<div>
- {{ control_action_form.value.label }}
- {{ control_action_form.value }}
- {{ control_action_form.value.errors }}
-</div>
-{% if control_action_form.instance.pk %}
-<div>
- {{ control_action_form.DELETE }} Delete
+ <div class="d-flex justify-content-between" >
+ <div class="h6"><em>Control Action {{ forloop.counter }}</em></div>
+ {% if control_action_form.instance.pk %}
+ <div class="">
+ {{ control_action_form.DELETE }}<span class="pl-2">Delete</span>
+ </div>
+ {% endif %}
+ </div>
+
+ <div class="pl-2">
+ {% for hidden in control_action_form.hidden_fields %}
+ {{ hidden }}
+ {% endfor %}
+
+ {% if control_action_form.non_field_errors %}
+ <div class="non-field-errors">
+ {% for err in control_action_form.non_field_errors %}
+ <p class="form-error text-danger">ERROR: {{ err }}</p>
+ {% endfor %}
+ </div>
+ {% endif %}
+
+ <div class="input-group mb-2 mr-sm-2">
+ <div class="input-group-prepend" >
+ <label for="{{ control_action_form.controller.id_for_label }}"
+ class="input-group-text" >{{ control_action_form.controller.label }}</label>
+ {{ control_action_form.controller }}
+ <small class="form-error text-danger" >{{ control_action_form.controller.errors }}</small>
+ </div>
+ </div>
+
+ <div class="input-group mb-2 mr-sm-2">
+ <div class="input-group-prepend" >
+ <label for="{{ control_action_form.value.id_for_label }}"
+ class="input-group-text" >{{ control_action_form.value.label }}</label>
+ {{ control_action_form.value }}
+ <small class="form-error text-danger" >{{ control_action_form.value.errors }}</small>
+ </div>
+ </div>
+
+ {% if control_action_form.instance.pk %}
+ <div>
+ {{ control_action_form.DELETE }} Delete
+ </div>
+ {% endif %}
+ </div>
</div>
-{% endif %}
diff --git a/src/hi/apps/event/templates/event/edit/panes/event_clause_form.html b/src/hi/apps/event/templates/event/edit/panes/event_clause_form.html
index f489215b..9e75eca2 100644
--- a/src/hi/apps/event/templates/event/edit/panes/event_clause_form.html
+++ b/src/hi/apps/event/templates/event/edit/panes/event_clause_form.html
@@ -1,27 +1,53 @@
-{% for hidden in event_clause_form.hidden_fields %}
-{{ hidden }}
-{% endfor %}
-
-{% if event_clause_form.non_field_errors %}
-<div class="non-field-errors">
- {% for err in event_clause_form.non_field_errors %}
- <p class="form-error text-danger">ERROR: {{ err }}</p>
- {% endfor %}
+{% if not event_clause_form.instance.pk %}
+<div class="my-3">
+ <a class="" data-toggle="collapse" href="#hi-event-clause-new"
+ role="button" aria-expanded="false" aria-controls="hi-event-clause-new">
+ <span class="plus-icon">&#43;</span> Add New Clause
+ </a>
</div>
+<div class="collapse my-2" id="hi-event-clause-new">
+{% else %}
+<div class="my-3">
{% endif %}
-<div>
- {{ event_clause_form.entity_state.label }}
- {{ event_clause_form.entity_state }}
- {{ event_clause_form.entity_state.errors }}
-</div>
-<div>
- {{ event_clause_form.value.label }}
- {{ event_clause_form.value }}
- {{ event_clause_form.value.errors }}
-</div>
-{% if event_clause_form.instance.pk %}
-<div>
- {{ event_clause_form.DELETE }} Delete
+ <div class="d-flex justify-content-between" >
+ <div class="h6"><em>Clause {{ forloop.counter }}</em></div>
+ {% if event_clause_form.instance.pk %}
+ <div class="">
+ {{ event_clause_form.DELETE }}<span class="pl-2">Delete</span>
+ </div>
+ {% endif %}
+ </div>
+
+ <div class="pl-2">
+ {% for hidden in event_clause_form.hidden_fields %}
+ {{ hidden }}
+ {% endfor %}
+
+ {% if event_clause_form.non_field_errors %}
+ <div class="non-field-errors">
+ {% for err in event_clause_form.non_field_errors %}
+ <p class="form-error text-danger">ERROR: {{ err }}</p>
+ {% endfor %}
+ </div>
+ {% endif %}
+
+ <div class="input-group mb-2 mr-sm-2">
+ <div class="input-group-prepend" >
+ <label for="{{ event_clause_form.entity.id_for_label }}"
+ class="input-group-text" >{{ event_clause_form.entity_state.label }}</label>
+ {{ event_clause_form.entity_state }}
+ <small class="form-error text-danger" >{{ event_clause_form.entity_state.errors }}</small>
+ </div>
+ </div>
+
+ <div class="input-group mb-2 mr-sm-2">
+ <div class="input-group-prepend" >
+ <label for="{{ event_clause_form.value.id_for_label }}"
+ class="input-group-text" >{{ event_clause_form.value.label }}</label>
+ {{ event_clause_form.value }}
+ <small class="form-error text-danger" >{{ event_clause_form.value.errors }}</small>
+ </div>
+ </div>
+ </div>
</div>
-{% endif %}
diff --git a/src/hi/apps/event/templates/event/edit/panes/event_definition_form.html b/src/hi/apps/event/templates/event/edit/panes/event_definition_form.html
index b0b72d91..b9447193 100644
--- a/src/hi/apps/event/templates/event/edit/panes/event_definition_form.html
+++ b/src/hi/apps/event/templates/event/edit/panes/event_definition_form.html
@@ -10,36 +10,47 @@
</div>
{% endif %}
-<div>
- {{ event_definition_form.name.label }}
+<div class="input-group mb-2 mr-sm-2">
+ <div class="input-group-prepend" >
+ <label for="{{ event_definition_form.name.id_for_label }}"
+ class="input-group-text" >{{ event_definition_form.name.label }}</label>
{{ event_definition_form.name }}
- {{ event_definition_form.name.errors }}
+ <small class="form-error text-danger" >{{ event_definition_form.name.errors }}</small>
+ </div>
</div>
-<div>
- {{ event_definition_form.event_type_str.label }}
+<div class="input-group mb-2 mr-sm-2">
+ <div class="input-group-prepend" >
+ <label for="{{ event_definition_form.event.id_for_label }}"
+ class="input-group-text" >{{ event_definition_form.event_type_str.label }}</label>
{{ event_definition_form.event_type_str }}
- {{ event_definition_form.event_type_str.errors }}
+ <small class="form-error text-danger" >{{ event_definition_form.event_type_str.errors }}</small>
+ </div>
</div>
-<div>
- {{ event_definition_form.event_window_secs.label }}
+<div class="input-group mb-2 mr-sm-2">
+ <div class="input-group-prepend" >
+ <label for="{{ event_definition_form.event.id_for_label }}"
+ class="input-group-text" >{{ event_definition_form.event_window_secs.label }}</label>
{{ event_definition_form.event_window_secs }}
- {{ event_definition_form.event_window_secs.errors }}
+ <small class="form-error text-danger" >{{ event_definition_form.event_window_secs.errors }}</small>
+ </div>
</div>
-<div>
- {{ event_definition_form.dedupe_window_secs.label }}
+<div class="input-group mb-2 mr-sm-2">
+ <div class="input-group-prepend" >
+ <label for="{{ event_definition_form.dedupe.id_for_label }}"
+ class="input-group-text" >{{ event_definition_form.dedupe_window_secs.label }}</label>
{{ event_definition_form.dedupe_window_secs }}
- {{ event_definition_form.dedupe_window_secs.errors }}
+ <small class="form-error text-danger" >{{ event_definition_form.dedupe_window_secs.errors }}</small>
+ </div>
</div>
-<div>
- {{ event_definition_form.enabled.label }}
- {{ event_definition_form.enabled }}
- {{ event_definition_form.enabled.errors }}
+<div class="mb-2 mr-sm-2">
+ {{ event_definition_form.enabled }}<span class="pl-2">Enabled</span>
</div>
+<hr />
<div>
<div class="h5">Clauses</div>
{{ event_clause_formset.management_form }}
@@ -47,6 +58,8 @@
{% include "event/edit/panes/event_clause_form.html" %}
{% endfor %}
</div>
+
+<hr />
<div>
<div class="h5">Alarm Actions</div>
{{ alarm_action_formset.management_form }}
@@ -54,6 +67,8 @@
{% include "event/edit/panes/alarm_action_form.html" %}
{% endfor %}
</div>
+
+<hr />
<div>
<div class="h5">Control Actions</div>
{{ control_action_formset.management_form }}
diff --git a/src/hi/hi_styles.py b/src/hi/hi_styles.py
index b34d2bd3..ac0e9f10 100644
--- a/src/hi/hi_styles.py
+++ b/src/hi/hi_styles.py
@@ -256,6 +256,7 @@ class EntityStyle:
EntityType.HYGROMETER,
EntityType.LIGHT,
EntityType.LIGHT_SENSOR,
+ EntityType.MICROWAVE_OVEN,
EntityType.MODEM,
EntityType.MOTION_SENSOR,
EntityType.MOTOR,
@@ -299,6 +300,7 @@ class EntityStyle:
EntityType.ELECTRICAL_OUTLET: SvgViewBox( x = 0, y = 0, width = 45, height = 64 ),
EntityType.HUMIDIFIER: SvgViewBox( x = 0, y = 0, width = 44, height = 64 ),
EntityType.HVAC_AIR_HANDLER: SvgViewBox( x = 0, y = 0, width = 64, height = 44 ),
+ EntityType.MICROWAVE_OVEN: SvgViewBox( x = 0, y = 0, width = 64, height = 46 ),
EntityType.MODEM: SvgViewBox( x = 0, y = 0, width = 37, height = 64 ),
EntityType.MOTION_SENSOR: SvgViewBox( x = 0, y = 0, width = 42, height = 64 ),
EntityType.MOTOR: SvgViewBox( x = 0, y = 0, width = 64, height = 46 ),
diff --git a/src/hi/integrations/templates/integrations/pages/integration_manage.html b/src/hi/integrations/templates/integrations/pages/integration_manage.html
index 288f46ac..cd0c9499 100644
--- a/src/hi/integrations/templates/integrations/pages/integration_manage.html
+++ b/src/hi/integrations/templates/integrations/pages/integration_manage.html
@@ -1,18 +1,20 @@
{% extends "config/pages/config_base.html" %}
{% block config_content %}
-<div class="row">
+<div id="hi-integration-settings" class="row">
<nav class="nav flex-column">
{% for integration_data in core.integration_data_list %}
<a class="nav-link {% if core.integration_data.integration_id == integration_data.integration_id %}active{% endif %}"
href="{% url 'integrations_manage' integration_id=integration_data.integration_id %}"
data-async="true">
- {{ integration_data.label }}
+ <div class="bg-primary p-2 text-center">
+ {{ integration_data.label }}
+ </div>
</a>
{% endfor %}
</nav>
<div class="flex-colum flex-grow-1">
- <div class="tab-content">
+ <div class="tab-content m-3">
<div class="d-flex justify-content-between">
<div class="h3">{{ core.integration_data.label }}</div>
<div>
diff --git a/src/hi/services/hass/templates/hass/panes/hass_manage.html b/src/hi/services/hass/templates/hass/panes/hass_manage.html
index 458e94a1..82dbd023 100644
--- a/src/hi/services/hass/templates/hass/panes/hass_manage.html
+++ b/src/hi/services/hass/templates/hass/panes/hass_manage.html
@@ -1,12 +1,13 @@
-<div>
- <div class="col-2">
+<div class="d-flex justify-content-between">
+ <div>
+ {% include "hass/panes/hass_settings.html" %}
+ </div>
+ <div class="my-4 py-4 mr-4 pr-4">
<form action="{% url 'hass_sync' %}"
method="POST" role="form" data-async="true">
{% csrf_token %}
- <button type="submit" class="btn btn-primary" role="button"
- name="action" value="sync" >SYNC</button>
+ <button type="submit" class="btn btn-lg btn-secondary" role="button"
+ name="action" value="sync" >IMPORT ITEMS</button>
</form>
</div>
-
- {% include "hass/panes/hass_settings.html" %}
</div>
diff --git a/src/hi/services/zoneminder/templates/zoneminder/panes/zm_manage.html b/src/hi/services/zoneminder/templates/zoneminder/panes/zm_manage.html
index ef56bbe7..94555dca 100644
--- a/src/hi/services/zoneminder/templates/zoneminder/panes/zm_manage.html
+++ b/src/hi/services/zoneminder/templates/zoneminder/panes/zm_manage.html
@@ -1,12 +1,13 @@
-<div>
- <div class="col-2">
+<div class="d-flex justify-content-between">
+ <div>
+ {% include "zoneminder/panes/zm_settings.html" %}
+ </div>
+ <div class="my-4 py-4 mr-4 pr-4">
<form action="{% url 'zm_sync' %}"
method="POST" role="form" data-async="">
{% csrf_token %}
- <button type="submit" class="btn btn-primary" role="button"
- name="action" value="sync" >SYNC</button>
+ <button type="submit" class="btn btn-lg btn-secondary" role="button"
+ name="action" value="sync" >IMPORT ITEMS</button>
</form>
</div>
-
- {% include "zoneminder/panes/zm_settings.html" %}
</div>
diff --git a/src/hi/services/zoneminder/templates/zoneminder/panes/zm_settings.html b/src/hi/services/zoneminder/templates/zoneminder/panes/zm_settings.html
index 40f68576..354291ce 100644
--- a/src/hi/services/zoneminder/templates/zoneminder/panes/zm_settings.html
+++ b/src/hi/services/zoneminder/templates/zoneminder/panes/zm_settings.html
@@ -11,7 +11,7 @@
<button id="hi-zm-setting-button" type="submit" class="btn btn-primary"
name="action" value="update">
- UPDATE
+ UPDATE SETTINGS
</button>
</form>
</div>
diff --git a/src/hi/static/css/main.css b/src/hi/static/css/main.css
index 059c7a6e..4e510696 100644
--- a/src/hi/static/css/main.css
+++ b/src/hi/static/css/main.css
@@ -23,10 +23,9 @@
--muted-color: #7e7e81;
--on-muted-color: #ffffff;
--line-color: #cccccc;
- --edit-bg-color: #ffd0c3;
- --edit-side-bg-color: #dffeff;
- --edit-top-bg-color: #f0f0f0;
- --edit-bottom-bg-color: #f0f0f0;
+ --edit-primary-bg-color: #dffeff;
+ --edit-secondary-bg-color: #ffd0c3;
+ --edit-tertiary-bg-color: #f0f0f0;
--edit-hr-color: #a0a0a0;
--top-buttons-height: 2.5rem;
@@ -222,16 +221,16 @@ a.underline:visited {
}
#hi-top-content[hi-edit="True"] {
- background: var(--edit-top-bg-color);
+ background: var(--edit-tertiary-bg-color);
}
#hi-bottom-content[hi-edit="True"] {
- background: var(--edit-bottom-bg-color);
+ background: var(--edit-tertiary-bg-color);
}
.hi-screen[hi-edit="True"] {
- background: var(--edit-bg-color);
+ background: var(--edit-secondary-bg-color);
}
.hi-screen[hi-edit="True"] .hi-side {
- background: var(--edit-side-bg-color);
+ background: var(--edit-primary-bg-color);
}
.hi-screen {
@@ -261,7 +260,6 @@ a.underline:visited {
}
.hi-location-view {
- display: flex;
justify-content: center;
align-items: center;
height: calc(100vh - var(--top-buttons-height) - var(--bottom-buttons-height) );
@@ -274,6 +272,16 @@ a.underline:visited {
cursor: pointer;
}
+#hi-integration-settings nav {
+ border-right: 1px solid #888888;
+ height: calc( 100vh - var(--top-buttons-height) - var(--bottom-buttons-height) - 6rem);
+ overflow-y: auto;
+}
+#hi-integration-settings nav hr {
+ flex: 0 0 auto; /* Prevent shrinking or growing */
+ width: 100%;
+ border-top: 1px solid #202020;
+}
.drag-over {
border: 2px dashed #888888;
}