Skip to content

Commit

Permalink
Merge pull request #38 from alexdresko/quick_fixes
Browse files Browse the repository at this point in the history
Quick fixes
  • Loading branch information
alexdresko committed Mar 4, 2017
2 parents 6368bf5 + 9e545d8 commit 983ee1f
Show file tree
Hide file tree
Showing 19 changed files with 45 additions and 24 deletions.
3 changes: 0 additions & 3 deletions HSPI.sln
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@ MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HSPI", "HSPI\HSPI.csproj", "{5A16BE5F-4498-4AF1-9C59-3DB79662EBD7}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{C3AF5F1F-6760-4728-B04D-753404501E48}"
ProjectSection(SolutionItems) = preProject
HSPI.nuspec = HSPI.nuspec
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Templates", "Templates", "{85A80E33-7B0C-4913-A709-F98A7F32829A}"
EndProject
Expand Down
2 changes: 1 addition & 1 deletion HSPI/Connector.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
using System.Threading;
using CommandLine;

namespace HSPI
namespace Hspi
{
public class Connector
{
Expand Down
4 changes: 2 additions & 2 deletions HSPI/HSPI.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<ProjectGuid>{5A16BE5F-4498-4AF1-9C59-3DB79662EBD7}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>HSPI</RootNamespace>
<RootNamespace>Hspi</RootNamespace>
<AssemblyName>HSPI</AssemblyName>
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
Expand Down Expand Up @@ -73,7 +73,7 @@
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Class1.cs" />
<Compile Include="PageBuilder.cs" />
<Compile Include="HSPIBase2.cs" />
<Compile Include="HSPIBase.cs" />
<Compile Include="Options.cs" />
Expand Down
2 changes: 1 addition & 1 deletion HSPI/HSPIBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
using HSCF.Communication.Scs.Communication.EndPoints.Tcp;
using HSCF.Communication.ScsServices.Client;

namespace HSPI
namespace Hspi
{
// ReSharper disable once InconsistentNaming
public abstract class HspiBase : IPlugInAPI
Expand Down
2 changes: 1 addition & 1 deletion HSPI/HSPIBase2.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
using System.Collections.Specialized;
using HomeSeerAPI;

namespace HSPI
namespace Hspi
{
/// <summary>
/// Base class for HSPI plugin.
Expand Down
2 changes: 1 addition & 1 deletion HSPI/Options.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using CommandLine;
using CommandLine.Text;

namespace HSPI
namespace Hspi
{
public class Options
{
Expand Down
2 changes: 1 addition & 1 deletion HSPI/Class1.cs → HSPI/PageBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
using System.Collections.Specialized;
using Scheduler;

namespace HSPI
namespace Hspi
{
/// <summary>
/// This class adds some common support functions for creating the web pages used by HomeSeer plugins.
Expand Down
2 changes: 1 addition & 1 deletion Templates/HSPIPluginA.Dev/HSPI.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System.Collections.Generic;
using System.Collections.Specialized;
using HomeSeerAPI;
using HSPI;
using Hspi;

//TODO: namespace $safeprojectname$
namespace HSPIPluginA.Dev
Expand Down
2 changes: 1 addition & 1 deletion Templates/HSPIPluginA.Dev/Program.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using HSPI;
using Hspi;

//TODO: namespace $safeprojectname$
namespace HSPIPluginA.Dev
Expand Down
2 changes: 1 addition & 1 deletion Templates/HSPIPluginA/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System.Reflection;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

Expand Down
15 changes: 10 additions & 5 deletions Templates/HSPIPluginA/HSPI.cs
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
using System.Collections.Generic;
using System.Collections.Generic;
using System.Collections.Specialized;
using HomeSeerAPI;
using HSPI;
using Hspi;

namespace $safeprojectname$
{
// ReSharper disable once InconsistentNaming
public class HSPI : HSPIBase
public class HSPI : HspiBase
{
public override string InstanceFriendlyName()
{
Expand All @@ -15,12 +15,12 @@ public override string InstanceFriendlyName()

public override IPlugInAPI.strInterfaceStatus InterfaceStatus()
{
return new IPlugInAPI.strInterfaceStatus { intStatus = IPlugInAPI.enumInterfaceStatus.OK };
return new IPlugInAPI.strInterfaceStatus {intStatus = IPlugInAPI.enumInterfaceStatus.OK};
}

public override int Capabilities()
{
return (int)Enums.eCapabilities.CA_IO;
return (int) Enums.eCapabilities.CA_IO;
}

public override int AccessLevel()
Expand Down Expand Up @@ -279,5 +279,10 @@ protected override bool GetHscomPort()
{
return true;
}

public override void SetDeviceValue(int refId, double value, bool trigger = true)
{

}
}
}
2 changes: 1 addition & 1 deletion Templates/HSPIPluginA/Program.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using HSPI;
using Hspi;

namespace $safeprojectname$
{
Expand Down
2 changes: 1 addition & 1 deletion Templates/HSPIPluginB.Dev/HSPI.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using HSPI;
using Hspi;

//TODO: namespace $safeprojectname$
namespace HSPIPluginB.Dev
Expand Down
2 changes: 1 addition & 1 deletion Templates/HSPIPluginB.Dev/Program.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using HSPI;
using Hspi;

//TODO: namespace $safeprojectname$
namespace HSPIPluginB.Dev
Expand Down
2 changes: 1 addition & 1 deletion Templates/HSPIPluginB/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System.Reflection;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

Expand Down
2 changes: 1 addition & 1 deletion Templates/HSPIPluginB/HSPI.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using HSPI;
using Hspi;

namespace $safeprojectname$
{
Expand Down
2 changes: 1 addition & 1 deletion Templates/HSPIPluginB/Program.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using HSPI;
using Hspi;

namespace $safeprojectname$
{
Expand Down
Binary file modified Templates/HomeSeerTemplates/Packages/HSPI.1.0.0.nupkg
Binary file not shown.
19 changes: 19 additions & 0 deletions prep-template.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
cd $PSScriptRoot

nuget pack hspi -build -verbosity detailed
copy .\HSPI.1.0.0.nupkg .\Templates\HomeSeerTemplates\Packages -Verbose

gci templates\*.dev -Directory | foreach {
$sourceDirectory = $_.FullName
$destinationDirectory = $sourceDirectory.Replace(".Dev", "")

gci $sourceDirectory -Filter *.cs | foreach {
copy $_.FullName $destinationDirectory -Verbose
}

gci $destinationDirectory -Filter *.cs | foreach {
$content = [System.IO.File]::ReadAllText($_.FullName)
$content = [System.Text.RegularExpressions.Regex]::Replace($content, "//TODO: (.*\n)\n?(.*\n)", "`$1", [System.Text.RegularExpressions.RegexOptions]::Multiline)
[System.IO.File]::WriteAllText($_.FullName, $content)
}
}

0 comments on commit 983ee1f

Please sign in to comment.