Skip to content

v1.2.0 - Level 2: Players, Scores & Metadata

Choose a tag to compare

@seanmccabe seanmccabe released this 10 Jan 11:49
3b3457c

v1.2.0 - Level 2: Players, Scores & Metadata

This beta release marks a major architectural improvement for the BGG Sync integration, migrating the core network layer to be fully asynchronous. This ensures better stability, performance, and compliance with Home Assistant's architectural standards.

🚀 Key Changes

  • Last Sync Sensor: Added a diagnostic sensor (bgg_last_sync) to track the timestamp of the last successful data fetch.
  • Force Sync Button: Added a diagnostic button to force a BGG sync.
  • Plays Sensor Attributes: The last_play attribute is now "flattened" into top-level attributes on the Plays sensor:
    • game
    • bgg_id
    • date
    • comment (Cleaned of BBCode)
    • expansions (Extracted from comment text)
    • winners
    • players
    • image (Fetched from game metadata if available)
    • NOTE: The original nested last_play attribute dictionary has been removed.
  • String Localization: Added friendly localised names for the services.
  • Player Details in Recording: The record_play service now supports passing player names and winners to BoardGameGeek.

Fixed

  • Clean Attribute Text: Fixed issue where BGG BBCode tags (e.g. [thing=...]) were appearing in sensor attributes (last play comments).
  • Cleaned Up: Improved code comments and removed unused imports.
  • Service Stability: Moved blocking legacy recording logic into an executor job to maintain Home Assistant performance standards while ensuring session persistence.

Async Migration

  • Performance: Switched all network I/O from the blocking requests library to aiohttp. This prevents the integration from blocking the Home Assistant event loop during API calls, which is critical for system stability.
  • Dependency Cleanup: Removed the hard dependency on requests, making the integration lighter.
  • Modernisation: Updated all service calls and sensor updates to fully utilise proper async/await patterns.

🛠️ Technical Improvements

Test Suite Overhaul

  • Thread Safety: Completely refactored the test suite to use isolated AsyncMock patterns for client sessions. This permanently resolves the "Lingering Thread" errors that were plaguing the test suite.
  • Mocking: Removed aioclient_mock in favour of pure Python mocks for granular control over connection behaviour in tests.
  • Stability: The test suite passes 100% cleanly (55 tests) with no warnings or errors.

Code Quality

  • Assertions: Fixed logic assertions in configuration flow to accurately reflect error handling behaviours.