Add eveonline integration#166674
Conversation
Add a new integration for Eve Online (eveonline) that uses OAuth2 via EVE SSO application credentials to connect to the EVE Swagger Interface (ESI) API. Platform: sensor (16 sensors) - 2 server sensors: players online, server version - 14 character sensors: location, ship, wallet, skills, skill queue, mail, industry jobs, market orders, jump fatigue, and more Uses the python-eveonline library (v0.2.1) for all ESI API communication. Quality scale: bronze.
Add binary_sensor platform with 2 sensors: - Character online (connectivity device class) - Server VIP mode (diagnostic, disabled by default) Also adds corresponding tests and translations.
- Add loggers to manifest.json - Add PARALLEL_UPDATES = 0 to sensor and binary_sensor platforms - Implement reauthentication flow (reauth_confirm step + OAuth2) - Implement reconfiguration flow - Add exception translations (authentication_failed, update_failed, oauth2_implementation_unavailable) - Create diagnostics.py with redacted config entry data - Create icons.json with mdi icons for all entities - Add strict typing to .strict-typing - Update quality_scale.yaml: all rules done or exempt - Update manifest quality_scale to platinum - Add tests: reauth, reauth mismatch, reconfigure, diagnostics, auth error - 18 tests passing
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. |
- test_config_flow: JWT decode errors (invalid, malformed, missing subject) - test_config_flow: reconfigure account mismatch - test_init: network error during setup (aiohttp.ClientError) - test_init: optional endpoint graceful degradation (EveOnlineError, ClientError) - test_init: auth error propagation from optional endpoints - test_init: list endpoint error returns empty lists Total tests: 27 (was 18)
|
Hi @joostlek, thanks for the review! Here's a summary of everything that has been addressed with less complexity in mind: Your review comments
Additional fixes (from Copilot review + testing)
The docs PR is updated separately to remove the server sensors section. |
…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
|
|
||
|
|
||
| @pytest.fixture | ||
| def mock_eveonline_client() -> Generator[AsyncMock]: |
There was a problem hiding this comment.
Fix the fixture return type annotation to use the full Generator[YieldType, SendType, ReturnType] form (e.g., Generator[AsyncMock, None, None]) to satisfy strict typing and avoid mypy errors.
| def mock_eveonline_client() -> Generator[AsyncMock]: | |
| def mock_eveonline_client() -> Generator[AsyncMock, None, None]: |
- 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)
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: