Add farm season calendar with yr.no weather integration for Norwegian climate zones#21
Draft
Add farm season calendar with yr.no weather integration for Norwegian climate zones#21
Conversation
Co-authored-by: minfuel <106936397+minfuel@users.noreply.github.com>
Co-authored-by: minfuel <106936397+minfuel@users.noreply.github.com>
Co-authored-by: minfuel <106936397+minfuel@users.noreply.github.com>
…caping, and validation Co-authored-by: minfuel <106936397+minfuel@users.noreply.github.com>
Co-authored-by: minfuel <106936397+minfuel@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add farm season calendar for Norway
Add farm season calendar for Norwegian climate zones
Jan 24, 2026
Contributor
|
@copilot WEATHER INFO FROM YR.NO |
Co-authored-by: minfuel <106936397+minfuel@users.noreply.github.com>
Author
Implemented yr.no weather integration in commit d8a6e3e: New weather module (
4 new API endpoints:
Smart features:
Example: For tomatoes, it checks frost forecast and warns "Tomat (Tomato) is not frost-tolerant - wait until frost risk passes" when frost is detected. Full documentation added to FARM_SEASON_CALENDAR.md with API examples. |
…, better error handling Co-authored-by: minfuel <106936397+minfuel@users.noreply.github.com>
Copilot
AI
changed the title
Add farm season calendar for Norwegian climate zones
Add farm season calendar with yr.no weather integration for Norwegian climate zones
Jan 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements garden planning system with companion planting, crop rotation, succession planting, automated reminders, and real-time weather integration optimized for Norwegian climate zones 1-8.
Core Components
4 new doctypes:
Crop- Growing data (family, zones, planting/harvest windows, maturity days, frost tolerance, companions)Garden Plot- Physical plot tracking (dimensions, soil type, pH, sun exposure, drainage)Garden Planting Schedule- Seasonal planning with rotation history and email remindersGarden Planting Item- Individual plantings with status tracking10 API endpoints:
get_planting_calendar(zone, month)- Crops by zone/month with proper chronological month handlingget_companion_planting_suggestions(crop)- Good/bad companions with substring matchingget_crop_rotation_suggestions(plot, previous_crop)- Rotation by family to prevent diseasecalculate_succession_planting(crop, start_date, end_date)- Multiple planting datesgenerate_garden_shopping_list(schedule)- Seed/plant quantitiesget_upcoming_garden_tasks(days_ahead)- Planting/harvest remindersget_weather_forecast_for_location(lat, lon, days)- 7-day weather forecast from yr.noget_frost_risk_for_location(lat, lon)- Frost risk alerts for crop protectionget_planting_weather_advice_for_location(lat, lon, crop)- Weather-based planting recommendationsget_weather_for_garden_plot(plot_name, days)- Automatic weather for garden plotsScheduled task:
send_garden_reminders()- Daily email notifications with HTML-escaped contentWeather module (
assist/utils/weather_yr.py):Fixtures:
Technical Details
Month comparison: Uses numeric indices instead of string comparison to handle chronological ordering and year-spanning seasons correctly.
Companion matching: Substring search allows partial crop name matches (e.g., "Tomat" matches "Tomat (Tomato)").
Security: HTML escaping via
frappe.utils.html_escape()on all user inputs in email templates.Harvest calculation: Automatic expected harvest dates using
add_days(planting_date, days_to_maturity).Validation: Warns on incompatible companion crops and cross-year planting windows.
Weather integration: Complies with yr.no API terms (User-Agent header), includes proper error handling, safe attribute access with
getattr(), and comprehensive logging.Example Usage
Testing
12 tests covering doctype structure, API methods, fixture data, companion planting integrity, zone validation, and weather integration functionality.
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.