From f3718ac2657574fcd41c1d89f942c8bb945e91f9 Mon Sep 17 00:00:00 2001 From: Chris Nussbaum Date: Thu, 28 Apr 2022 20:54:30 -0500 Subject: [PATCH] Finish removing underscores from names (#36) Move remaining devices to new wifi Compile all devices script does a backup first --- devices/computer-light.yaml | 3 --- devices/family-room-tv.yaml | 7 +++++++ .../{master_bath_fan.yaml => master-bath-fan.yaml} | 6 +++++- ...ath_lights_1.yaml => master-bath-lights-1.yaml} | 6 +++++- ...ath_lights_2.yaml => master-bath-lights-2.yaml} | 6 +++++- devices/{master_bed.yaml => master-bed.yaml} | 6 +++++- devices/{office_light.yaml => office-light.yaml} | 6 +++++- devices/patio-lights.yaml | 4 ++++ devices/{pool_pumps.yaml => pool-pumps.yaml} | 6 +++++- scripts/compile_all_devices.ps1 | 14 ++++++++++++++ 10 files changed, 55 insertions(+), 9 deletions(-) rename devices/{master_bath_fan.yaml => master-bath-fan.yaml} (63%) rename devices/{master_bath_lights_1.yaml => master-bath-lights-1.yaml} (81%) rename devices/{master_bath_lights_2.yaml => master-bath-lights-2.yaml} (80%) rename devices/{master_bed.yaml => master-bed.yaml} (95%) rename devices/{office_light.yaml => office-light.yaml} (81%) rename devices/{pool_pumps.yaml => pool-pumps.yaml} (94%) diff --git a/devices/computer-light.yaml b/devices/computer-light.yaml index 50b2220..d473a6b 100644 --- a/devices/computer-light.yaml +++ b/devices/computer-light.yaml @@ -10,9 +10,6 @@ substitutions: ip_subnet: !secret new-ip-subnet ip_gateway: !secret new-ip-gateway -wifi: - use_address: 192.168.128.22 - packages: feit_dimmer: !include ../packages/feit_dimmer.yaml diff --git a/devices/family-room-tv.yaml b/devices/family-room-tv.yaml index 79a71b5..7ada4e1 100644 --- a/devices/family-room-tv.yaml +++ b/devices/family-room-tv.yaml @@ -5,6 +5,13 @@ substitutions: ota_pwd: !secret family-room-tv-ota-pwd api_pwd: !secret family-room-tv-api-pwd ap_wifi_pwd: !secret family-room-tv-ap-pwd + wifi_ssid: !secret new-wifi-ssid + wifi_password: !secret new-wifi-password + ip_subnet: !secret new-ip-subnet + ip_gateway: !secret new-ip-gateway + +wifi: + use_address: 192.168.128.46 packages: feit_dimmer: !include ../packages/topgreener_smart_plug.yaml diff --git a/devices/master_bath_fan.yaml b/devices/master-bath-fan.yaml similarity index 63% rename from devices/master_bath_fan.yaml rename to devices/master-bath-fan.yaml index 87482f6..6511f0a 100644 --- a/devices/master_bath_fan.yaml +++ b/devices/master-bath-fan.yaml @@ -1,11 +1,15 @@ substitutions: - device_id: master_bath_fan + device_id: master-bath-fan device_name: Master Bathroom Fan ip_address: !secret master-bath-fan-ip ota_pwd: !secret master-bath-fan-ota-pwd api_pwd: !secret master-bath-fan-api-pwd ap_wifi_pwd: !secret master-bath-fan-ap-pwd fan_wattage: "26.6" + wifi_ssid: !secret new-wifi-ssid + wifi_password: !secret new-wifi-password + ip_subnet: !secret new-ip-subnet + ip_gateway: !secret new-ip-gateway packages: device_base: !include ../packages/feit_dimmer_as_fan.yaml diff --git a/devices/master_bath_lights_1.yaml b/devices/master-bath-lights-1.yaml similarity index 81% rename from devices/master_bath_lights_1.yaml rename to devices/master-bath-lights-1.yaml index e43e8e4..0b62a64 100644 --- a/devices/master_bath_lights_1.yaml +++ b/devices/master-bath-lights-1.yaml @@ -1,10 +1,14 @@ substitutions: - device_id: master_bath_lights + device_id: master-bath-lights device_name: Master Bathroom Lights ip_address: !secret master-bath-lights-ip ota_pwd: !secret master-bath-lights-ota-pwd api_pwd: !secret master-bath-lights-api-pwd ap_wifi_pwd: !secret master-bath-lights-ap-pwd + wifi_ssid: !secret new-wifi-ssid + wifi_password: !secret new-wifi-password + ip_subnet: !secret new-ip-subnet + ip_gateway: !secret new-ip-gateway packages: feit_dimmer: !include ../packages/feit_dimmer.yaml diff --git a/devices/master_bath_lights_2.yaml b/devices/master-bath-lights-2.yaml similarity index 80% rename from devices/master_bath_lights_2.yaml rename to devices/master-bath-lights-2.yaml index 80997b2..73aa136 100644 --- a/devices/master_bath_lights_2.yaml +++ b/devices/master-bath-lights-2.yaml @@ -1,10 +1,14 @@ substitutions: - device_id: master_bath_lights_2 + device_id: master-bath-lights-2 device_name: Master Bathroom Lights 2 ip_address: !secret master-bath-lights-2-ip ota_pwd: !secret master-bath-lights-2-ota-pwd api_pwd: !secret master-bath-lights-2-api-pwd ap_wifi_pwd: !secret master-bath-lights-2-ap-pwd + wifi_ssid: !secret new-wifi-ssid + wifi_password: !secret new-wifi-password + ip_subnet: !secret new-ip-subnet + ip_gateway: !secret new-ip-gateway packages: feit_dimmer: !include ../packages/feit_dimmer_without_power.yaml diff --git a/devices/master_bed.yaml b/devices/master-bed.yaml similarity index 95% rename from devices/master_bed.yaml rename to devices/master-bed.yaml index e9b201a..d8788a5 100644 --- a/devices/master_bed.yaml +++ b/devices/master-bed.yaml @@ -1,11 +1,15 @@ substitutions: - device_id: master_bed + device_id: master-bed device_name: Master Bed board: nodemcuv2 ip_address: !secret master-bed-ip ota_pwd: !secret master-bed-ota-pwd api_pwd: !secret master-bed-api-pwd ap_wifi_pwd: !secret master-bed-ap-pwd + wifi_ssid: !secret new-wifi-ssid + wifi_password: !secret new-wifi-password + ip_subnet: !secret new-ip-subnet + ip_gateway: !secret new-ip-gateway packages: device_base: !include ../packages/device_base.yaml diff --git a/devices/office_light.yaml b/devices/office-light.yaml similarity index 81% rename from devices/office_light.yaml rename to devices/office-light.yaml index fd8e55a..64cf6ca 100644 --- a/devices/office_light.yaml +++ b/devices/office-light.yaml @@ -1,10 +1,14 @@ substitutions: - device_id: office_light + device_id: office-light device_name: Office Light ip_address: !secret office-light-ip ota_pwd: !secret office-light-ota-pwd api_pwd: !secret office-light-api-pwd ap_wifi_pwd: !secret office-light-ap-pwd + wifi_ssid: !secret new-wifi-ssid + wifi_password: !secret new-wifi-password + ip_subnet: !secret new-ip-subnet + ip_gateway: !secret new-ip-gateway packages: feit_dimmer: !include ../packages/feit_dimmer.yaml diff --git a/devices/patio-lights.yaml b/devices/patio-lights.yaml index efa29a7..29bdb3f 100644 --- a/devices/patio-lights.yaml +++ b/devices/patio-lights.yaml @@ -6,6 +6,10 @@ substitutions: ota_pwd: !secret patio-lights-ota-pwd api_pwd: !secret patio-lights-api-pwd ap_wifi_pwd: !secret patio-lights-ap-pwd + wifi_ssid: !secret new-wifi-ssid + wifi_password: !secret new-wifi-password + ip_subnet: !secret new-ip-subnet + ip_gateway: !secret new-ip-gateway packages: device_base: !include ../packages/device_base.yaml diff --git a/devices/pool_pumps.yaml b/devices/pool-pumps.yaml similarity index 94% rename from devices/pool_pumps.yaml rename to devices/pool-pumps.yaml index 10e488f..73fb206 100644 --- a/devices/pool_pumps.yaml +++ b/devices/pool-pumps.yaml @@ -1,11 +1,15 @@ substitutions: - device_id: pool_pumps + device_id: pool-pumps device_name: Pool Pumps board: modwifi ip_address: !secret pool-pumps-ip ota_pwd: !secret pool-pumps-ota-pwd api_pwd: !secret pool-pumps-api-pwd ap_wifi_pwd: !secret pool-pumps-ap-pwd + wifi_ssid: !secret new-wifi-ssid + wifi_password: !secret new-wifi-password + ip_subnet: !secret new-ip-subnet + ip_gateway: !secret new-ip-gateway packages: device_base: !include ../packages/device_base.yaml diff --git a/scripts/compile_all_devices.ps1 b/scripts/compile_all_devices.ps1 index 9233d26..17e2519 100644 --- a/scripts/compile_all_devices.ps1 +++ b/scripts/compile_all_devices.ps1 @@ -1,3 +1,17 @@ +Write-Output "`nBacking up build folder" +if (Test-Path $PSScriptRoot\..\build\_backup) +{ + Remove-Item -Path $PSScriptRoot\..\build\_backup -Recurse -Force +} +if (Test-Path $PSScriptRoot\..\_backup) +{ + Remove-Item -Path $PSScriptRoot\..\_backup -Recurse -Force +} +New-Item $PSScriptRoot\..\_backup -ItemType Directory | Out-Null +Move-Item -Path $PSScriptRoot\..\build\* -Destination $PSScriptRoot\..\_backup -Force +Move-Item -Path $PSScriptRoot\..\_backup -Destination $PSScriptRoot\..\build -Force + +Write-Output "`nCompiling all devices" $files = Get-ChildItem $PSScriptRoot\..\devices\*.yaml -Exclude "secrets.yaml" $failures = New-Object Collections.Generic.List[String] foreach ($file in $files) {