Skip to content

Commit a1117e9

Browse files
committed
Update DEVELOPERS.md
1 parent 63966c6 commit a1117e9

File tree

3 files changed

+5
-41
lines changed

3 files changed

+5
-41
lines changed

DEVELOPERS.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ The tests will show up at `tests/components/solcast_solar`. `cd` to there and ex
2828

2929
Additional test contributions will be most welcome. In fact, test contributions will be required if your code modifications introduce lines of code that are not properly tested using PyTest.
3030

31-
Current PyTest coverage of all modules is 100%. _Every_ line of code is currently exercised, and it is expected that every circumstance is covered by a test. (This may be accomplished by extending an existing test, or by creating a new one.) This is something that should be aspired to for every pull request to this integration, and if test coverage is completely ignored and your pull request is extensive, then it will likely be rejected, even if it appears to work perfectly. (If your test does not hit PyTest 100% coverage then someone _else will_ need to code the test before the PR is merged. And they won't like that...)
31+
Current PyTest coverage of all modules is 100%. _Every_ line of code is currently exercised, and it is expected that every circumstance is covered by a test. (This may be accomplished by extending an existing test, or by creating a new one.) This is something that should be aspired to for every pull request to this integration, and if test coverage is completely ignored and your pull request is extensive, then it will likely be rejected, even if it appears to work perfectly. (If your test does not hit PyTest 100% coverage then _someone else_ will need to code the test before the PR is merged. And they won't like that...)
3232

33-
Home Assistant development standards, with full type hint inclusion are also a thing here, and non-conformance will also result in PR rejection. The aim is adherence to strict type checking standards. Our recommendation is to develop suggested changes in a Home Assistant dev container, which incorporates much automated checking of code standards to help out. GitHub CoPilot is also pretty neat at calling out inefficient code.
33+
Home Assistant development standards, with type hint inclusion are also a thing here, and non-conformance will also result in PR rejection. A strict type checking standard is maintained. Our recommendation is to develop suggested changes in a Home Assistant dev container, which incorporates much automated checking of code standards to help out. GitHub CoPilot is also pretty neat at calling out inefficient or poorly constructed code. Verify type checking with `mypy` (e.g. `mypy solcastapi.py`)
3434

35-
Welcome, dev! Make this a better integration!
35+
Welcome! Make this an even better integration!

custom_components/solcast_solar/coordinator.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ async def __check_forecast_fetch(self, *args) -> None:
177177
if update_in >= 0:
178178
task_name = f"pending_update_{update_in:03}"
179179
_LOGGER.debug(
180-
f"Create task %s to fire at {interval.hour:02d}:{interval.minute:02d}:{interval.second:02d}", # noqa: G004
180+
f"Create task %s to fire at {interval.hour:02d}:{interval.minute:02d}:{interval.second:02d} UTC", # noqa: G004
181181
task_name,
182182
)
183183
self._update_sequence.append(update_in)

custom_components/solcast_solar/solcastapi.py

+1-37
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@
4242
BRK_SITE_DETAILED,
4343
CUSTOM_HOUR_SENSOR,
4444
DATE_FORMAT,
45-
# DATE_FORMAT_UTC,
4645
DOMAIN,
4746
HARD_LIMIT_API,
4847
KEY_ESTIMATE,
@@ -172,42 +171,7 @@ class ConnectionOptions:
172171

173172

174173
class SolcastApi: # pylint: disable=too-many-public-methods
175-
"""The Solcast API.
176-
177-
Public functions:
178-
get_forecast_update: Request forecast data for all sites.
179-
set_next_update: Set the next forecast update time displayed.
180-
get_data: Return the data dictionary.
181-
build_forecast_data: Build the forecast, adjusting if dampening or setting a hard limit.
182-
check_data_records: Verify that forecasts for day 0..7 contain all forecast periods
183-
184-
get_real_now_utc: Get the complete time now, including seconds and microseconds
185-
get_forecast_list: Service event to get list of forecasts.
186-
delete_solcast_file: Service event to delete the solcast.json file.
187-
get_sites_and_usage: Get the sites and usage, and validate API key changes against the cache files in use.
188-
reset_api_usage: Reset the daily API usage counter.
189-
load_saved_data: Load the saved solcast.json data.
190-
serialise_granular_dampening: Serialise the granular dampening file.
191-
granular_dampening_data: Read the current granular dampening file.
192-
get_dampening: Return the currently set dampening factors for a service call.
193-
194-
get_last_updated: Return when the forecast was last updated.
195-
is_stale_data: Return whether the forecast was last updated some time ago (i.e. is stale).
196-
is_stale_usage_cache: Return whether the API usage cache needs to be reset
197-
get_api_limit: Return API polling limit for this UTC 24hr period (minimum of all API keys).
198-
get_api_used_count: Return API polling count for this UTC 24hr period (minimum of all API keys).
199-
200-
get_rooftop_site_total_today: Return total kW for today for a site.
201-
get_rooftop_site_extra_data: Return information about a site.
202-
get_forecast_day: Return forecast for the Nth day ahead.
203-
get_forecast_n_hour: Return forecast for the Nth hour. Based from prior hour point.
204-
get_forecast_custom_hours: Return forecast for the next N hours. Interpolated, based from prior 5-minute point.
205-
get_power_n_minutes: Return expected power generation in the next N minutes. Based from prior half-hour point.
206-
get_peak_power_day: Return max kW for site N days ahead.
207-
get_peak_time_day: Return hour of max kW for site N days ahead.
208-
get_forecast_remaining_today: Return remaining forecasted production for today. Interpolated, based from prior 5-minute point.
209-
get_total_energy_forecast_day: Return forecast kWh total for site N days ahead.
210-
"""
174+
"""The Solcast API."""
211175

212176
def __init__(
213177
self,

0 commit comments

Comments
 (0)