-
-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor library to support multiple drivers. #62
Conversation
Woah! Nice work @spudwebb I'll give it the eye over the next few days as well as fixing up host mode with the changes. Question: How much have you tested the lib, I wouldn't imagine every method has been tested (or has it)? Before a release, I will review any critical schema updates to bring it up to date with the server (its only 2 behind) Thanks for the contributions you have made on the project, it's much appreciated! |
We have a beta version of a new ZWave driver for HomeSeer based on this library that we are currently testing internally. This new driver uses a good chunk of the library but not every methods.
|
If it helps, I have tested Virtual Nodes and are consuming the statistics for display purposes. Not doing anything more than just displaying stats. Beautiful piece of work folks!!!! |
Thanks @georgeinva2004 With all testing that seems to have taken place - I will try my upmost to get a release window in (along with this PR) Thanks both 👍 |
My solution to host mode is as follows..
internal void Start(string SerialPort, ZWaveOptions Config, int WSPort)
{
string ProcessName = string.Format("server.{0}.psi", WSPort);
Process[] Zombies = Process.GetProcessesByName(ProcessName);
foreach(Process Zombie in Zombies)
{
Zombie.Kill();
File.Delete(ProcessName);
}
if (!File.Exists("server.psi"))
{
throw new FileNotFoundException("No Platform Snapshot Image (server.psi) found");
}
File.Copy("server.psi",ProcessName, true);
...
ProcessStartInfo.FileName = ProcessName
Process.Start()
} This should allow mulitple servers if starting up multiple Self Hosted instances (I will check for ports already in use) |
@spudwebb |
I created a
JsonConverter
calledZWJSSJsonConverter
so that theController
,ZWaveNode
andEndpoint
classes are automatically instantiated with a driver property when deserialized from JSON.I made all the other changes you listed in #61 (comment)
I successfully tested the library in client mode with 2 drivers.
For the self-hosted mode, I guess it will need some additional changes because in
Server.Start()
the first thing it does is kill any existing server.psi process, so that won't work if multiple servers are created. I will let you handle this part as I'm not using the self-hosted mode.