Skip to content

Add Eve Online integration#168143

Open
ronaldvdmeer wants to merge 32 commits intohome-assistant:devfrom
ronaldvdmeer:feat/eveonline-core-sensors
Open

Add Eve Online integration#168143
ronaldvdmeer wants to merge 32 commits intohome-assistant:devfrom
ronaldvdmeer:feat/eveonline-core-sensors

Conversation

@ronaldvdmeer
Copy link
Copy Markdown
Contributor

@ronaldvdmeer ronaldvdmeer commented Apr 13, 2026

Proposed change

Adds a new Eve Online integration using OAuth2 (CCP ESI API). The integration provides three sensor entities per character:

  • Wallet balance: ISK balance (measurement sensor, 2 decimal precision)
  • Location: current solar system name (optional, degrades gracefully)
  • Ship: current ship type (optional, degrades gracefully)

Uses a single DataUpdateCoordinator polling at 60-second intervals. The wallet endpoint is the primary — a failure marks all entities unavailable. Location and ship failures are logged at debug level only.

Required OAuth2 scopes:

  • esi-location.read_location.v1
  • esi-location.read_ship_type.v1
  • esi-wallet.read_character_wallet.v1

Related PRs:

Dependency libary changelog: https://github.com/ronaldvdmeer/python-eveonline/releases/tag/v0.4.0

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New integration (thank you!)
  • New feature (which adds functionality to an existing integration)
  • Deprecation (breaking change to happen in the future)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Additional information

Checklist

  • I understand the code I am submitting and can explain how it works.
  • The code change is tested and works locally.
  • Local tests pass. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.
  • I have followed the development checklist
  • I have followed the perfect PR recommendations
  • The code has been formatted using Ruff (ruff format homeassistant tests)
  • Tests have been added to verify that the new code works.
  • Any generated code has been carefully reviewed for correctness and compliance with project standards.

If user exposed functionality or configuration variables are added/changed:

If the code communicates with devices, web services, or third-party tools:

  • The manifest file has all fields filled out correctly.
    Updated and included derived files by running: python3 -m script.hassfest.
  • New or updated dependencies have been added to requirements_all.txt.
    Updated by running python3 -m script.gen_requirements_all.
  • For the updated dependencies a diff between library versions and ideally a link to the changelog/release notes is added to the PR description.

Adds an Eve Online integration using OAuth2 (CCP ESI API) that provides
three sensor entities per character:

- Status: online/offline (ENUM sensor with translated states)
- Wallet balance: ISK balance (MEASUREMENT sensor, 2 decimal precision)
- Location: current solar system name

Uses a single DataUpdateCoordinator polling at 60-second intervals.
Optional endpoints (wallet, location) degrade gracefully — the coordinator
only fails hard when the character online status endpoint is unavailable.

Required OAuth2 scopes:
- esi-location.read_location.v1
- esi-location.read_online.v1
- esi-wallet.read_character_wallet.v1
- Strip to 3 sensors: wallet_balance (primary), location, ship
- Remove PARALLEL_UPDATES (Silver-level)
- Remove exception translations and icons.json (Gold-level)
- Remove online sensor (would require binary_sensor platform)
- Add ship sensor with esi-location.read_ship_type.v1 scope
- Mark all Bronze quality scale rules as done
Copy link
Copy Markdown
Contributor

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

Adds a new Home Assistant eveonline integration that authenticates via OAuth2 (EVE SSO / CCP ESI) and exposes character wallet/location/ship as sensors.

Changes:

  • Introduces the eveonline integration (config flow, application credentials support, coordinator, entities, sensors, and translations).
  • Adds a full test suite for config flow, setup/unload behavior, coordinator/auth helpers, and sensor snapshots.
  • Registers the integration in generated metadata and adds the python-eveonline==0.4.0 dependency to requirements files.

Reviewed changes

Copilot reviewed 21 out of 24 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
homeassistant/components/eveonline/__init__.py Sets up OAuth2 session, client, coordinator, and forwards sensor platform setup.
homeassistant/components/eveonline/api.py Adds config-entry-bound auth helper for the upstream client.
homeassistant/components/eveonline/application_credentials.py Declares the EVE SSO authorization server endpoints for Application Credentials.
homeassistant/components/eveonline/config_flow.py Implements OAuth2 config flow and derives character identity from the JWT access token.
homeassistant/components/eveonline/const.py Defines domain constants, OAuth endpoints, and required scopes.
homeassistant/components/eveonline/coordinator.py Polls wallet/location/ship via a DataUpdateCoordinator, treating wallet as the primary endpoint.
homeassistant/components/eveonline/entity.py Provides shared device/unique-id behavior for character entities.
homeassistant/components/eveonline/sensor.py Adds three sensor entities backed by coordinator data.
homeassistant/components/eveonline/strings.json Adds config flow and entity name strings.
homeassistant/components/eveonline/manifest.json Declares the new integration and dependency.
homeassistant/components/eveonline/quality_scale.yaml Sets initial quality scale statuses for the new integration.
tests/components/eveonline/* + snapshots Adds fixtures and tests for config flow, setup, auth helper, and sensor behavior.
requirements_all.txt / requirements_test_all.txt Adds python-eveonline==0.4.0.
homeassistant/generated/* Registers the new integration for config flows/application credentials/integrations metadata.
CODEOWNERS Assigns ownership for the new integration and its tests.

Comment thread tests/components/eveonline/test_sensor.py
Comment thread homeassistant/components/eveonline/quality_scale.yaml
Comment thread homeassistant/components/eveonline/quality_scale.yaml Outdated
…cale

- Add freezer.tick(61) in test_sensor_wallet_updated so the coordinator
  update interval is exceeded before firing the time changed event
- Add PR links to brands and docs quality scale entries to clarify
  that both PRs are already submitted
- Combine solar system and ship type resolve_names calls into one
  API call for efficiency
- Show ship type name (e.g. 'Flycatcher') instead of the
  player-assigned ship name (e.g. 'i.probe')
Copilot AI review requested due to automatic review settings April 13, 2026 23:34
Copy link
Copy Markdown
Contributor

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 21 out of 24 changed files in this pull request and generated 2 comments.

Comment thread homeassistant/components/eveonline/config_flow.py
Comment thread homeassistant/components/eveonline/quality_scale.yaml Outdated
async_unload_entry is implemented and tested in test_init.py
…en-unavailable as done

- integration-owner: codeowners already set in manifest.json
- entity-unavailable: CoordinatorEntity handles this automatically
- log-when-unavailable: DataUpdateCoordinator logs this automatically
Copilot AI review requested due to automatic review settings April 14, 2026 05:55
Copy link
Copy Markdown
Contributor

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 21 out of 24 changed files in this pull request and generated 2 comments.

Comment thread tests/components/eveonline/test_sensor.py Outdated
Comment thread tests/components/eveonline/test_sensor.py Outdated
- test_sensor_location_unavailable_when_endpoint_fails
  -> test_sensor_location_shows_unknown_when_endpoint_fails
- test_sensor_ship_unavailable_when_endpoint_fails
  -> test_sensor_ship_shows_unknown_when_endpoint_fails
@ronaldvdmeer ronaldvdmeer marked this pull request as ready for review April 14, 2026 06:47
Copilot AI review requested due to automatic review settings April 14, 2026 06:47
Copy link
Copy Markdown
Contributor

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 21 out of 24 changed files in this pull request and generated 1 comment.

Comment thread homeassistant/components/eveonline/__init__.py Outdated
Copy link
Copy Markdown
Member

@erwindouna erwindouna left a comment

Choose a reason for hiding this comment

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

Thanks for adding a new integration, @ronaldvdmeer. Here's an initial review.

Comment thread homeassistant/components/eveonline/coordinator.py
Comment thread homeassistant/components/eveonline/coordinator.py
Comment thread homeassistant/components/eveonline/entity.py
Comment thread tests/components/eveonline/test_api.py Outdated
Comment thread tests/components/eveonline/test_config_flow.py
Copy link
Copy Markdown
Member

@erwindouna erwindouna left a comment

Choose a reason for hiding this comment

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

I think you're progressing very well and we're almost nearing completion here, if you'd ask me. Just a few minor details. :)

Comment thread tests/components/eveonline/test_config_flow.py Outdated
Comment thread tests/components/eveonline/test_sensor.py Outdated
Comment thread tests/components/eveonline/test_sensor.py Outdated
@home-assistant home-assistant Bot marked this pull request as draft April 17, 2026 20:06
Per review by erwindouna: reuse result rather than introducing result2/state2
in tests that run two flows sequentially.
Copilot AI review requested due to automatic review settings April 17, 2026 20:17
Per review by erwindouna: use the STATE_UNAVAILABLE constant instead
of the hardcoded string literal.
Per review by erwindouna: use the STATE_UNKNOWN constant instead
of the hardcoded string literal.
@ronaldvdmeer ronaldvdmeer marked this pull request as ready for review April 17, 2026 20:18
@home-assistant home-assistant Bot requested a review from erwindouna April 17, 2026 20:19
Copy link
Copy Markdown
Contributor

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 20 out of 23 changed files in this pull request and generated no new comments.

- model: 'Character' — consistent label for all character devices
- configuration_url: evewho.com profile link for the character
@ronaldvdmeer
Copy link
Copy Markdown
Contributor Author

I noticed the device_info was not yet fully populated. I took the liberty of completing it in c5bea38

Copilot AI review requested due to automatic review settings April 19, 2026 22:01
@ronaldvdmeer
Copy link
Copy Markdown
Contributor Author

I think you're progressing very well and we're almost nearing completion here, if you'd ask me. Just a few minor details. :)

Thanks a lot, really appreciate that. Glad to hear we’re getting close now. I’ve taken care of the remaining minor details so we can hopefully get this over the finish line soon. 👍

Copy link
Copy Markdown
Contributor

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 20 out of 23 changed files in this pull request and generated 1 comment.

Comment thread homeassistant/components/eveonline/quality_scale.yaml Outdated
OAuth2-only integration; the EVE SSO token exchange is the only
pre-configure step possible. No traditional connectivity test can be
performed before the OAuth round-trip completes.
Copilot AI review requested due to automatic review settings April 26, 2026 00:23
Copy link
Copy Markdown
Contributor

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 20 out of 23 changed files in this pull request and generated no new comments.

@ronaldvdmeer
Copy link
Copy Markdown
Contributor Author

The PR was still green on the 26 of April, so this looks more like newer core/CI behavior exposing the missing reauth path than a new review requirement. The integration already raises ConfigEntryAuthFailed, so core starts reauth automatically, and that now fails because the flow does not implement reauth yet.

Copilot AI review requested due to automatic review settings May 2, 2026 20:02
@ronaldvdmeer
Copy link
Copy Markdown
Contributor Author

I’ve now implemented the missing reauth path instead of broadening the scope: the OAuth flow now supports reauth, updates the existing config entry on success, and aborts if a different character is returned.

That matches the existing HA OAuth pattern and fixes the current failure mode directly, since the integration was already raising ConfigEntryAuthFailed and core was already trying to start reauth. I also added focused flow tests for both successful reauth and character mismatch.

Copy link
Copy Markdown
Contributor

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 20 out of 23 changed files in this pull request and generated 1 comment.

Comment thread homeassistant/components/eveonline/sensor.py
@ronaldvdmeer
Copy link
Copy Markdown
Contributor Author

ronaldvdmeer commented May 2, 2026

@erwindouna See my 2 comments and the commit. Triggered by a dev branch merge.

#168143 (comment) and #168143 (comment) and as an result: 50e32ce

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants