@@ -23,7 +23,7 @@ public class Driver
23
23
private Dictionary < string , Action < JObject > > NodeEventMap ;
24
24
private Dictionary < string , Action < JObject > > ControllerEventMap ;
25
25
private Dictionary < string , Action < JObject > > DriverEventMap ;
26
- private Semver . SemVersion SchemaVersionID = new Semver . SemVersion ( 1 , 40 , 0 ) ;
26
+ private int _schemaVersion = 42 ;
27
27
private string SerialPort ;
28
28
private bool RequestedExit = false ;
29
29
private JsonSerializer _jsonSerializer ;
@@ -571,7 +571,7 @@ public Driver(Uri Server, int SchemaVersion = 0, int ServerErrorThrottleTime = 1
571
571
572
572
if ( SchemaVersion > 0 )
573
573
{
574
- SchemaVersionID = new Semver . SemVersion ( 1 , SchemaVersion , 0 ) ;
574
+ _schemaVersion = SchemaVersion ;
575
575
}
576
576
577
577
Callbacks = new Dictionary < Guid , Action < JObject > > ( ) ;
@@ -710,7 +710,7 @@ private void DestroySocket()
710
710
{
711
711
if ( ClientWebSocket . IsRunning )
712
712
{
713
- ClientWebSocket . Stop ( WebSocketCloseStatus . NormalClosure , "Destroy" ) ;
713
+ _ = ClientWebSocket . Stop ( WebSocketCloseStatus . NormalClosure , "Destroy" ) ;
714
714
}
715
715
716
716
if ( Host )
@@ -768,7 +768,7 @@ private void SettleCallbacksError()
768
768
Callbacks [ ID ] . Invoke ( JO ) ;
769
769
Callbacks . Remove ( ID ) ;
770
770
}
771
- catch ( Exception Error )
771
+ catch ( Exception )
772
772
{
773
773
continue ;
774
774
}
@@ -966,7 +966,7 @@ private void WebsocketClient_MessageReceived(object sender, ResponseMessage Mess
966
966
Callbacks [ MessageID ] . Invoke ( JO ) ;
967
967
Callbacks . Remove ( MessageID ) ;
968
968
}
969
- catch ( Exception Error ) { }
969
+ catch ( Exception ) { }
970
970
971
971
}
972
972
@@ -978,26 +978,13 @@ private void WebsocketClient_MessageReceived(object sender, ResponseMessage Mess
978
978
_ZWaveJSDriverVersion = JO . Value < string > ( "driverVersion" ) ;
979
979
_ZWaveJSServerVersion = JO . Value < string > ( "serverVersion" ) ;
980
980
981
- if ( Semver . SemVersion . Parse ( _ZWaveJSServerVersion , Semver . SemVersionStyles . Strict ) . Major != SchemaVersionID . Major )
982
- {
983
- StartUpError ? . Invoke ( "The Server Schema version is not compatible with the library version" ) ;
984
- return ;
985
- }
986
-
987
- if ( Semver . SemVersion . Parse ( _ZWaveJSServerVersion , Semver . SemVersionStyles . Strict ) . ComparePrecedenceTo ( SchemaVersionID ) < 0 )
988
- {
989
- StartUpError ? . Invoke ( "The Server Schema version is lower than what was requested by the library" ) ;
990
- return ;
991
-
992
- }
993
-
994
981
Guid CBID = Guid . NewGuid ( ) ;
995
982
Callbacks . Add ( CBID , SetAPIVersionCB ) ;
996
983
997
984
Dictionary < string , object > Request = new Dictionary < string , object > ( ) ;
998
985
Request . Add ( "messageId" , CBID . ToString ( ) ) ;
999
986
Request . Add ( "command" , Enums . Commands . SetAPIVersion ) ;
1000
- Request . Add ( "schemaVersion" , SchemaVersionID . Minor ) ;
987
+ Request . Add ( "schemaVersion" , _schemaVersion ) ;
1001
988
1002
989
string RequestPL = Newtonsoft . Json . JsonConvert . SerializeObject ( Request ) ;
1003
990
0 commit comments