Skip to content

Commit

Permalink
Little tweaks for pointing out devices that have dying batteries
Browse files Browse the repository at this point in the history
  • Loading branch information
imbrianj committed Aug 8, 2018
1 parent 361bfe1 commit 54e9a7b
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 8 deletions.
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
language: node_js
sudo: false
before_install:
- export TZ=America/Los_Angeles
node_js:
- "node"
- "lts/*"
Expand Down
2 changes: 1 addition & 1 deletion cache/version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1533273302129
1533697808776
2 changes: 1 addition & 1 deletion css/combo.min.css

Large diffs are not rendered by default.

8 changes: 6 additions & 2 deletions css/common.css
Original file line number Diff line number Diff line change
Expand Up @@ -1591,11 +1591,13 @@ section .sub-device-list li dl dd {
section .sub-device-list li a span,
section .sub-device-list li span span {
font-family: helvetica;
padding-top: 0.5em;
}

section .sub-device-list li dl dd.fa,
section .sub-device-list li dl dd.icon {
font-size: 100%;
margin-bottom: 0.25em;
}

.device-active .fa:before,
Expand All @@ -1613,7 +1615,8 @@ section .sub-device-list li dl dd.icon {
.device-active.heat .fa:before,
.device-active.smoke .fa:before,
.device-active.co .fa:before,
.device-active.batt .fa:before {
.device-active.batt .fa:before,
.peripheral.batt.fa:before {
text-shadow: -2px -2px 1px #F00,
-2px 2px 1px #F00,
2px -2px 1px #F00,
Expand All @@ -1622,7 +1625,8 @@ section .sub-device-list li dl dd.icon {

.device-active.smoke .smoke,
.device-active.co .co,
.device-active.batt .batt {
.device-active.batt .batt,
.peripheral.batt:not(.fa) {
color: #F00;
}

Expand Down
4 changes: 2 additions & 2 deletions devices/powerView/fragments/blind.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
<li>
<form class="text-form" action="/" method="get">
<fieldset>
<legend>{{SUB_DEVICE_NAME}}{{SUB_DEVICE_STATE}}</legend>
<legend>{{SUB_DEVICE_NAME}}<span class="{{SUB_DEVICE_STATE_CLASS}}">{{SUB_DEVICE_STATE}}</span></legend>
<label for="powerview-{{SUB_DEVICE_ID}}-percentage">{{i18n_SET_PERCENTAGE}}:</label>
<input id="powerview-{{SUB_DEVICE_ID}}-percentage" class="text-input" type="number" max="100" min="0" name="{{DEVICE_ID}}" value="{{SUB_DEVICE_PERCENTAGE}}" required />
<input class="light" type="range" max="100" min="0" name="{{DEVICE_ID}}" value="{{SUB_DEVICE_PERCENTAGE}}" />
<input class="input-type" type="hidden" value="subdevice-{{SUB_DEVICE_NAME}}" name="type" />
<button type="submit" class="button">{{i18n_SUBMIT}}</button>
</fieldset>
</form>
</li>
</li>
1 change: 1 addition & 0 deletions devices/powerView/parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@

blindsMarkup += templateBlind.split('{{SUB_DEVICE_ID}}').join(encodeName(device.label));
blindsMarkup = blindsMarkup.split('{{SUB_DEVICE_PERCENTAGE}}').join(device.percentage);
blindsMarkup = blindsMarkup.split('{{SUB_DEVICE_STATE_CLASS}}').join(device.battery && device.battery < 10 ? 'peripheral batt' : '');
blindsMarkup = blindsMarkup.split('{{SUB_DEVICE_STATE}}').join(device.battery ? ' (' + device.battery + '%)' : '');
blindsMarkup = blindsMarkup.split('{{SUB_DEVICE_NAME}}').join(device.label);
}
Expand Down
5 changes: 5 additions & 0 deletions devices/smartthings/parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,11 @@
deviceMarkup = deviceMarkup.split('{{SUB_DEVICE_STATUS}}').join(translate('ACTIVE'));
}

else if (device.peripheral && device.peripheral.battery && device.peripheral.battery < 10) {
deviceMarkup = deviceMarkup.split('{{SUB_DEVICE_STATE}}').join(' peripheral batt' + vibrate);
deviceMarkup = deviceMarkup.split('{{SUB_DEVICE_STATUS}}').join(translate('INACTIVE'));
}

else {
deviceMarkup = deviceMarkup.split('{{SUB_DEVICE_STATE}}').join(vibrate);
deviceMarkup = deviceMarkup.split('{{SUB_DEVICE_STATUS}}').join(translate('INACTIVE'));
Expand Down
4 changes: 2 additions & 2 deletions js/combo.min.js

Large diffs are not rendered by default.

0 comments on commit 54e9a7b

Please sign in to comment.