Open alekslyse opened 6 years ago
I'm afraid that's not going to be done in the near future. You've inspired me to dive back into it sooner than later, though. We'll see what happens. I'll keep this issue open for tracking template 3.
Hopefully you will find the motivation. I hear homeseer 4 is coming soon with unchanged API so it might be the right time.
Regardless you made the development cycle better and made it's more possible for c# as I can't stand VB.
Maybe I will make an utility class and send a pull request that people can use meanwhile if you would like that?
On Mon, 3 Sep 2018, 02:59 Alex Dresko, notifications@github.com wrote:
I'm afraid that's not going to be done in the near future. You've inspired me to dive back into it sooner than later, though. We'll see what happens. I'll keep this issue open for tracking template 3.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/alexdresko/HSPI/issues/90#issuecomment-417973858, or mute the thread https://github.com/notifications/unsubscribe-auth/ADghx2mA3089T364Aq1GgvT38kaF7IfVks5uXH7jgaJpZM4WW01H .
Interesting. Where's your info on HS4? I kinda thought the HS devs have just been on vacation for the past couple of years.
Happy to accept any utility classes you might have.
Its been all over their forum. I got some official replies on the forum HS4 will keep the current API, and just be cosmetic changes (even official im not sure if its that official), but we can assume it wont be that much changes as HS2->HS3.
As you can see they are pushing a new phone app and upgraded their forum so I think something is happening.
Im not that steady in C# to be honest - the development is ok, but im not used to work with visual studio and such. My goal is just to make a class named Utilities that I can just reference from HSPI.cs with for example Utilities.ListDevices() or Utilities.CreateDevice(x, level) - is it any best practises how to implement a class like that and still keep your script in context (so I can access HS etc in that sub class).
Would like it as its own file so its easy for people to just add it to HSPI and create, list, delete and update devices with a single line of code.
I've got another project I'm working on that aims to make c# scripting easier. There are two parts:
Pretty excited about it, as I actually need that more than I need this HSPI project in the short term. But, ultimately, HS plugins are more powerful, and HsMetal could still be utilized with HSPI for more power.
The main thing missing for HSPI is documentation - I know its boring, but should be done. I think its good to know what your plugins really can do without having to check the code. For example are you just passing functions through the classes to make the naming convention easier, or do you have functional classes?
I did take a look on your template 3 branch, and I think you are focusing more on functional classes there?
Is HSMetal something that is currently in release or a private project?
When I just get started I would happily donate for keeping this project running - Im doing this development for making plugins to support cancer and teenager projects - not a penny to my pocket so hopefully I can get my mind wrapped around the code properly so I can start pushing out some plugins.
Agreed about the example documentation. I also really need to go through all of the latest commits and make sure I've documented all of the changes I've made. And then make it a habit to not merge anything without including documentation. :)
I did make some changes recently that will enable me to write documentation easier. Namely, with the right plugins installed, it's pretty easy writing documentation in VSCode now.
We'll get there.
Solid goals on your part, also. Keep doing what you're doing. You'll go far.
To make things easier, and you have the knowledge, could you add an Utility.cs class that has access to hs and can be fully accessed from HSPI - Im not sure about the best practise. If you could just make a class with one function like GetDeviceEnumerator() I will fill it up with useful functions and send a pull request as I will add all functions I will be using to this class.
For example if I make a method in HSPI with the following code
Scheduler.Classes.clsDeviceEnumeration en = (Scheduler.Classes.clsDeviceEnumeration)HS.GetDeviceEnumerator();
Scheduler.Classes.DeviceClass dv;
while (!en.Finished)
{
dv = en.GetNext();
Console.WriteLine(dv.get_Name(HS));
}
Its working well, but not in sub classes. Not sure why though
Maybe something like this (I do it like this to get all my plugins devices):
private List<DeviceClass> GetHomeseerDevices()
{
var deviceList = new List<Scheduler.Classes.DeviceClass>();
var deviceEnumerator = (clsDeviceEnumeration)_hs.GetDeviceEnumerator();
while (!deviceEnumerator.Finished)
{
var foundDevice = deviceEnumerator.GetNext();
deviceList.Add(foundDevice);
}
return deviceList.Where(x => x.get_Interface(_hs) == Utility.PluginName).ToList();
}
This is exciting! I'm glad to see some wind again in the sails. I'm working on a Ryobi Garage Door opener plugin now, so I just jumped back in.
I've forked this and started to follow. I'm excited to see movement towards some good documentation around using C# with HS and gives me some hope to port plugins to C#.
If we should build a proper API we need to agree on a standard we can share. I'm working on my builder classes and others got their own. We all using dirrerent approaches, helper, builder, constructor classes etc. I don't mind create an element in chain, but then we seller for that.
Getting in basic classes for log, device, session, graphics/ files etc should be very simple if we decide.
If someone with current knowledge of best practices in c# can start I can happily add functions or links depending on model for making most of the functions easy to implement.
On Wed, 12 Sep 2018, 01:30 John, notifications@github.com wrote:
I've forked this and started to follow. I'm excited to see movement towards some good documentation around using C# with HS and gives me some hope to port plugins to C#.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/alexdresko/HSPI/issues/90#issuecomment-420460544, or mute the thread https://github.com/notifications/unsubscribe-auth/ADghx3Z60ftcf0MbW7vB4nUrX4pJ0NKxks5uaEeqgaJpZM4WW01H .
Do you have any ETA on template 3, or might starting to release it into beta state officially in the package?
Seem like you have implemented some nice things like device creation etc, that has to be done manually today and would speed up development a lot