-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #194 from AndreWohnsland/dev
Make migrator always respect local config
- Loading branch information
Showing
19 changed files
with
108 additions
and
65 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,27 @@ | ||
from src.config.config_manager import CONFIG as cfg | ||
from src.machine.interface import PinController | ||
from src.utils import time_print | ||
|
||
|
||
class Reverter: | ||
def __init__(self, pin_controller: PinController): | ||
def __init__(self, pin_controller: PinController, use_reversion: bool, revert_pin: int): | ||
self._pin_controller = pin_controller | ||
# only init if reversion is enabled, otherwise it may be an invalid pin | ||
self.revert_pin = cfg.MAKER_REVERSION_PIN | ||
self.use_reversion = use_reversion | ||
self.revert_pin = revert_pin | ||
|
||
def initialize_pin(self): | ||
if cfg.MAKER_PUMP_REVERSION: | ||
if self.use_reversion: | ||
time_print(f"Initializing Reversion Pin: {self.revert_pin}") | ||
self._pin_controller.initialize_pin_list([self.revert_pin]) | ||
|
||
def revert_on(self): | ||
"""Reverts the pump to be inverted.""" | ||
if not cfg.MAKER_PUMP_REVERSION: | ||
if not self.use_reversion: | ||
return | ||
self._pin_controller.activate_pin_list([self.revert_pin]) | ||
|
||
def revert_off(self): | ||
"""Disables the reversion pin.""" | ||
if not cfg.MAKER_PUMP_REVERSION: | ||
if not self.use_reversion: | ||
return | ||
self._pin_controller.close_pin_list([self.revert_pin]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.