-
Notifications
You must be signed in to change notification settings - Fork 514
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
solution #488
base: master
Are you sure you want to change the base?
solution #488
Conversation
serhiik05
commented
Jan 9, 2025
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.
Great job on implementing the asynchronous functionalities and optimizing the performance using asyncio
! 🎉 The code meets the task requirements effectively. While there are minor suggestions for restructuring the wake_up_program
and sleep_program
to ensure logical execution order, these do not impact the core functionality. Keep up the good work and consider these improvements for future enhancements! 😊
✨ Please rate this review in the Platform's notification center. I will be grateful for your feedback! ✨
wake_up_program = [ | ||
Message(hue_light_id, MessageType.SWITCH_ON), | ||
Message(speaker_id, MessageType.SWITCH_ON), | ||
Message(speaker_id, MessageType.PLAY_SONG, "Rick Astley - Never Gonna Give You Up"), | ||
] |
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.
The wake_up_program
should be restructured to use run_sequence
and run_parallel
to ensure logical execution order. For example, switch on the speaker before playing music.
sleep_program = [ | ||
Message(hue_light_id, MessageType.SWITCH_OFF), | ||
Message(speaker_id, MessageType.SWITCH_OFF), | ||
Message(toilet_id, MessageType.FLUSH), | ||
Message(toilet_id, MessageType.CLEAN), | ||
] |
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.
The sleep_program
should be restructured to use run_sequence
and run_parallel
to ensure logical execution order. For example, flush the toilet before cleaning.
# run the programs | ||
await (service.run_parallel(*wake_up_program)) | ||
await (service.run_sequence(*sleep_program)) |
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.
Replace the current program execution with a combination of run_sequence
and run_parallel
to maintain logical order while optimizing performance.