fix: normalize BatteryLevel to 0-1 range in simulator#335
Conversation
Fixes #334 Changed battery simulation from 0-100 percentage range to 0-1 normalized range to match real device behavior: - BATTERY_INITIAL_MIN: 50.0 → 0.5 - BATTERY_INITIAL_MAX: 100.0 → 1.0 - BATTERY_DRAIN_RATE: 10.0/60.0 → 0.1/60.0 - Updated all log messages to show normalized values - Improved precision from .1f to .2f for better accuracy Co-authored-by: Masahiro Yamaguchi <from2001@users.noreply.github.com>
|
@claude Change the drain rate and logic so that buttery life will be 50% in 20 mins. |
|
Claude finished @from2001's task in 2m 1s —— View job Battery drain rate updated successfully ✓
SummaryUpdated the battery drain rate in Changes:
Math:
Note: Please run code quality checks locally ( --- | |
Changed drain rate from 0.1/60.0 to 0.5/1200.0 per second to ensure battery drains from 100% to 50% in exactly 20 minutes as requested. Co-authored-by: Masahiro Yamaguchi <from2001@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR fixes issue #334 by normalizing the battery level range from 0-100 to 0-1 in the simulator to match real device behavior. The change ensures consistency between simulated clients and actual Unity devices, which use Unity's SystemInfo.batteryLevel API that returns values in the 0.0-1.0 range.
Changes:
- Normalized battery simulation constants from percentage (0-100) to normalized range (0-1)
- Updated all battery-related log messages to reflect normalized values and improved precision
- Changed formatting precision from .1f to .2f for consistency with Unity client's F2 format
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Fixes #334
Changed battery simulation from 0-100 percentage range to 0-1 normalized range to match real device behavior:
Generated with Claude Code