Add eveonline integration#166674
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a new eveonline Home Assistant integration that authenticates via Eve SSO (OAuth2 / application_credentials) and exposes Tranquility server status plus per-character telemetry as sensors and binary sensors.
Changes:
- Introduces the new
homeassistant.components.eveonlineintegration (OAuth2 config flow, coordinator, entities, sensors/binary_sensors, diagnostics, translations/icons, manifest/quality scale). - Adds comprehensive test coverage for config flow, setup/unload, entities, and diagnostics (including snapshots).
- Registers the integration across generated registries, strict typing/mypy settings, code ownership, and requirements lists.
Reviewed changes
Copilot reviewed 27 out of 30 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| homeassistant/components/eveonline/init.py | Sets up platforms and OAuth2 session/client wiring; forwards entry setups. |
| homeassistant/components/eveonline/api.py | Implements EveOnline auth adapter backed by HA OAuth2Session. |
| homeassistant/components/eveonline/application_credentials.py | Declares the Eve SSO authorization/token endpoints for application_credentials. |
| homeassistant/components/eveonline/binary_sensor.py | Adds server + character binary sensors backed by the coordinator. |
| homeassistant/components/eveonline/config_flow.py | Implements OAuth2 config flow, unique-id handling, reauth/reconfigure. |
| homeassistant/components/eveonline/const.py | Defines domain, OAuth endpoints, and required ESI scopes. |
| homeassistant/components/eveonline/coordinator.py | Polls ESI endpoints and aggregates server + character data. |
| homeassistant/components/eveonline/diagnostics.py | Provides diagnostics payload and redaction. |
| homeassistant/components/eveonline/entity.py | Defines base entities and device registry metadata. |
| homeassistant/components/eveonline/icons.json | Adds icon mappings for entities. |
| homeassistant/components/eveonline/manifest.json | Declares integration metadata, deps, requirements, and iot_class. |
| homeassistant/components/eveonline/quality_scale.yaml | Documents quality scale rule status for the new integration. |
| homeassistant/components/eveonline/sensor.py | Adds server + character sensors backed by the coordinator. |
| homeassistant/components/eveonline/strings.json | Adds translations for config flow, entity names, and exceptions. |
| homeassistant/generated/application_credentials.py | Registers eveonline as providing application credentials. |
| homeassistant/generated/config_flows.py | Registers eveonline as having a config flow. |
| homeassistant/generated/integrations.json | Adds eveonline integration metadata to generated registry. |
| tests/components/eveonline/init.py | Initializes the test package for the integration. |
| tests/components/eveonline/conftest.py | Provides fixtures for credentials, config entry, and mocked client responses. |
| tests/components/eveonline/test_binary_sensor.py | Validates binary sensor creation, state, and default-disabled behavior. |
| tests/components/eveonline/test_config_flow.py | Validates user flow, duplicate handling, reauth, and reconfigure. |
| tests/components/eveonline/test_diagnostics.py | Validates diagnostics output via snapshot testing. |
| tests/components/eveonline/test_init.py | Validates setup success and error paths, plus unload behavior. |
| tests/components/eveonline/test_sensor.py | Validates sensor values and unavailable states. |
| tests/components/eveonline/snapshots/test_diagnostics.ambr | Snapshot for diagnostics payload. |
| CODEOWNERS | Adds ownership for integration and its tests. |
| .strict-typing | Enforces strict typing for homeassistant.components.eveonline.*. |
| mypy.ini | Adds mypy strictness configuration for the integration package. |
| requirements_all.txt | Adds python-eveonline==0.2.1 to core requirements list. |
| requirements_test_all.txt | Adds python-eveonline==0.2.1 to test requirements list. |
|
Hi! Greetings from the Netherlands This is my first custom integration for Home Assistant, and I'm honestly pretty excited to share it. I've been playing Eve Online for years and using Home Assistant just as long, so combining the two felt like a fun project to work on. I've tried to stick closely to the contribution guidelines, pushed for full test coverage (38 tests), and addressed the review comments along the way. Hopefully that shows in the code. Here's how the integration looks in practice: Integration overview: shared Tranquility server device (3 entities) + per-character device (15 entities): Character device detail: all sensors and activity log: The icon shows "not available" because the brands PR (home-assistant/brands#10036) hasn't been merged yet. Character name redacted for privacy. Curious to hear what you think, and of course happy to iterate further. Thanks for taking a look! |
…s, snapshot tests, parametrize tests - Fix manifest.json: set integration_type to 'service' (not 'hub') - quality_scale.yaml: add missing Silver rule config-entry-unloading; fix reauthentication-flow to todo (no async_step_reauth in config_flow) - conftest.py: use CONF_CHARACTER_ID/CONF_CHARACTER_NAME constants; add init_integration fixture - test_sensor.py: use snapshot_platform for entity state testing; enable disabled entities before snapshot; add parametrized value test and unavailable sensor test - test_init.py: use init_integration fixture; merge 3 duplicate optional endpoint error tests into one parametrized test; add missing imports
- conftest.py: use .return_value = instead of AsyncMock(return_value=...) — autospec already creates AsyncMock for coroutine methods - sensor.py: remove redundant round() in wallet_balance value_fn; suggested_display_precision handles display rounding - quality_scale.yaml: add comment to todo rules (reauthentication-flow, diagnostics, reconfiguration-flow)
…rarchy - api.py: raise UpdateFailed (not ConfigEntryNotReady) for transient OAuth token errors so the coordinator can handle them gracefully during periodic updates - sensor.py: remove intermediate EveOnlineSensor base class; move native_value and entity_description directly into EveOnlineCharacterSensor - conftest.py: fix Generator return type annotation to full form Generator[AsyncMock, None, None] for strict mypy compliance - test_api.py: update assertions to expect UpdateFailed instead of ConfigEntryNotReady for transient errors
2b295d9 to
920f868
Compare
|
Note The sudden appearance of 45 commits in the timeline is an artifact of a forced rebase. The branch had a conflict in |
…ffline Replace the single EveOnlineCoordinator with four coordinators, each polling at the ESI server-side cache interval for its endpoints: - EveOnlineCoordinator (60 s): online, location, ship, wallet, mail - EveOnlineIndustryCoordinator (300 s): industry jobs, jump fatigue, skill queue - EveOnlineMarketCoordinator (3600 s): market orders - EveOnlineSkillsCoordinator (86400 s): skills / total SP This reduces ESI calls from 660/hour to ~410/hour when online. Additionally, location and ship are skipped entirely when the character is offline. Those values don't change while logged out, so the calls would only return stale cached data. This further reduces calls to ~230/hour when offline. All four coordinators do their first refresh in parallel via asyncio.gather so startup time is unchanged.
- Use asyncio.gather for parallel ESI calls in fast and industry coordinators (wallet+mail in parallel; location+ship in parallel when online; industry_jobs+jump_fatigue+skill_queue in parallel) - Remove ImplementationUnavailableError try/except from async_setup_entry and its unused strings.json translation key - Remove third-party configuration_url (evewho.com) from DeviceInfo - Fix entity-event-setup quality scale rule: should be exempt (uses DataUpdateCoordinator, no direct event subscription)
…lity - Fix docstrings: remove stale 'skill queue' references from EveOnlineCoordinator and EveOnlineCharacterSensor - Preserve last known location/ship when character is offline instead of resetting to None (sensors keep their previous state) - Remove trailing period from authentication_failed exception message per HA convention - Rename test_unavailable_sensor -> test_sensor_without_data_shows_unknown to match the asserted behavior (unknown, not unavailable) - Replace brittle OAuth URL string equality with URL parsing in config flow test so scope ordering and encoding do not cause false failures
- reconfiguration-flow: exempt — OAuth2-only, no user-configurable params - Fix Python 2 except syntax: except (ValueError, KeyError, jwt.DecodeError) - Remove stale ESI cache interval comment from FAST_SCAN_INTERVAL
|
Closing this PR. Will submit new PR with limited scope. Will adjust documentation PR |


Proposed change
Add a new integration for Eve Online, a massively multiplayer online game by CCP Games. This integration connects to the Eve Swagger Interface (ESI) API via OAuth2 (Eve SSO) to provide character data as sensors in Home Assistant.
The code has been written with the
platinumquality scale in mind (including strict typing, exception translations, icon translations, entity categories, and full test coverage), but the quality scale is set to bronze as required for new integrations.Entities
Character sensors (14):
The integration uses the python-eveonline library (v0.4.0) and implements OAuth2 via Application Credentials. It supports multiple characters and reconfiguration.
Type of change
Additional information
Checklist
ruff format homeassistant tests)If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
Updated and included derived files by running:
python3 -m script.hassfest.requirements_all.txt.Updated by running
python3 -m script.gen_requirements_all.To help with the load of incoming pull requests: