Skip to content

Commit

Permalink
Connext-Pixoo: Carrying on DeviceID (Fixes #50)
Browse files Browse the repository at this point in the history
  • Loading branch information
James Brundage committed Oct 31, 2022
1 parent 5d7cce3 commit a7f232e
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions Functions/Pixoo/Connect-Pixoo.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,27 @@ function Connect-Pixoo
.Description
Connects to a Pixoo over Wifi
.Example
Connect-Pixoo 1.2.3.4 -PassThru
Find-Pixoo | Connect-Pixoo
.Link
Get-Pixoo
#>
[OutputType([Nullable], [PSObject])]
param(
# The IP Address for the Twinkly device. This can be discovered thru the phone user interface.
# The IP Address for the Pixoo device.
# This can be discovered using Find-Pixoo.
[Parameter(Mandatory,Position=0,ValueFromPipelineByPropertyName)]
[Alias('PixooIPAddress')]
[Alias('PixooIPAddress','DevicePrivateIP')]
[IPAddress]
$IPAddress,

# If set, will output the connection information.
[switch]
$PassThru
$PassThru,

# The DeviceID. This can be provided by Find-Pixoo
[Parameter(ValueFromPipelineByPropertyName)]
[string]
$DeviceId
)

begin {
Expand Down Expand Up @@ -64,6 +70,9 @@ function Connect-Pixoo
$pixooDataFile = Join-Path $lightScriptRoot ".$($macAddress).pixoo.clixml"
$pixooConf.pstypenames.clear()
$pixooConf.pstypenames.add('Pixoo')
if ($DeviceId) {
$pixooConf | Add-Member NoteProperty DeviceID $DeviceId -Force
}
$pixooConf |
Add-Member NoteProperty IPAddress $IPAddress -Force -PassThru |
Add-Member NoteProperty MACAddress $macAddress -Force -PassThru |
Expand Down

0 comments on commit a7f232e

Please sign in to comment.