-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #9 from PepperDash-Engineering/main
merge main into Dev
- Loading branch information
Showing
22 changed files
with
357 additions
and
210 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
$latestVersions = $(git tag --merged origin/main) | ||
$latestVersion = [version]"0.0.0" | ||
Foreach ($version in $latestVersions) { | ||
Write-Host $version | ||
try { | ||
if (([version]$version) -ge $latestVersion) { | ||
$latestVersion = $version | ||
Write-Host "Setting latest version to: $latestVersion" | ||
} | ||
} | ||
catch { | ||
Write-Host "Unable to convert $($version). Skipping" | ||
continue; | ||
} | ||
} | ||
|
||
$newVersion = [version]$latestVersion | ||
$phase = "" | ||
$newVersionString = "" | ||
switch -regex ($Env:GITHUB_REF) { | ||
'^refs\/heads\/master*.' { | ||
$newVersionString = "{0}.{1}.{2}" -f $newVersion.Major, $newVersion.Minor, $newVersion.Build | ||
} | ||
'^refs\/heads\/feature\/*.' { | ||
$phase = 'alpha' | ||
$newVersionString = "{0}.{1}.{2}-{3}-{4}" -f $newVersion.Major, $newVersion.Minor, ($newVersion.Build + 1), $phase, $Env:GITHUB_RUN_NUMBER | ||
} | ||
'^refs\/heads\/release\/*.' { | ||
$splitRef = $Env:GITHUB_REF -split "/" | ||
$version = [version]($splitRef[-1] -replace "v", "") | ||
$phase = 'rc' | ||
$newVersionString = "{0}.{1}.{2}-{3}-{4}" -f $version.Major, $version.Minor, $version.Build, $phase, $Env:GITHUB_RUN_NUMBER | ||
} | ||
'^refs\/heads\/dev*.' { | ||
$phase = 'beta' | ||
$newVersionString = "{0}.{1}.{2}-{3}-{4}" -f $newVersion.Major, $newVersion.Minor, ($newVersion.Build + 1), $phase, $Env:GITHUB_RUN_NUMBER | ||
} | ||
'^refs\/heads\/hotfix\/*.' { | ||
$phase = 'hotfix' | ||
$newVersionString = "{0}.{1}.{2}-{3}-{4}" -f $newVersion.Major, $newVersion.Minor, ($newVersion.Build + 1), $phase, $Env:GITHUB_RUN_NUMBER | ||
} | ||
} | ||
|
||
|
||
Write-Output $newVersionString |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,106 @@ | ||
# Internal Essentials Plugin Template (c) 2020 | ||
# PepperDash Apc Plugin | ||
|
||
## License | ||
> The APC plugin endeavors to provide device control and routing over Apc Type Power devices. | ||
Provided under MIT license | ||
## Types | ||
|
||
## Overview | ||
1. Ap89xx | ||
|
||
Use this repo as a template when creating a new plugin for Essentials. For more information about plugins, refer to the Essentials Wiki [Plugins](https://github.com/PepperDash/Essentials/wiki/Plugins) article. | ||
## Join Map | ||
|
||
## Github Actions | ||
### Digitals | ||
|
||
This repo contains two Github Action workflows that will build this project automatically. Modify the SOLUTION_PATH and SOLUTION_FILE environment variables as needed. Any branches named `feature/*`, `release/*`, `hotfix/*` or `development` will automatically be built with the action and create a release in the repository with a version number based on the latest release on the master branch. If there are no releases yet, the version number will be 0.0.1. The version number will be modified based on what branch triggered the build: | ||
| Join | To Simpl | From Simpl | | ||
| ------- | ---------------------- | ------------------------ | | ||
| 1 | Device Online | - | | ||
| 2-50 | Reserved For Future | Reserved For Future | | ||
| 51-100 | Power On Feedback | Power On | | ||
| 100-151 | - | Power Off | | ||
| 151-200 | - | Power Toggle | | ||
|
||
- `feature` branch builds will be tagged with an `alpha` descriptor, with the Action run appended: `0.0.1-alpha-1` | ||
- `development` branch builds will be tagged with a `beta` descriptor, with the Action run appended: `0.0.1-beta-2` | ||
- `release` branches will be tagged with an `rc` descriptor, with the Action run appended: `0.0.1-rc-3` | ||
- `hotfix` branch builds will be tagged with a `hotfix` descriptor, with the Action run appended: `0.0.1-hotfix-4` | ||
### Analogs | ||
|
||
Builds on the Master branch will ONLY be triggered by manually creating a release using the web interface in the repository. They will be versioned with the tag that is created when the release is created. The tags MUST take the form `major.minor.revision` to be compatible with the build process. A tag like `v0.1.0-alpha` is NOT compatabile and may result in the build process failing. | ||
| Join | To Simpl | From Simpl | | ||
| ------- | ---------------------- | ------------------------ | | ||
| 1 | - | - | | ||
| 2-50 | - | - | | ||
| 51-100 | - | - | | ||
| 100-151 | - | - | | ||
| 151-200 | - | - | | ||
|
||
If you have any questions about the action, contact Andrew Welker or Neil Dorin. | ||
### Serials | ||
|
||
| Join | To Simpl | From Simpl | | ||
| ------- | ---------------------- | ------------------------ | | ||
| 1 | Device Name | - | | ||
| 2-50 | - | - | | ||
| 51-100 | Outlet Name | - | | ||
| 100-151 | - | - | | ||
| 151-200 | - | - | | ||
|
||
### Join Details | ||
|
||
--- | ||
|
||
1. Outlet Name is defined by the Name property in config, and is not necesarily what will be in the APC software; and the APC software requires outlet names to no contain spaces or characters. | ||
|
||
## Config Example | ||
|
||
```JSON | ||
{ | ||
"key": "PowerSupply01", | ||
"uid": 74, | ||
"name": "PowerSupply01", | ||
"type": "Ap89xx", | ||
"group": "power", | ||
"properties": { | ||
"control": { | ||
"endOfLineString": "\n", | ||
"deviceReadyResponsePattern": "", | ||
"method": "ssh", | ||
"tcpSshProperties": { | ||
"address": "0.0.0.0", | ||
"port": 22, | ||
"autoReconnect": true, | ||
"AutoReconnectIntervalMs": 10000, | ||
"username": "apc", | ||
"password": "apc" | ||
} | ||
}, | ||
"outlets": | ||
{ | ||
"outlet01" : { | ||
"name": "My First Outlet", | ||
"outletIndex": 1, | ||
"delayOn": 30, | ||
"delayOff": 2 | ||
}, | ||
"outlet02" : { | ||
"name": "Another Awesome Outlet", | ||
"outletIndex": 4, | ||
"delayOn": 30, | ||
"delayOff": 2 | ||
} | ||
} | ||
} | ||
} | ||
``` | ||
|
||
### Config Details | ||
|
||
--- | ||
__Properties:__ | ||
|
||
#### "outlets" | ||
|
||
- Dictionary that defines the outlets to be controlled | ||
- "key" - defines and sets the name of the outlet in the APC software. This value must be unique and contain no spaces or specials charaters | ||
- "name" - defines the name that will be sent to the bridge for a UI friendly name. If this value is not set it will be the key | ||
- "outletIndex" - outletNumber to be controlled | ||
- "delayOn" - NOT YET IMPLEMENTED | ||
- "delayOff" - NOT YET IMPLEMENTED | ||
|
||
## Planned Updates | ||
|
||
1. Create a custom StatusMonitor to get more detailed infomation | ||
1. Add ability to set on/off delays by outlet |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
<packages> | ||
<package id="PepperDashEssentials" version="1.6.4" targetFramework="net35" allowedVersions="[1.0,2.0)"/> | ||
<package id="PepperDashEssentials" version="1.8.0" targetFramework="net35" allowedVersions="[1.0,2.0)"/> | ||
</packages> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.