Skip to content

Commit

Permalink
Expand status report
Browse files Browse the repository at this point in the history
  • Loading branch information
ocdtrekkie committed Aug 25, 2018
1 parent 99db042 commit 8aa10a0
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
7 changes: 1 addition & 6 deletions modConverse.vb
Original file line number Diff line number Diff line change
Expand Up @@ -328,12 +328,7 @@ Module modConverse
End If
Case "send"
If inputData(1) = "status" AndAlso inputData(2) = "report" Then
Dim strStatusReport As String = "The current time is " & Now() & vbCrLf & vbCrLf & "Home monitoring status is set to " & modGlobal.HomeStatus & "." & vbCrLf & vbCrLf & "The current inside temperature is " & My.Settings.Global_LastKnownInsideTemp & " F."
If My.Settings.Insteon_ThermostatSlaveAddr <> "" Then
strStatusReport = strStatusReport & " (Second reading: " & My.Settings.Global_LastKnownInsideTemp2nd & " F)"
End If
modMail.Send("HAController Status Report", strStatusReport)
strCommandResponse = "Sending report"
strCommandResponse = modGlobal.SendStatusReport()
End If
Case "set"
If inputData(1) = "experimental" AndAlso inputData(2) = "mode" Then
Expand Down
15 changes: 15 additions & 0 deletions modGlobal.vb
Original file line number Diff line number Diff line change
Expand Up @@ -162,4 +162,19 @@ Public Module modGlobal
End Try
End If
End Function

Function SendStatusReport() As String
Dim strStatusReport As String = "The current time is " & Now() & vbCrLf & vbCrLf & "Home monitoring status is set to " & modGlobal.HomeStatus & "." & vbCrLf & vbCrLf & "The current inside temperature is " & My.Settings.Global_LastKnownInsideTemp & " F."
If My.Settings.Insteon_ThermostatSlaveAddr <> "" Then
strStatusReport = strStatusReport & " (Second reading: " & My.Settings.Global_LastKnownInsideTemp2nd & " F)"
End If
If My.Settings.Global_TimeDoorLastOpened <> "" Then
strStatusReport = strStatusReport & vbCrLf & vbCrLf & "The door was last opened at " & My.Settings.Global_TimeDoorLastOpened.ToShortTimeString & " on " & My.Settings.Global_TimeDoorLastOpened.ToShortDateString
End If
If My.Settings.Pihole_Enable = True Then
strStatusReport = strStatusReport & vbCrLf & vbCrLf & modPihole.CheckPiholeStatus()
End If
modMail.Send("HAController Status Report", strStatusReport)
Return "Sending status report"
End Function
End Module

0 comments on commit 8aa10a0

Please sign in to comment.