File tree Expand file tree Collapse file tree 4 files changed +20
-55
lines changed
Expand file tree Collapse file tree 4 files changed +20
-55
lines changed Original file line number Diff line number Diff line change 4141 <setting name =" Insteon_AlarmAddr" serializeAs =" String" >
4242 <value />
4343 </setting >
44- <setting name =" Insteon_DoorSensorAddr" serializeAs =" String" >
45- <value />
46- </setting >
4744 <setting name =" Insteon_Enable" serializeAs =" String" >
4845 <value >False</value >
4946 </setting >
9289 <setting name =" Mail_Username" serializeAs =" String" >
9390 <value />
9491 </setting >
95- <setting name =" Insteon_BackDoorSensorAddr" serializeAs =" String" >
96- <value />
97- </setting >
98- <setting name =" Insteon_WakeLightAddr" serializeAs =" String" >
99- <value />
100- </setting >
10192 <setting name =" Converse_BotName" serializeAs =" String" >
10293 <value >Sarah</value >
10394 </setting >
Original file line number Diff line number Diff line change 1111 <Setting Name =" Insteon_AlarmAddr" Type =" System.String" Scope =" User" >
1212 <Value Profile =" (Default)" />
1313 </Setting >
14- <Setting Name =" Insteon_DoorSensorAddr" Type =" System.String" Scope =" User" >
15- <Value Profile =" (Default)" />
16- </Setting >
1714 <Setting Name =" Insteon_Enable" Type =" System.Boolean" Scope =" User" >
1815 <Value Profile =" (Default)" >False</Value >
1916 </Setting >
6259 <Setting Name =" Mail_Username" Type =" System.String" Scope =" User" >
6360 <Value Profile =" (Default)" />
6461 </Setting >
65- <Setting Name =" Insteon_BackDoorSensorAddr" Type =" System.String" Scope =" User" >
66- <Value Profile =" (Default)" />
67- </Setting >
68- <Setting Name =" Insteon_WakeLightAddr" Type =" System.String" Scope =" User" >
69- <Value Profile =" (Default)" />
70- </Setting >
7162 <Setting Name =" Converse_BotName" Type =" System.String" Scope =" User" >
7263 <Value Profile =" (Default)" >Sarah</Value >
7364 </Setting >
Original file line number Diff line number Diff line change 523523 strTemp = strTemp & InsteonThermostatResponse(Command1, Command2, FromAddress)
524524 ElseIf (FromAddress = My.Settings.Insteon_ThermostatAddr OrElse FromAddress = My.Settings.Insteon_ThermostatSlaveAddr) AndAlso Command1 = 106 Then ' TODO: Detect this by device model
525525 strTemp = strTemp & InsteonThermostatResponse(Command1, Command2, FromAddress)
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
526+ ElseIf ToAddress = "0.0.1" AndAlso IsDoorSensor(FromAddress) Then
527527 strTemp = strTemp & InsteonDoorSensorResponse(Command1, Command2)
528528 ElseIf Flags = 203 AndAlso x(ms + 5 ) = 0 AndAlso x(ms + 6 ) = 0 AndAlso IsSmokeBridge(FromAddress) Then
529529 strTemp = strTemp & InsteonSmokeBridgeResponse(x(ms + 7 ))
12121212 Return False
12131213 End Function
12141214
1215+ ''' <summary>
1216+ ''' Returns true if address is for a Door Sensor
1217+ ''' </summary>
1218+ ''' <param name="strAddress">Insteon address in XX.XX.XX format</param>
1219+ ''' <returns>True if in database as a door sensor</returns>
1220+ Function IsDoorSensor( 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 = 2 OrElse subcat = 17 ) Then
1228+ Return True
1229+ Else
1230+ Return False
1231+ End If
1232+ End Function
1233+
12151234 ''' <summary>
12161235 ''' Returns true if address is for a Smoke Bridge
12171236 ''' </summary>
You can’t perform that action at this time.
0 commit comments