Skip to content

v2.4.16

Choose a tag to compare

@AndrewTapp AndrewTapp released this 31 Mar 13:38
· 194 commits to main since this release
4cbdd34

Changes — 2026-03-31 — v2.4.16

Summary of work completed for this release (documentation, logging, file-descriptor handling verification, and optimizer entity naming).

1. Per-optimizer entity IDs and friendly names (sensor platform)

  • SolarEdgeOptimizersSensor: Set _attr_has_entity_name = False so Home Assistant does not prepend the optimizer device slug to entity_id (fixes patterns like sensor.optimizer_1_1_1_power_1_1_1 in favour of path-based ids such as sensor.power_1_1_1).
  • async_added_to_hass: Builds _attr_name from loaded translations: per-sensor label (entity.sensor.<slug>.name) plus template entity.sensor.optimizer_sensor.name ({sensor_type} {optimizer_display}).
  • _set_optimizer_identity: Stores _sensor_translation_slug; _attr_translation_key is None for optimizers because the composite name replaces the short translation-key name behaviour.
  • Debug: When debug logging is enabled, logs optimizer friendly name, display string, slug, and internal_integration_suggested_object_id after the name is set.

2. Translations

  • Added entity.sensor.optimizer_sensor with name: "{sensor_type} {optimizer_display}" to:
    • strings.json
    • All translations/*.json locale files (cs, da, de, el, en, es, fi, fr, hu, it, ja, nb, nl, pl, pt, ru, sv, tr, zh).

3. File descriptors and API cleanup (verified; no behavioural change required)

  • Dual API (api_dual.py): close() closes both One and legacy clients; exceptions on one side are logged; the other client is still closed.
  • Legacy (solaredgeoptimizers.py): Thread-local sessions tracked in _all_sessions; HTTP uses with session.request(...); close() iterates and session.close() on all tracked sessions.
  • SolarEdge One (solaredge_one_api.py): Routine requests.get/post use response context managers; OAuth uses with Session(); close() clears tokens and sets _closed.
  • Entry lifecycle (__init__.py, config_flow.py): api.close() on setup failure, unload, and async_remove_entry so descriptors are released even if platform unload fails.

4. Debug logging (documentation alignment)

  • README.md, info.md, docs/Wiki-Home.md: Debug bullet lists updated to include per-optimizer async_added_to_hass name/suggested_object_id logging.

5. Code quality (CodeFactor / repo standards)

  • Project rules remain: .pylintrc — max-args=10, max-module-lines=2000, max-line-length=159; setup.cfg — pycodestyle max-line-length=159.
  • New code follows guarded debug logging and stays within line-length limits for the touched modules.

6. Module and user documentation

  • __init__.py: Module docstring extended with sensor has_entity_name / optimizer_sensor behaviour.
  • coordinator.py: Note pointing to sensor.py for per-optimizer entity naming.
  • README.md: Hierarchy / entity ID section; aggregated vs per-optimizer naming; debug log paragraph.
  • info.md: Entity ID / naming and debug paragraphs.
  • docs/Wiki-Home.md: Entity IDs, entity names, troubleshooting row for duplicate device+path entity ids, debug coverage paragraph.
  • docs/SolarEdge-One-API-Summary.md: Bullet on optimizer entity IDs (One vs legacy same sensor behaviour).
  • docs/internationalization.md: optimizer_sensor template and per-optimizer naming.

7. Version

  • manifest.json: version set to 2.4.16.

Existing installs: unique_id is unchanged; entity registry may keep previous entity_id until entities are recreated. New installs or reloads that recreate entities get the updated id pattern.


Follow-up (same release): short optimizer friendly names only

Per-optimizer friendly names were changed from "{sensor_type} {optimizer_display}" (e.g. “Azimuth 2065855.1.1.2”) to only the translated sensor label (e.g. “Azimuth”): async_added_to_hass sets _attr_name to the resolved entity.sensor.<slug>.name string. The device name still shows the optimizer position. The unused entity.sensor.optimizer_sensor key was removed from strings.json and all translations/*.json files.

What's Changed

Full Changelog: 2.4.15...2.4.16