-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathupdate-plugs-tuya.ps1
More file actions
19 lines (15 loc) · 978 Bytes
/
Copy pathupdate-plugs-tuya.ps1
File metadata and controls
19 lines (15 loc) · 978 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
$configPath = "C:\aya-expo-tools\config\beleza-astral.json"
$config = Get-Content $configPath -Raw | ConvertFrom-Json
# Salvar device IDs e local key nos plugs 7 e 8
$plug7 = $config.smartplugs | Where-Object { $_.id -eq "plug-7" }
$plug8 = $config.smartplugs | Where-Object { $_.id -eq "plug-8" }
$plug7 | Add-Member -NotePropertyName "deviceId" -NotePropertyValue "eb7a4ea2c370d73f91ymo5" -Force
$plug7 | Add-Member -NotePropertyName "localKey" -NotePropertyValue "ac00ac00ac00ac" -Force
$plug8 | Add-Member -NotePropertyName "deviceId" -NotePropertyValue "eb9a38f4fa639284bcemvo" -Force
$plug8 | Add-Member -NotePropertyName "localKey" -NotePropertyValue "ac00ac00ac00ac" -Force
$content = $config | ConvertTo-Json -Depth 10
$utf8NoBom = New-Object System.Text.UTF8Encoding $false
[System.IO.File]::WriteAllText($configPath, $content, $utf8NoBom)
Write-Output "plug-7 deviceId: $($plug7.deviceId)"
Write-Output "plug-8 deviceId: $($plug8.deviceId)"
Write-Output "Salvo."