moskus / hspi_csharpsample Goto Github PK
View Code? Open in Web Editor NEWC# sample for HomeSeer 3 plugins
C# sample for HomeSeer 3 plugins
The version posted 3/12/2019 builds and runs locally "out-of-the-box". However, the build generates the warnings below in VS2017. Maybe this is all "future use"stuff, but I thought it worth mentioning.
Severity Code Description Project File Line Suppression State Detail Description
Warning CS0108 'HSPI.ActionAdvancedMode' hides inherited member 'HspiBase.ActionAdvancedMode'. Use the new keyword if hiding was intended. hspi_CsharpSample C:\Homeseer Projects\HSPI_CsharpMoskusSample_V1\hspi_CsharpSample-master\hspi_CsharpSample\Hspi.cs 571 Active A variable was declared with the same name as a variable in a base class. However, the new keyword was not used. This warning informs you that you should use new; the variable is declared as if new had been used in the declaration.
Warning CS0169 The field 'Program._instance' is never used hspi_CsharpSample C:\Homeseer Projects\HSPI_CsharpMoskusSample_V1\hspi_CsharpSample-master\hspi_CsharpSample\Program.cs 34 Active
Warning CS0169 The field 'Program._appApi' is never used hspi_CsharpSample C:\Homeseer Projects\HSPI_CsharpMoskusSample_V1\hspi_CsharpSample-master\hspi_CsharpSample\Program.cs 35 Active
Warning CS0169 The field 'Program._host' is never used hspi_CsharpSample C:\Homeseer Projects\HSPI_CsharpMoskusSample_V1\hspi_CsharpSample-master\hspi_CsharpSample\Program.cs 36 Active
Warning CS0169 The field 'Program._callback' is never used hspi_CsharpSample C:\Homeseer Projects\HSPI_CsharpMoskusSample_V1\hspi_CsharpSample-master\hspi_CsharpSample\Program.cs 37 Active
Warning CS0169 The field 'Program._utils' is never used hspi_CsharpSample C:\Homeseer Projects\HSPI_CsharpMoskusSample_V1\hspi_CsharpSample-master\hspi_CsharpSample\Program.cs 38 Active
As of now I have only copied the images from Moskus post
https://forums.homeseer.com/forum/developer-support/programming-plug-in-development/plug-in-development/90775-hspi_moskussample-an-easier-plugin-sample-vb-net
We should have images that show the how it will appear when running this plugin.
Hi, I'm getting the following exception: System.BadImageFormatException
when Trying to Build from Fresh Download. I'm using Visual Studio 2017 Community Edition, have HomeSeer 3.0.0.500 running locally, and I have copied the 3 DLLs from the HomeSeer local installation to the solution lib folder:
Here are the full details:
System.BadImageFormatException: 'Could not load file or assembly 'HomeSeerAPI, Version=1.0.2.1, Culture=neutral, PublicKeyToken=null' or one of its dependencies. An attempt was made to load a program with an incorrect format.'
At the moment instance value is a static in Utils. It should be set only per instance.
After doing a fresh download (3/06/2019), unzipped into a new folder. Opened solution in VS2017. A build attempt yields this error:
Severity Code Description Project File Line Suppression State
Warning There was a mismatch between the processor architecture of the project being built "MSIL" and the processor architecture of the reference "HomeSeerAPI", "x86". This mismatch may cause runtime failures. Please consider changing the targeted processor architecture of your project through the Configuration Manager so as to align the processor architectures between your project and references, or take a dependency on references with a processor architecture that matches the targeted processor architecture of your project. hspi_CsharpSample
Fixed that by using Config Manager to change to x86.
Rebuild gives four errors. All in program.cs. Around lines 80 to 86, _ip and _port "does not exist in the current context". These appear to be defined earlier in the program as just ip and port, but I'm new to C# and may not be interpreting the code correctly. In any event, if I change those few lines to use just ip and port, the solution will build. I made no other changes.
After building, copied the exe and pdb files to the HS3 directory. Started HS3 and get the following in the log:
Error, Class not found in plugin EXE, maybe namespace is not correct,? Note filename is case sensitive!: hspi_CsharpSample.exe Class: hspi_CsharpSample.HSPI->
This may just be a newbie error on my part, but I'm stumped.
Processing of actions and triggers does not work.
Also subtriggers are not checked/fetched when creating events.
The following is not working/responding/called from HomeSeer:
get_SubTriggerCount
get_SubTriggerName
TriggerBuildUI
TriggerProcessPostUI
TriggerFormatUI
get_TriggerConfigured
ActionBuildUI
ActionProcessPostUI
ActionConfigured
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.