Skip to content

Fix manual motor control on off#12

Merged
arghyabi merged 1 commit into
masterfrom
fix_manual_motor_control
Sep 26, 2025
Merged

Fix manual motor control on off#12
arghyabi merged 1 commit into
masterfrom
fix_manual_motor_control

Conversation

@arghyabi
Copy link
Copy Markdown
Owner

No description provided.

@arghyabi arghyabi requested a review from Copilot September 26, 2025 19:30
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 refactors database write operations and fixes timing configurations for motor control operations. The changes improve efficiency by only writing to the database when there are actual changes and consolidate the write logic.

  • Refactored writeRtDb function to use **kwargs and only write when there are changes
  • Modified valve operation timing schedules
  • Reduced check interval from 5 seconds to 0.5 seconds for more responsive monitoring

Reviewed Changes

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

File Description
Scripts/Utility.py Simplified writeRtDb function to use kwargs and conditional writing
Scripts/Main.py Updated timing logic, improved database update efficiency, and added debug logging
Scripts/Common.py Reduced check interval for more frequent monitoring

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

Comment thread Scripts/Main.py

waterLevel = TANK_HEIGHT - distance
motorStatus = rtDb.get("motorStatus", "OFF")
print(f"!!!! Motor Status {motorStatus}; Config Update Available: {configUpdateAvailable} !!!!")
Copy link

Copilot AI Sep 26, 2025

Choose a reason for hiding this comment

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

This debug print statement with excessive exclamation marks appears to be temporary debugging code that should be removed or converted to proper logging before production.

Copilot uses AI. Check for mistakes.
Signed-off-by: Arghya Biswas <arghyabiswas05@gmail.com>
@arghyabi arghyabi force-pushed the fix_manual_motor_control branch from 0381296 to faa6710 Compare September 26, 2025 19:31
@arghyabi arghyabi merged commit eac1a2f into master Sep 26, 2025
1 check passed
@arghyabi arghyabi deleted the fix_manual_motor_control branch September 26, 2025 19:31
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