-
Notifications
You must be signed in to change notification settings - Fork 0
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
16.set schedule timers #51
base: dev
Are you sure you want to change the base?
Conversation
Deleted connect to device
Deleted connect to device
Deleted connect to device
Deleted connect to device
Deleted conect to device
…_class 27.create weatherstation class
Update LawnMower.py
Rozpiszę to co omawialiśmy sobie podczas zajęć w trochę zmienionej formie.
Klasa
a także metody
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Czemu usunęłaś te wszystkie pliki?
self.turn_off_time = turn_off_time ("%Y-%m-%d-%H-%M") | ||
self.working_duration = working_duration("%M") | ||
self.current_time = current_time | ||
self.task_list = task_list |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wydaje mi się, że task_list
domyślnie powinien być pustą listą, raczej nie ma sensu tworzyć nowego Schedulera już z taskami.
self.turn_on_time = turn_on_time ("%Y-%m-%d-%H-%M") | ||
self.turn_off_time = turn_off_time ("%Y-%m-%d-%H-%M") | ||
self.working_duration = working_duration("%M") | ||
self.current_time = current_time |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Po co zapisywać obecny czas?
self.turn_on_time = turn_on_time ("%Y-%m-%d-%H-%M") | ||
self.turn_off_time = turn_off_time ("%Y-%m-%d-%H-%M") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Nie widzę tu tych funkcji
turn_on_time
iturn_off_time
, więc nie wiem, co miałoby być wywoływane. - Moim zdaniem, tu wystarczy jeden atrybut,
change_time
i drugi, który będzie enumem, mówiący nam co trzeba zrobić, czylichange_action
.
def __init__(self, turn_on_time, turn_off_time, working_duration, current_time = str(datetime.now()), task_list = []): | ||
self.turn_on_time = turn_on_time ("%Y-%m-%d-%H-%M") | ||
self.turn_off_time = turn_off_time ("%Y-%m-%d-%H-%M") | ||
self.working_duration = working_duration("%M") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Biorąc pod uwagę komentarz wyżej, ten atrybut też jest niepotrzebny.
self.current_time = current_time | ||
self.task_list = task_list | ||
|
||
def load_devices(self) -> Dict[str, Any]: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Masz już funkcję load_devices
w ui_terminal.py
, nie powinnaś jej kopiować, tylko zaimportować.
https://www.geeksforgeeks.org/dont-repeat-yourselfdry-in-software-development/
print("Error reading the file.") | ||
return {"devices": []} | ||
|
||
def print_devices(self, devices_data: Dict[str, Any]) -> None: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
jw.
Class for scheduling working time
Methods:
Checking list of tasks and turnong-on/ -off devices