Skip to content

Commit

Permalink
"showtime" in HMIP_SWDO ergänzt
Browse files Browse the repository at this point in the history
"showtime" in HMIP_SWDO ergänzt
  • Loading branch information
christian1180 committed Feb 9, 2025
1 parent 8e10554 commit 144377e
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions components/HMIP-SWDO.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,26 @@

function HMIP_SWDO($component) {




if ($component['parent_device_interface'] == 'HmIP-RF' && $component['visible'] == 'true' && isset($component['STATE'])) {

global $export;
$obj = $export;
$key = array_search(substr($component['address'], 0, -1)."0", array_column($obj['channels'], 'address'));
foreach($obj['channels'][$key]['datapoints'] as $datapoint)
{ $status_component[$datapoint['type']] = $datapoint['ise_id']; }


if ($component['parent_device_interface'] == 'HmIP-RF' && $component['visible'] == 'true' && isset($component['STATE'])) {

// ShowTime - Uhrzeit der letzten Änderung anzeigen
if(isset($component['showtime']))
{
if($component['showtime'] == "true") { $ShowTime = '<span class="info" data-id="' . $component['ise_id'] . 't" data-component="showtime" data-datapoint="showtime"></span>' ; }
else { $ShowTime = ''; }
}
else { $ShowTime = ''; }


if (!isset($component['color'])) $component['color'] = '#595959';
if(!isset($component['state_icons'])) {
$component['state_icons'] = '';
Expand All @@ -23,6 +35,7 @@ function HMIP_SWDO($component) {
return '<div class="hh" style=\'border-left-color: '.$component['color'].'; border-left-style: solid;\'>'
. '<div class="pull-left"><img src="icon/' . $component["icon"] . '" class="icon">' . $component['name'] . '</div>'
. '<div class="pull-right">'
. $ShowTime
. '<span class="info" data-id="' . $status_component['LOW_BAT'] . '" data-component="' . $component['component'] . '" data-datapoint="LOW_BAT"></span>'
. '<span class="info" data-id="' . $component['STATE'] . '" data-component="' . $component['component'] . '" data-state-icons="' . $component['state_icons'] . '" data-datapoint="STATE"></span>'
. '</div>'
Expand Down

0 comments on commit 144377e

Please sign in to comment.