@@ -23,7 +23,7 @@ public class Driver
2323 private Dictionary < string , Action < JObject > > NodeEventMap ;
2424 private Dictionary < string , Action < JObject > > ControllerEventMap ;
2525 private Dictionary < string , Action < JObject > > DriverEventMap ;
26- private Semver . SemVersion SchemaVersionID = new Semver . SemVersion ( 1 , 40 , 0 ) ;
26+ private int _schemaVersion = 42 ;
2727 private string SerialPort ;
2828 private bool RequestedExit = false ;
2929 private JsonSerializer _jsonSerializer ;
@@ -571,7 +571,7 @@ public Driver(Uri Server, int SchemaVersion = 0, int ServerErrorThrottleTime = 1
571571
572572 if ( SchemaVersion > 0 )
573573 {
574- SchemaVersionID = new Semver . SemVersion ( 1 , SchemaVersion , 0 ) ;
574+ _schemaVersion = SchemaVersion ;
575575 }
576576
577577 Callbacks = new Dictionary < Guid , Action < JObject > > ( ) ;
@@ -710,7 +710,7 @@ private void DestroySocket()
710710 {
711711 if ( ClientWebSocket . IsRunning )
712712 {
713- ClientWebSocket . Stop ( WebSocketCloseStatus . NormalClosure , "Destroy" ) ;
713+ _ = ClientWebSocket . Stop ( WebSocketCloseStatus . NormalClosure , "Destroy" ) ;
714714 }
715715
716716 if ( Host )
@@ -768,7 +768,7 @@ private void SettleCallbacksError()
768768 Callbacks [ ID ] . Invoke ( JO ) ;
769769 Callbacks . Remove ( ID ) ;
770770 }
771- catch ( Exception Error )
771+ catch ( Exception )
772772 {
773773 continue ;
774774 }
@@ -966,7 +966,7 @@ private void WebsocketClient_MessageReceived(object sender, ResponseMessage Mess
966966 Callbacks [ MessageID ] . Invoke ( JO ) ;
967967 Callbacks . Remove ( MessageID ) ;
968968 }
969- catch ( Exception Error ) { }
969+ catch ( Exception ) { }
970970
971971 }
972972
@@ -978,26 +978,13 @@ private void WebsocketClient_MessageReceived(object sender, ResponseMessage Mess
978978 _ZWaveJSDriverVersion = JO . Value < string > ( "driverVersion" ) ;
979979 _ZWaveJSServerVersion = JO . Value < string > ( "serverVersion" ) ;
980980
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-
994981 Guid CBID = Guid . NewGuid ( ) ;
995982 Callbacks . Add ( CBID , SetAPIVersionCB ) ;
996983
997984 Dictionary < string , object > Request = new Dictionary < string , object > ( ) ;
998985 Request . Add ( "messageId" , CBID . ToString ( ) ) ;
999986 Request . Add ( "command" , Enums . Commands . SetAPIVersion ) ;
1000- Request . Add ( "schemaVersion" , SchemaVersionID . Minor ) ;
987+ Request . Add ( "schemaVersion" , _schemaVersion ) ;
1001988
1002989 string RequestPL = Newtonsoft . Json . JsonConvert . SerializeObject ( Request ) ;
1003990
0 commit comments