Skip to content

Fix motor maunall control at night#6

Merged
arghyabi merged 1 commit into
masterfrom
fix_motor_on_off_at_night
Sep 23, 2025
Merged

Fix motor maunall control at night#6
arghyabi merged 1 commit into
masterfrom
fix_motor_on_off_at_night

Conversation

@arghyabi
Copy link
Copy Markdown
Owner

No description provided.

@arghyabi arghyabi requested a review from Copilot September 23, 2025 03:01
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes motor manual control during night time by modifying the automatic motor control logic and updates valve pin assignments and scheduling.

  • Replaces automatic motor shutdown at night with a warning message, allowing manual control
  • Changes valve pin assignments from pins 36/37 to pins 11/13
  • Adds an afternoon 5PM valve operation schedule in addition to existing morning and evening runs

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
Scripts/PinDescription.py Updates valve pin assignments to new GPIO pins
Scripts/Main.py Modifies night-time motor control logic and adds afternoon valve schedule
Scripts/Common.py Adds AFTERNOON_5PM constant for new valve schedule

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment thread Scripts/Main.py Outdated
@arghyabi arghyabi force-pushed the fix_motor_on_off_at_night branch from a145f0d to bf7c823 Compare September 23, 2025 03:02
Signed-off-by: Arghya Biswas <arghyabiswas05@gmail.com>
@arghyabi arghyabi force-pushed the fix_motor_on_off_at_night branch from bf7c823 to bcf75be Compare September 23, 2025 03:03
@arghyabi arghyabi requested a review from Copilot September 23, 2025 03:04
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment thread Scripts/Main.py

# Evening valve operation
if now.hour == EVENING_8PM and not eveningRunDone:
if now.hour == NIGHT_9PM and not evening9RunDone:
Copy link

Copilot AI Sep 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The variable name 'evening9RunDone' is inconsistent with the timing. Since this runs at NIGHT_9PM (9 PM), it should be named 'night9RunDone' to match the actual execution time.

Copilot uses AI. Check for mistakes.
Comment thread Scripts/Main.py
gpio.output(MOTOR_PIN, False)
motorStatus = "OFF"
print("Night time: Motor OFF")
print("Night time: Automatic motor control disabled. Only manual control available!")
Copy link

Copilot AI Sep 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The motor is not explicitly turned off during night time. The previous logic ensured the motor was turned off with gpio.output(MOTOR_PIN, False), but this line only prints a message. This could leave the motor running automatically during night hours.

Suggested change
print("Night time: Automatic motor control disabled. Only manual control available!")
print("Night time: Automatic motor control disabled. Only manual control available!")
gpio.output(MOTOR_PIN, False)
motorStatus = "OFF"

Copilot uses AI. Check for mistakes.
@arghyabi arghyabi merged commit 32c9cb7 into master Sep 23, 2025
1 check passed
@arghyabi arghyabi deleted the fix_motor_on_off_at_night branch September 23, 2025 03:05
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.

2 participants