Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Sep 14 02:34
    Build #205 passed
  • Sep 14 02:33
    greenkeeper[bot] commented #109
  • Sep 14 02:33

    greenkeeper[bot] on eslint-6.4.0

    chore(package): update eslint t… (compare)

  • Sep 06 22:34
    jldubz commented #3
  • Sep 06 20:38
    dpmurphy commented #111
  • Sep 06 20:01
    alexdresko commented #111
  • Sep 06 20:00
    alexdresko commented #3
  • Sep 06 19:48
    alexdresko commented #111
  • Sep 06 19:37
    jldubz commented #3
  • Sep 06 19:36
    jldubz commented #111
  • Sep 06 19:11
    jldubz commented #3
  • Sep 06 19:01
    oesolberg commented #111
  • Sep 06 19:01
    oesolberg commented #111
  • Sep 06 18:54
    alexdresko commented #111
  • Sep 06 18:47
    dpmurphy commented #111
  • Sep 06 18:42
    alexdresko commented #111
  • Sep 06 18:42
    alexdresko commented #111
  • Sep 06 18:40
    alexdresko commented #111
  • Sep 06 18:35
    dpmurphy commented #111
  • Sep 06 18:35
    jldubz commented #111
Alex Dresko
@alexdresko

@alexbk66

Separate class would make sense if it was connecting differrnt classes, but since all it does - calls functions from HSPIBase - then this code belongs to HSPIBase.

Connector.cs is based on the code in main.vb from the HS-provided samples. The relationship between Connector and HSPIBase is that Connector uses HSPIBase. HSPIBase does not use itself in the same way that Connector uses it. Or to put it another way, Connector is used to manage the lifetime of HSPIBase. Connector doesn't have anything to do with the plugin itself. Like @oesolberg, I feel like Connector deserves to stay as is.

Alex Dresko
@alexdresko

@alexbk66

Ok, found it - create a bin folder for my plugin...

As @oesolberg said, the HSPI project templates automatically separate your assemblies into the appropriate bin folder structure. Is that not happening on your system?

As an aside, I'm looking forward to the VS 2019 feature that allows a project to specify which VS components are required to develop against the project. I feel like a lot of the problems @alexbk66 has experienced has to do with his Visual Studio configuration.

Alex Dresko
@alexdresko

[EDIT] Why not get rid of fix-output.ps all together? Many people have policy issues executing powershell..

Let me know if the postbuild script you wrote works after you've had some time to use it. I'm hesitant to switch it right now, as PowerShell is infinitely more powerful than the cmd system. Also, I'm sure there are some developers who can't use Powershell, but I imagine the number would be crazy small. Lastly, PowerShell runs on more than just Windows, and I do intend on trying to get an HSPI development environment running in VS Code on Linux.

Alex Dresko
@alexdresko

@alexbk66

It was based on assumptions about project TargetDir which can be changed and it broke the script

Can you explain what changes you made that broke the script?

It couldn't handle spaces in target
I don't understand how your script deals with spaces. I see some additional .Replaces(..) statements, but those don't seem relevant to what you describe.

Alex Dresko
@alexdresko

@alexbk66 I should have come out the gate by saying thanks first. So, thanks. Seriously. You've done a lot of great work and uncovered a lot that will benefit HSPI.

I'd like to implement what we can from your HSPIBase, but it's not clear where the changes are and what each change is meant to accomplish.

Can you break down each change a little more specifically? Or better, fork HSPI and submit each logical feature as a commit. Then PR the whole thing and I'll get it merged into the core.

Alex Khassapov
@alexbk66
Let me know if the postbuild script you wrote works after you've had some time to use it. I'm hesitant to switch it right now, as PowerShell is infinitely more powerful than the cmd system. Also, I'm sure there are some developers who can't use Powershell, but I imagine the number would be crazy small. Lastly, PowerShell runs on more than just Windows, and I do intend on trying to get an HSPI development environment running in VS Code on Linux.
Yeah, it works great. And also VS now outputs program stdout into it's "Output" window - not a separate console window - so it gives more flexibility, i.e. search, clear, etc.
Alex Khassapov
@alexbk66
Regarding "what changes you made that broke the script" - it has an assumption about output folder, i.e. bin/$(Configuration) - but I changed it. In my postbuid step I use $(TargetDir) - which always works
Brandon Grant
@Artiiz-ZA
Hey there.
Just getting started with transitioning a plugin over to use your awesome framework. I have done nothing more than install through Visual Studio and create a project from the template, changed the endpoint in debugging. The issue I am having is the plugin shows up, however the Plug-In Name in HomeSeer Interfaces and Addons is completely blank, where in the getting started guide it showed. Is there an additional required step?
Brandon Grant
@Artiiz-ZA
Turns out it is just HomeSeer being difficult about Remote Connections, my bad!
Alex Dresko
@alexdresko
@Artiiz-ZA Glad you got it working. Let us know if you run into any issues. It probably wouldn't hurt if you read the past couple of pages of content here in gitter. That, along with checking out the most recent opened and closed issues in github will likely help in getting you up to speed.
Brandon Grant
@Artiiz-ZA
@alexdresko Thanks,, will do!
Alex Khassapov
@alexbk66
Turns out it is just HomeSeer being difficult about Remote Connections, my bad!
It's not difficult, you just need to use API properly
HomeSeerAPI.WebPageDesc wpd = new WebPageDesc
{
    plugInName = PluginName,
    link = link,
    linktext = linktext,
    page_title = page_title
};

// Link for "Manage Plugins" page
Callback.RegisterConfigLink(wpd);
// Link for Plugins Menu
wpd.plugInName = PluginNameCleaned;
Callback.RegisterLink(wpd);
Odd Erik Midthaug
@oesolberg
Have any of you gotten PluginFunction to work with arrays of classes? I can get it to work with array of string, but when I try to return a serializable class in an array the calling script gives me an exception (Object reference not set to an instance of an object)
Alex Khassapov
@alexbk66
PluginFunction is designed to return result of function executed inside plugin. You can't return objects allocated inside pluging executable - they belong to plugin memory space.
Odd Erik Midthaug
@oesolberg
I have managed to return an array of strings from my plugin. And I see that BLGData plugin returns an array of CalendarEvents. So it can be done. I am just not sure how.
Alex Khassapov
@alexbk66
Probably strings are native and HS knows how to marshal them.. I'm not sure what BLGData returns, possible also array of strings? Do you realise that plugin is an executable, when you create an object - it allocates it in its own memory - you can't expect to access process memory outside the process space. It's not as trivial, https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-dcom/d325327c-4b2c-4096-964e-c596feffd929
Odd Erik Midthaug
@oesolberg
BLGData returns an array of CalendarEvents cast to object before it is sendt back to the calling script. Or at least that is what it looks like when I view his plugin with DotPeek. I am going to try to test this in vb.net (MoskusSample) to see if I can get it to work. If it works in vb.net then it "should" work in C#...
Alex Khassapov
@alexbk66
I tried a test app - HS doesn't understand my object I return, I tried to log just obj.GetType().Name - nothing. Kind of what I was expecting.
However other Blade plugins also return arrays of objects, i.e.
For Each r As Object In hs.PluginFunction("BLOnkyo", "", "Receivers", Nothing) hs.writelog("Info", "Name: " & r.Name & " is a receiver!") Next
So the best option is to ask Blade in forum. You got me interested :)
Alex Khassapov
@alexbk66
One possible explanation - Blade is using VB and you C#?
Odd Erik Midthaug
@oesolberg
Maybe. I will find out later today I think. But VB.Net and C# should produce the same kind of code hence give the same possibilities.
Odd Erik Midthaug
@oesolberg
Nope. Does not work better in VB.Net. Time to enter the messageboard
Alex Khassapov
@alexbk66
I spent two days googling and trying, nothing really helpful. If not Blades plugins - I would say - it's not possible. So Blade is the only hope.
Odd Erik Midthaug
@oesolberg
It is possible. The problem is that we are not seeing the obvious. I guess you are also testing by running the plugin remote. If so HomeSeer will not know about the class you are returning since it is remote. When HS runs the plugin it can inspect the running exe (this is important) and create the needed Serializable classes in the return object.
I got it working!
Odd Erik Midthaug
@oesolberg
And you might need to set all variables in returning object to something.
Not sure yet, but at least I got something working
Odd Erik Midthaug
@oesolberg
Nope, you dont need to set all variables in the returning object. But - IT WORKS ! - yay!
Alex Khassapov
@alexbk66
Yeah, I worked it out too, the exe should be local in HS root - then it can de-serialise the object
Alex Khassapov
@alexbk66
This guy Bill Sobel is pretty annoying
Odd Erik Midthaug
@oesolberg
He has some valid points. I am not familiar with remoting so all that stuff is new to me. Guess I should read up a bit about it.
Alex Khassapov
@alexbk66
You don't really need to understand .NET remoting, just the lessons we learned - which should be really documented. I.e. that HS loads the plugin executable to extract the class declaration using Reflection.
And his comments about sticking to basic objects was not any help - not answering the original question. And the mentoring patronising tone...
Odd Erik Midthaug
@oesolberg
Cool. I will check it out to see if there are any good thoughts I could borrow :-)
Odd Erik Midthaug
@oesolberg
I see that you have linked configs to html-pages. Should not these html-pages exist in the solution?
Alex Khassapov
@alexbk66
I'm not sure what you mean?
And probably HS forum is netter for discussion - so other users can see it.
Odd Erik Midthaug
@oesolberg
RegisterWebPageDesc(Name + " Help", "AKSmartDevice/AKSmartDeviceVer1.htm", "Help1", helplink: true);
RegisterWebPageDesc("Help", "/AKSmartDevice/AKSmartDeviceVer1.htm", "Help2", helplink: false);
Odd Erik Midthaug
@oesolberg
It is not what you do, but the htm-files you are linking to. Should they not be included in the project?
Alex Khassapov
@alexbk66
Ah, yes, they are included in my Smart Device plugin installer. You can try it. http://plugins.homeseer.com/releasenotes?productid=313
Odd Erik Midthaug
@oesolberg
Ah, cool.
Odd Erik Midthaug
@oesolberg
Kudos for making a plugin and adding it to the store.
Alex Khassapov
@alexbk66
Thank you