Skip to content

Commit

Permalink
UPDATE: Support up to 8 DS18B20
Browse files Browse the repository at this point in the history
  • Loading branch information
reloxx13 committed Dec 18, 2019
1 parent b642038 commit 7a627a8
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 6 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Expand Up @@ -3,7 +3,7 @@

## Upcoming
- UPDATE: Updated polish translation, thx @[WiktorBuczko](https://github.com/WiktorBuczko) and @[pepeEL](https://github.com/pepeEL)

- UPDATE: Support up to 8 DS18B20 [#333](https://github.com/reloxx13/TasmoAdmin/issues/333)

## Published

Expand Down
38 changes: 34 additions & 4 deletions tasmoadmin/resources/js/app.js
Expand Up @@ -148,7 +148,7 @@ $( document ).on( "ready", function () {

function notifyMe( msg, title ) {
var title = title || "";
if ( title != "" ) {
if ( title !== "" ) {
title = " - " + title;
}

Expand Down Expand Up @@ -188,15 +188,15 @@ function notifyMe( msg, title ) {
$.fn.attachDragger = function () {
var attachment = false, lastPosition, position, difference;
$( $( this ).selector ).on( "mousedown mouseup mousemove", function ( e ) {
if ( e.type == "mousedown" && !$( e.target ).hasClass( "tablesaw-cell-content" ) ) {
if ( e.type === "mousedown" && !$( e.target ).hasClass( "tablesaw-cell-content" ) ) {
attachment = true, lastPosition = [ e.clientX, e.clientY ];
$( ".tablesaw-cell-content" ).addClass( "dontselect" );
}
if ( e.type == "mouseup" ) {
if ( e.type === "mouseup" ) {
attachment = false;
$( ".tablesaw-cell-content" ).removeClass( "dontselect" );
}
if ( e.type == "mousemove" && attachment == true ) {
if ( e.type === "mousemove" && attachment === true ) {
position = [ e.clientX, e.clientY ];
difference = [
(
Expand Down Expand Up @@ -280,6 +280,21 @@ function getTemp( data, joinString ) {
data.StatusSNS.DS18x20.DS5.Temperature + "°" + data.StatusSNS.TempUnit
) );
}
if ( data.StatusSNS.DS18x20.DS6 !== undefined ) {
temp.push( (
data.StatusSNS.DS18x20.DS6.Temperature + "°" + data.StatusSNS.TempUnit
) );
}
if ( data.StatusSNS.DS18x20.DS7 !== undefined ) {
temp.push( (
data.StatusSNS.DS18x20.DS7.Temperature + "°" + data.StatusSNS.TempUnit
) );
}
if ( data.StatusSNS.DS18x20.DS8 !== undefined ) {
temp.push( (
data.StatusSNS.DS18x20.DS8.Temperature + "°" + data.StatusSNS.TempUnit
) );
}
}

//6.1.1c 20180904
Expand Down Expand Up @@ -308,6 +323,21 @@ function getTemp( data, joinString ) {
data.StatusSNS[ "DS18B20-5" ].Temperature + "°" + data.StatusSNS.TempUnit
) );
}
if ( data.StatusSNS[ "DS18B20-6" ] !== undefined ) {
temp.push( (
data.StatusSNS[ "DS18B20-6" ].Temperature + "°" + data.StatusSNS.TempUnit
) );
}
if ( data.StatusSNS[ "DS18B20-7" ] !== undefined ) {
temp.push( (
data.StatusSNS[ "DS18B20-7" ].Temperature + "°" + data.StatusSNS.TempUnit
) );
}
if ( data.StatusSNS[ "DS18B20-8" ] !== undefined ) {
temp.push( (
data.StatusSNS[ "DS18B20-8" ].Temperature + "°" + data.StatusSNS.TempUnit
) );
}


if ( data.StatusSNS.DHT11 !== undefined ) {
Expand Down

0 comments on commit 7a627a8

Please sign in to comment.