config: deprecate old configs
This commit is contained in:
parent
f3cacafd53
commit
b6199a4f24
@ -173,7 +173,7 @@ class KlipperScreenConfig:
|
|||||||
strs = (
|
strs = (
|
||||||
'moonraker_api_key', 'moonraker_host', 'titlebar_name_type',
|
'moonraker_api_key', 'moonraker_host', 'titlebar_name_type',
|
||||||
'screw_positions', 'power_devices', 'titlebar_items', 'z_babystep_values',
|
'screw_positions', 'power_devices', 'titlebar_items', 'z_babystep_values',
|
||||||
'extrude_distances', "extrude_speeds", "camera_url", "spoolman",
|
'extrude_distances', "extrude_speeds",
|
||||||
)
|
)
|
||||||
numbers = (
|
numbers = (
|
||||||
'moonraker_port', 'move_speed_xy', 'move_speed_z',
|
'moonraker_port', 'move_speed_xy', 'move_speed_z',
|
||||||
@ -184,17 +184,10 @@ class KlipperScreenConfig:
|
|||||||
numbers = [f'{option}' for option in config[section] if option != 'gcode']
|
numbers = [f'{option}' for option in config[section] if option != 'gcode']
|
||||||
elif section.startswith('menu '):
|
elif section.startswith('menu '):
|
||||||
strs = ('name', 'icon', 'panel', 'method', 'params', 'enable', 'confirm', 'style')
|
strs = ('name', 'icon', 'panel', 'method', 'params', 'enable', 'confirm', 'style')
|
||||||
elif section == 'bed_screws':
|
|
||||||
# This section may be deprecated in favor of moving this options under the printer section
|
|
||||||
numbers = ('rotation', '')
|
|
||||||
strs = ('screw_positions', '')
|
|
||||||
elif section.startswith('graph')\
|
elif section.startswith('graph')\
|
||||||
or section.startswith('displayed_macros')\
|
or section.startswith('displayed_macros')\
|
||||||
or section.startswith('spoolman'):
|
or section.startswith('spoolman'):
|
||||||
bools = [f'{option}' for option in config[section]]
|
bools = [f'{option}' for option in config[section]]
|
||||||
elif section.startswith('z_calibrate_position'):
|
|
||||||
# This section may be deprecated in favor of moving this options under the printer section
|
|
||||||
numbers = ('calibrate_x_position', 'calibrate_y_position')
|
|
||||||
else:
|
else:
|
||||||
self.errors.append(f'Section [{section}] not recognized')
|
self.errors.append(f'Section [{section}] not recognized')
|
||||||
|
|
||||||
@ -202,8 +195,11 @@ class KlipperScreenConfig:
|
|||||||
if key not in bools and key not in strs and key not in numbers:
|
if key not in bools and key not in strs and key not in numbers:
|
||||||
msg = f'Option "{key}" not recognized for section "[{section}]"'
|
msg = f'Option "{key}" not recognized for section "[{section}]"'
|
||||||
if key == "camera_url":
|
if key == "camera_url":
|
||||||
msg = "camera_url has been deprecated in favor of moonraker cameras"
|
msg = (
|
||||||
msg += "\n\n https://moonraker.readthedocs.io/en/latest/configuration/#webcam"
|
"camera_url has been deprecated in favor of moonraker cameras\n\n"
|
||||||
|
+ "https://moonraker.readthedocs.io/en/latest/configuration/#webcam\n\n"
|
||||||
|
+ "remove camera_url from KlipperScreen config file"
|
||||||
|
)
|
||||||
if remove:
|
if remove:
|
||||||
# This should only be called for the auto-generated section
|
# This should only be called for the auto-generated section
|
||||||
self.config.remove_option(section, key)
|
self.config.remove_option(section, key)
|
||||||
|
@ -80,9 +80,7 @@ class Panel(ScreenPanel):
|
|||||||
|
|
||||||
self.screws = new_screws
|
self.screws = new_screws
|
||||||
logging.info(f"screws with offset: {self.screws}")
|
logging.info(f"screws with offset: {self.screws}")
|
||||||
elif "bed_screws" in self._printer.get_config_section_list():
|
|
||||||
self.screws = self._get_screws("bed_screws")
|
|
||||||
logging.info(f"bed_screws: {self.screws}")
|
|
||||||
nscrews = len(self.screws)
|
nscrews = len(self.screws)
|
||||||
# KS config
|
# KS config
|
||||||
valid_positions = True
|
valid_positions = True
|
||||||
|
@ -147,10 +147,6 @@ class Panel(ScreenPanel):
|
|||||||
if self.ks_printer_cfg is not None:
|
if self.ks_printer_cfg is not None:
|
||||||
x_position = self.ks_printer_cfg.getfloat("calibrate_x_position", None)
|
x_position = self.ks_printer_cfg.getfloat("calibrate_x_position", None)
|
||||||
y_position = self.ks_printer_cfg.getfloat("calibrate_y_position", None)
|
y_position = self.ks_printer_cfg.getfloat("calibrate_y_position", None)
|
||||||
elif 'z_calibrate_position' in self._config.get_config():
|
|
||||||
# OLD global way, this should be deprecated
|
|
||||||
x_position = self._config.get_config()['z_calibrate_position'].getfloat("calibrate_x_position", None)
|
|
||||||
y_position = self._config.get_config()['z_calibrate_position'].getfloat("calibrate_y_position", None)
|
|
||||||
|
|
||||||
if self.probe:
|
if self.probe:
|
||||||
if "sample_retract_dist" in self.probe:
|
if "sample_retract_dist" in self.probe:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user