|
525 | 525 | strTemp = strTemp & InsteonThermostatResponse(Command1, Command2, FromAddress) |
526 | 526 | ElseIf (FromAddress = My.Settings.Insteon_DoorSensorAddr OrElse FromAddress = My.Settings.Insteon_BackDoorSensorAddr) AndAlso ToAddress = "0.0.1" Then ' TODO: Detect this by device model |
527 | 527 | strTemp = strTemp & InsteonDoorSensorResponse(Command1, Command2) |
528 | | - ElseIf FromAddress = My.Settings.Insteon_SmokeBridgeAddr AndAlso Flags = 203 AndAlso x(ms + 5) = 0 AndAlso x(ms + 6) = 0 Then ' TODO: Detect this by device model |
| 528 | + ElseIf Flags = 203 AndAlso x(ms + 5) = 0 AndAlso x(ms + 6) = 0 AndAlso IsSmokeBridge(FromAddress) Then |
529 | 529 | strTemp = strTemp & InsteonSmokeBridgeResponse(x(ms + 7)) |
530 | 530 | ElseIf FromAddress = My.Settings.Insteon_SumpAlarmAddr AndAlso Flags = 203 AndAlso x(ms + 5) = 0 AndAlso x(ms + 6) = 0 Then |
531 | 531 | strTemp = strTemp & InsteonSumpAlarmResponse(Command1) |
|
662 | 662 | strTemp = strTemp & FromName & " " & modInsteon.InsteonCommandLookup(Command1) |
663 | 663 | End If |
664 | 664 |
|
665 | | - If FromAddress = My.Settings.Insteon_SmokeBridgeAddr Then ' TODO: Detect this by device model |
| 665 | + If IsSmokeBridge(FromAddress) Then |
666 | 666 | strTemp = strTemp & " Smoke Bridge: " & InsteonSmokeBridgeResponse(Group) |
667 | 667 | End If |
668 | 668 | My.Application.Log.WriteEntry(strTemp, TraceEventType.Verbose) |
|
1212 | 1212 | Return False |
1213 | 1213 | End Function |
1214 | 1214 |
|
| 1215 | + ''' <summary> |
| 1216 | + ''' Returns true if address is for a Smoke Bridge |
| 1217 | + ''' </summary> |
| 1218 | + ''' <param name="strAddress">Insteon address in XX.XX.XX format</param> |
| 1219 | + ''' <returns>True if in database as a smoke bridge</returns> |
| 1220 | + Function IsSmokeBridge(ByVal strAddress As String) As Boolean |
| 1221 | + Dim devcat As Integer = 0 |
| 1222 | + Dim subcat As Integer = 0 |
| 1223 | + |
| 1224 | + modDatabase.ExecuteScalar("SELECT DevCat FROM INSTEON_DEVICES WHERE Address = '" + strAddress + "'", devcat) |
| 1225 | + modDatabase.ExecuteScalar("SELECT SubCat FROM INSTEON_DEVICES WHERE Address = '" + strAddress + "'", subcat) |
| 1226 | + |
| 1227 | + If devcat = 16 AndAlso subcat = 10 Then |
| 1228 | + Return True |
| 1229 | + Else |
| 1230 | + Return False |
| 1231 | + End If |
| 1232 | + End Function |
| 1233 | + |
1215 | 1234 | ''' <summary> |
1216 | 1235 | ''' Returns true if address is for a Water Leak Detector. |
1217 | 1236 | ''' </summary> |
|
0 commit comments