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

solution #488

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

solution #488

wants to merge 1 commit into from

Conversation

serhiik05
Copy link

Screenshot 2025-01-09 at 16 05 39

Copy link

@mateacademy-ai-mentor mateacademy-ai-mentor left a 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! ✨

Comment on lines +24 to +28
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"),
]

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.

Comment on lines +30 to +35
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),
]

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.

Comment on lines +37 to +39
# run the programs
await (service.run_parallel(*wake_up_program))
await (service.run_sequence(*sleep_program))

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants