Skip to content

Fix simulator compatibility: string identity comparison, missing Timer import, unawaited coroutine#68

Merged
lincoltd7 merged 6 commits intomainfrom
copilot/improve-simulator-usability
Feb 28, 2026
Merged

Fix simulator compatibility: string identity comparison, missing Timer import, unawaited coroutine#68
lincoltd7 merged 6 commits intomainfrom
copilot/improve-simulator-usability

Conversation

Copy link
Contributor

Copilot AI commented Feb 27, 2026

  • Fix is== for string comparison in find_hexdrive_app
  • Make machine.Timer import optional with graceful fallback to None
  • Fix RuntimeWarning: coroutine '_gain_focus' was never awaited: use asyncio.get_event_loop().create_task() instead of asyncio.create_task(), which works even when no event loop is currently running (e.g. in smoke tests / synchronous contexts)
  • CodeQL security check passed (0 alerts)
Original prompt

This section details on the original issue you should resolve

<issue_title>Badge is not very usable in the simulator</issue_title>
<issue_description>due to the app looking for a hexpantion and prompting to program it via eeprom, you cant then get to testing out the menus in the sim.</issue_description>

<agent_instructions>please aim to make minimal edits, changes should mainly aim to improve the usability of the app when used in the simulator with little impact when used on real badge hardware.</agent_instructions>

Comments on the Issue (you are @copilot in this section)

@lincoltd7 maybe we need some way to skip the expansion erprom prompt to get to the menus.

🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.

Co-authored-by: lincoltd7 <117526452+lincoltd7@users.noreply.github.com>
Copilot AI changed the title [WIP] Improve badge usability in simulator Skip EEPROM programming prompt when running in the simulator Feb 27, 2026
Co-authored-by: lincoltd7 <117526452+lincoltd7@users.noreply.github.com>
Copilot AI changed the title Skip EEPROM programming prompt when running in the simulator Fix simulator compatibility: SyntaxWarning and Timer ImportError Feb 28, 2026
Copilot AI and others added 2 commits February 28, 2026 13:47
Co-authored-by: lincoltd7 <117526452+lincoltd7@users.noreply.github.com>
…ne call in __init__

Co-authored-by: lincoltd7 <117526452+lincoltd7@users.noreply.github.com>
Copilot AI changed the title Fix simulator compatibility: SyntaxWarning and Timer ImportError Fix simulator compatibility: string identity comparison, missing Timer import, unawaited coroutine Feb 28, 2026
@lincoltd7 lincoltd7 marked this pull request as ready for review February 28, 2026 14:43
@lincoltd7 lincoltd7 requested a review from Copilot February 28, 2026 14:43
@lincoltd7 lincoltd7 requested a review from Robotmad February 28, 2026 14:46
Copy link

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

Improves BadgeBotApp compatibility in the badge simulator by removing simulator-only runtime failures and warnings, while keeping behavior on real badge hardware effectively unchanged.

Changes:

  • Fixes incorrect string identity comparison (is==) when locating the HexDrive app.
  • Makes machine.Timer import optional and disables timer-driven stepping when unavailable (simulator).
  • Skips EEPROM “programming needed” flow in the simulator when no real EEPROM hardware exists.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

…eate_task()

Co-authored-by: lincoltd7 <117526452+lincoltd7@users.noreply.github.com>
Copy link
Contributor

@Robotmad Robotmad left a comment

Choose a reason for hiding this comment

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

good progress

@lincoltd7 lincoltd7 merged commit fa2c5de into main Feb 28, 2026
1 check passed
@lincoltd7 lincoltd7 deleted the copilot/improve-simulator-usability branch February 28, 2026 15:04
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.

Badge is not very usable in the simulator

4 participants