From a3073745ff70d9800af3e55045acfb55965f524a Mon Sep 17 00:00:00 2001 From: Sascha Peilicke Date: Wed, 4 Mar 2026 17:39:47 +0100 Subject: [PATCH] Fix a minor typo in English translation And improve English grammar in comments across Python source files. --- custom_components/isolarcloud/__init__.py | 4 ++-- custom_components/isolarcloud/api.py | 2 +- custom_components/isolarcloud/application_credentials.py | 2 +- custom_components/isolarcloud/config_flow.py | 2 +- custom_components/isolarcloud/sensor.py | 4 ++-- custom_components/isolarcloud/services.py | 2 +- custom_components/isolarcloud/translations/en.json | 2 +- 7 files changed, 9 insertions(+), 9 deletions(-) diff --git a/custom_components/isolarcloud/__init__.py b/custom_components/isolarcloud/__init__.py index 51861ce..1024ca6 100644 --- a/custom_components/isolarcloud/__init__.py +++ b/custom_components/isolarcloud/__init__.py @@ -54,7 +54,7 @@ async def async_setup_entry(hass: HomeAssistant, entry: ISolarCloudConfigEntry) entry.data["client_secret"], entry.data["plant"], ) - # Fetch access token - this triggers token refresh or re-authentcation if needed + # Fetch access token - this triggers token refresh or re-authentication if needed await entry.runtime_data.async_get_access_token() await hass.config_entries.async_forward_entry_setups(entry, _PLATFORMS) @@ -92,5 +92,5 @@ async def async_migrate_entry(hass: HomeAssistant, config_entry: ConfigEntry): async def update_listener(hass: HomeAssistant, entry: ConfigEntry) -> None: - """Reload integration when options are updated (e.g. changed update_interval).""" + """Reload integration when options are updated (e.g., changed update_interval).""" hass.config_entries.async_schedule_reload(entry.entry_id) diff --git a/custom_components/isolarcloud/api.py b/custom_components/isolarcloud/api.py index 20dc9ad..e481fd3 100644 --- a/custom_components/isolarcloud/api.py +++ b/custom_components/isolarcloud/api.py @@ -9,7 +9,7 @@ class AsyncConfigEntryAuth(pysolarcloud.AbstractAuth): - """Provide iSolarCloud authentication tied to an OAuth2 based config entry.""" + """Provide iSolarCloud authentication tied to an OAuth2-based config entry.""" def __init__( self, diff --git a/custom_components/isolarcloud/application_credentials.py b/custom_components/isolarcloud/application_credentials.py index 47a13a1..c99bb4a 100644 --- a/custom_components/isolarcloud/application_credentials.py +++ b/custom_components/isolarcloud/application_credentials.py @@ -84,7 +84,7 @@ async def async_generate_authorize_url(self, flow_id: str) -> str: "redirectUrl": self.redirect_uri, } url = URL(cloud_url).with_query(query) - # Auth endpoint expects state first and other params after fragment + # Auth endpoint expects state-first and other params after the fragment port = f":{url.port}" if url.explicit_port is not None else "" url = f"{url.scheme}://{url.host}{port}?state={state}#{url.fragment}?{url.raw_query_string}" _LOGGER.debug("Generated authorize url: %s", url) diff --git a/custom_components/isolarcloud/config_flow.py b/custom_components/isolarcloud/config_flow.py index ee68fac..95aa346 100644 --- a/custom_components/isolarcloud/config_flow.py +++ b/custom_components/isolarcloud/config_flow.py @@ -17,7 +17,7 @@ class OptionsFlowHandler(config_entries.OptionsFlow): - """Options flow for setting update interval.""" + """Options flow for setting an update interval.""" OPTIONS_SCHEMA = vol.Schema( { diff --git a/custom_components/isolarcloud/sensor.py b/custom_components/isolarcloud/sensor.py index bd326bd..d0723c4 100644 --- a/custom_components/isolarcloud/sensor.py +++ b/custom_components/isolarcloud/sensor.py @@ -133,7 +133,7 @@ def __init__( self._attr_device_class = sensor_type self._attr_native_unit_of_measurement = unit_of(id) - # Set attributes based on sensor type + # Set attributes based on a sensor type if sensor_type == SensorDeviceClass.ENERGY: self._attr_state_class = SensorStateClass.TOTAL self._value_transform = lambda v: v @@ -217,7 +217,7 @@ async def _async_setup(self): self.plant_names[str(plant["ps_id"])] = plant["ps_name"] async def _async_update_data(self): - """Fetch data from API endpoint for all plants.""" + """Fetch data from the API endpoint for all plants.""" try: async with asyncio.timeout(10): data = await self.plants_api.async_get_realtime_data( diff --git a/custom_components/isolarcloud/services.py b/custom_components/isolarcloud/services.py index 53552ca..c982395 100644 --- a/custom_components/isolarcloud/services.py +++ b/custom_components/isolarcloud/services.py @@ -167,7 +167,7 @@ async def async_delete_statistics_range( hass: HomeAssistant, statistic_id, start_time, end_time ): """Delete existing statistics rows for a statistic_id in a given time range.""" - # Add job to the executor to avoid blocking the event loop + # Add a job to the executor to avoid blocking the event loop await get_instance(hass).async_add_executor_job( _delete_statistics_range_blocking, hass, diff --git a/custom_components/isolarcloud/translations/en.json b/custom_components/isolarcloud/translations/en.json index cf7445d..979a069 100644 --- a/custom_components/isolarcloud/translations/en.json +++ b/custom_components/isolarcloud/translations/en.json @@ -69,7 +69,7 @@ "name": "Produced energy" }, "total_direct_energy_consumption": { - "name": "Direct comsumption" + "name": "Direct consumption" }, "power": { "name": "Power flow"