From 70e19deabefafa6403afbeb36b06b7206f79942a Mon Sep 17 00:00:00 2001 From: Daniel Raper Date: Sat, 25 Jan 2025 21:46:47 +0000 Subject: [PATCH 1/4] Add issue to point to core integration --- README.md | 8 ++++++++ custom_components/ohme/__init__.py | 15 +++++++++++++-- custom_components/ohme/translations/en.json | 7 ++++++- 3 files changed, 27 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 7f0f6b1..fd9dc72 100644 --- a/README.md +++ b/README.md @@ -8,6 +8,14 @@ For the core version of the integration, please raise any issues and pull reques Thank you to the community that has formed around this integration, and I hope you can appreciate this important and necessary evolution of the integration. +### Migrating +To migrate from the custom component to the core version: +1. Ensure you are running an up to date version of Home Assistant +2. Delete your Ohme account from the Home Assistant Devices & services page +3. Uninstall the custom component. If you installed through HACS, you can do this through the UI +4. Restart Home Assistant +5. Configure the core Ohme integration +

# Ohme EV Charger for Home Assistant diff --git a/custom_components/ohme/__init__.py b/custom_components/ohme/__init__.py index 38e2867..e6dabc7 100644 --- a/custom_components/ohme/__init__.py +++ b/custom_components/ohme/__init__.py @@ -6,6 +6,7 @@ from .api_client import OhmeApiClient from .coordinator import OhmeChargeSessionsCoordinator, OhmeAccountInfoCoordinator, OhmeAdvancedSettingsCoordinator, OhmeChargeSchedulesCoordinator from homeassistant.exceptions import ConfigEntryNotReady +from homeassistant.helpers.issue_registry import async_create_issue _LOGGER = logging.getLogger(__name__) @@ -93,8 +94,18 @@ def _update_unique_id(entry: RegistryEntry) -> dict[str, str] | None: # Setup entities await hass.config_entries.async_forward_entry_setups(entry, ENTITY_TYPES) - entry.async_on_unload(entry.add_update_listener(async_update_listener)) - + # Add Core integration message + async_create_issue( + hass, + DOMAIN, + "ohme_core_integration", + is_fixable=False, + severity="warning", + translation_key="ohme_core_integration", + is_persistent=True, + learn_more_url="https://github.com/dan-r/HomeAssistant-ohme?tab=readme-ov-file#important-note" + ) + return True diff --git a/custom_components/ohme/translations/en.json b/custom_components/ohme/translations/en.json index 2da6fea..af7d1a5 100644 --- a/custom_components/ohme/translations/en.json +++ b/custom_components/ohme/translations/en.json @@ -42,7 +42,12 @@ }, "abort": {} }, - "issues": {}, + "issues": { + "ohme_core_integration": { + "title": "Ohme Integration Available in Home Assistant Core", + "description": "The Ohme integration now exists in Home Assistant Core from 2025.1.0 onwards. Click Learn More to find more about the changes and how to migrate." + } + }, "entity": { "binary_sensor": { "car_connected": { From 2aad72eda309749cae5d38ab6320b6aa58fdadeb Mon Sep 17 00:00:00 2001 From: Daniel Raper Date: Sat, 25 Jan 2025 21:50:25 +0000 Subject: [PATCH 2/4] Wording tweaks --- README.md | 2 +- custom_components/ohme/translations/en.json | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index fd9dc72..9235296 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ For the core version of the integration, please raise any issues and pull reques Thank you to the community that has formed around this integration, and I hope you can appreciate this important and necessary evolution of the integration. ### Migrating -To migrate from the custom component to the core version: +To migrate from the custom component to the core integration: 1. Ensure you are running an up to date version of Home Assistant 2. Delete your Ohme account from the Home Assistant Devices & services page 3. Uninstall the custom component. If you installed through HACS, you can do this through the UI diff --git a/custom_components/ohme/translations/en.json b/custom_components/ohme/translations/en.json index af7d1a5..663cd3c 100644 --- a/custom_components/ohme/translations/en.json +++ b/custom_components/ohme/translations/en.json @@ -44,8 +44,8 @@ }, "issues": { "ohme_core_integration": { - "title": "Ohme Integration Available in Home Assistant Core", - "description": "The Ohme integration now exists in Home Assistant Core from 2025.1.0 onwards. Click Learn More to find more about the changes and how to migrate." + "title": "Ohme integration available in Home Assistant Core", + "description": "The Ohme integration is now available in Home Assistant Core from 2025.1.0 onwards. Click Learn More to find more about the changes and how to migrate." } }, "entity": { From e3aa6ebd306506397764cd8eb55051d004ee311e Mon Sep 17 00:00:00 2001 From: Daniel Raper Date: Sat, 25 Jan 2025 21:53:31 +0000 Subject: [PATCH 3/4] Typo --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 9235296..9b13390 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ As of Home Assistant 2025.1, there is now an [Ohme integration](https://www.home The core version of the integration is effectively a ground-up rewrite to follow all the Home Assistant conventions and generally try to maintain a better quality user experience. Because of the amount of work this involves, there is currently a feature gap between custom and core versions, but I'm working to shrink this and am contributing new features to the core gradually. Some things are done differently in the core version (such as different sensor names and having a few of the binary sensors collapsed into an enum sensor), so moving to it may be disruptive if you have working automations. -For the core version of the integration, please raise any issues and pull requests in the [Home Assistant Core](https://github.com/home-assistant/core) repository. The API library is seperate from Home Assistant and can be found in the [ohmepy](https://github.com/dan-r/ohmepy) repository. +For the core version of the integration, please raise any issues and pull requests in the [Home Assistant Core](https://github.com/home-assistant/core) repository. The API library is separate from Home Assistant and can be found in the [ohmepy](https://github.com/dan-r/ohmepy) repository. Thank you to the community that has formed around this integration, and I hope you can appreciate this important and necessary evolution of the integration. From 41a85e8619489b27eb5abebe941501079479670a Mon Sep 17 00:00:00 2001 From: Daniel Raper Date: Sat, 25 Jan 2025 21:55:29 +0000 Subject: [PATCH 4/4] Bump version --- custom_components/ohme/const.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/custom_components/ohme/const.py b/custom_components/ohme/const.py index 6667ae3..3db4dea 100644 --- a/custom_components/ohme/const.py +++ b/custom_components/ohme/const.py @@ -1,7 +1,7 @@ """Component constants""" DOMAIN = "ohme" USER_AGENT = "dan-r-homeassistant-ohme" -INTEGRATION_VERSION = "1.1.0" +INTEGRATION_VERSION = "1.1.1" CONFIG_VERSION = 1 ENTITY_TYPES = ["sensor", "binary_sensor", "switch", "button", "number", "time"]