Skip to content

Commit

Permalink
New component HM-WDS30-OT2-SM-2
Browse files Browse the repository at this point in the history
  • Loading branch information
braindead1 committed Dec 18, 2016
1 parent 8d060d1 commit bd06ece
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Expand Up @@ -111,6 +111,7 @@ HomeHub benötigt eine installierte XML-API auf der CCU.
* HM-WDS10-TH-O
* HM-WDS100-C6-O
* HM-WDS30-OT2-SM
* HM-WDS30-OT2-SM-2 (validieren)
* HM-WDS30-T-O (validieren)
* HM-WDS40-TH-I-2
* HM-WDS40-TH-I
Expand Down
23 changes: 23 additions & 0 deletions app/Components/HM-WDS30-OT2-SM-2.php
@@ -0,0 +1,23 @@
<?php

// HM-WDS30-OT2-SM-2|SonneHinten:0||VISIBLE=|OPERATE=|UNREACH=22747|STICKY_UNREACH=22743|CONFIG_PENDING=22733|LOWBAT=22737|RSSI_DEVICE=22741|RSSI_PEER=22742|
// HM-WDS30-OT2-SM-2|SonneHinten1||VISIBLE=true|OPERATE=true|TEMPERATURE=22753|LOWBAT=22752|
// HM-WDS30-OT2-SM-2|SonneHinten2||VISIBLE=true|OPERATE=true|TEMPERATURE=22756|LOWBAT=22755|
// HM-WDS30-OT2-SM-2|SonneHinten3||VISIBLE=true|OPERATE=true|TEMPERATURE=22759|LOWBAT=22758|
// HM-WDS30-OT2-SM-2|SonneHinten4||VISIBLE=true|OPERATE=true|TEMPERATURE=22762|LOWBAT=22761|
// HM-WDS30-OT2-SM-2|SonneHinten5||VISIBLE=true|OPERATE=true|TEMPERATURE=22765|LOWBAT=22764|

// Validated by Manu

function HM_WDS30_OT2_SM_2($component) {
if ($component['parent_device_interface'] == 'BidCos-RF' && $component['visible'] == 'true' && isset($component['TEMPERATURE'])) {
return '<div class="hh">'
. '<div class="pull-left"><img src="../assets/icons/' . $component["icon"] . '" class="icon">' . $component['name'] . '</div>'
. '<div class="pull-right">'
. '<span class="info" data-id="' . $component['LOWBAT'] . '" data-component="' . $component['component'] . '" data-datapoint="LOWBAT"></span>'
. '<span class="info" data-id="' . $component['TEMPERATURE'] . '" data-component="' . $component['component'] . '" data-datapoint="TEMPERATURE"></span>'
. '</div>'
. '<div class="clearfix"></div>'
. '</div>';
}
}
4 changes: 4 additions & 0 deletions app/Config/mapping.json
Expand Up @@ -437,6 +437,10 @@
"name": "HM-WDS30-OT2-SM",
"icon": "temp_temperature.png"
},
{
"name": "HM-WDS30-OT2-SM-2",
"icon": "temp_temperature.png"
},
{
"name": "HM-WDS30-T-O",
"icon": "temp_temperature.png"
Expand Down
14 changes: 14 additions & 0 deletions assets/js/script.js
Expand Up @@ -2061,6 +2061,20 @@ var updateDatapoints = function () {
$('[data-id="' + ise_id + '"]').html(value);
}
break;
case 'HM-WDS30-OT2-SM-2':
switch (datapoint) {
case 'LOWBAT':
if (value === 'true') {
$('[data-id="' + ise_id + '"]').html('<img src="../assets/icons/measure_battery_25.png" />');
}
break;
case 'TEMPERATURE':
$('[data-id="' + ise_id + '"]').html((Math.round(value * 10) / 10) + ' &deg;C');
break;
default:
$('[data-id="' + ise_id + '"]').html(value);
}
break;
case 'HM-WDS30-T-O':
switch (datapoint) {
case 'LOWBAT':
Expand Down

0 comments on commit bd06ece

Please sign in to comment.