Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions custom_components/isolarcloud/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
2 changes: 1 addition & 1 deletion custom_components/isolarcloud/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion custom_components/isolarcloud/application_credentials.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion custom_components/isolarcloud/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
{
Expand Down
4 changes: 2 additions & 2 deletions custom_components/isolarcloud/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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(
Expand Down
2 changes: 1 addition & 1 deletion custom_components/isolarcloud/services.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion custom_components/isolarcloud/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
"name": "Produced energy"
},
"total_direct_energy_consumption": {
"name": "Direct comsumption"
"name": "Direct consumption"
},
"power": {
"name": "Power flow"
Expand Down