Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

169-bug-report-cannot-disable-myautomationh-after-enabling #172

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions ex_installer/ex_commandstation.py
Original file line number Diff line number Diff line change
Expand Up @@ -744,6 +744,29 @@ def current_override(self):
self.current_limit_label.grid_remove()
self.current_limit_entry.grid_remove()

def delete_config_files(self):
"""
Function to delete config files from product directory
needed on subsequent passes thru the logic
"""
file_list = []
local_repo_dir = pd[self.product]["repo_name"].split("/")[1]
product_dir = fm.get_install_dir(local_repo_dir)
min_list = fm.get_config_files(product_dir, pd[self.product]["minimum_config_files"])
if min_list:
file_list += min_list
other_list = None
if "other_config_files" in pd[self.product]:
other_list = fm.get_config_files(product_dir, pd[self.product]["other_config_files"])
if other_list:
file_list += other_list
self.log.debug("Deleting files: %s", file_list)
error_list = fm.delete_config_files(product_dir, file_list)
if error_list:
file_list = ", ".join(error_list)
self.process_error(f"Failed to delete one or more files: {file_list}")
self.log.error("Failed to delete: %s", file_list)

def generate_config(self):
"""
Function to validate options and return any errors
Expand All @@ -752,6 +775,7 @@ def generate_config(self):

Returns a tuple of (True|False, error_list|config_list)
"""
self.delete_config_files()
param_errors = []
config_list = []
if self.motor_driver_combo.get() == "Select motor driver":
Expand Down
1 change: 1 addition & 0 deletions ex_installer/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
- Update EX-CommandStation defaults for ESP32 to force enable WiFi and prevent disabling
- Add 132 x 64 OLED
- Add support for new DCC-EX EX-CSB1 - restricts motor driver selection
- Fix bug where a blank myAutomation.h file cannot be disabled after being enabled
0.0.18 - Update EX-Turntable configuration options to suit changes in 0.7.0
- Dependabot update for cryptography to 42.0.4
- Add link to DCC-EX News articles about EX-Installer to the Info menu
Expand Down
Loading