Add image generation #2

Merged
Myxelium merged 4 commits from add-image-generation into master 2025-07-19 17:11:31 +00:00
Myxelium commented 2025-07-19 17:11:03 +00:00 (Migrated from github.com)

This pull request introduces significant enhancements to the HomeApi project, including new endpoints, expanded functionality for weather and departure board services, and improved configuration and image generation capabilities. The changes also include new integrations, refactoring, and the addition of supporting models and handlers.

New API Endpoints and Features

  • Updated HomeController to include new endpoints for image generation (GetImage), configuration retrieval (GetCombinedBuffers), and departure board data (GetDepartureBoard). The existing GetHome endpoint was renamed to getHome for consistency.

Expanded Weather and Departure Board Functionality

  • Added US EPA and UK DEFRA air quality indices to the WeatherInformation contract.
  • Enhanced the Forecast model with IconCode and ChanceOfRain properties.
  • Added a method to convert departure board responses into a TimeTable model.

New Handlers and Services

  • Introduced a Configuration handler to retrieve microprocessor settings from the API configuration.
  • Added a DepartureBoard handler and a DepartureBoardService to fetch and process departure board data using the ResRobot API. [1] [2]
  • Implemented an ImageGeneration handler to create images using weather and departure board data, RazorLight templates, and PuppeteerSharp.

Refactoring and Integrations

  • Renamed GetWeather handler to Weather for better clarity and consistency.
  • Added new integrations, including IResRobotClient for departure board data and additional configuration settings for ResRobot API keys and default station. [1] [2]
  • Updated WeatherClient to fetch a 14-day forecast instead of 7 days and moved it to a dedicated namespace.

Supporting Models and Configuration

  • Added models for image generation (Image) and microprocessor configuration (MicroProcessorConfiguration). [1] [2]
  • Created a LocationNameResponse model to handle responses from the ResRobot API.
  • Updated HomeApi.csproj to include new dependencies (PuppeteerSharp, RazorLight) and added support for copying RazorLight templates to the output directory. [1] [2]
This pull request introduces significant enhancements to the `HomeApi` project, including new endpoints, expanded functionality for weather and departure board services, and improved configuration and image generation capabilities. The changes also include new integrations, refactoring, and the addition of supporting models and handlers. ### New API Endpoints and Features * Updated `HomeController` to include new endpoints for image generation (`GetImage`), configuration retrieval (`GetCombinedBuffers`), and departure board data (`GetDepartureBoard`). The existing `GetHome` endpoint was renamed to `getHome` for consistency. ### Expanded Weather and Departure Board Functionality * Added US EPA and UK DEFRA air quality indices to the `WeatherInformation` contract. * Enhanced the `Forecast` model with `IconCode` and `ChanceOfRain` properties. * Added a method to convert departure board responses into a `TimeTable` model. ### New Handlers and Services * Introduced a `Configuration` handler to retrieve microprocessor settings from the API configuration. * Added a `DepartureBoard` handler and a `DepartureBoardService` to fetch and process departure board data using the ResRobot API. [[1]](diffhunk://#diff-9fe803e7be81f4a779159389dc4ee60f8b4416ed88a3323a7a61d32a786711b7R1-R18) [[2]](diffhunk://#diff-ffd0f78bbe6ad17f70b2dc7f5acf5a628e47d0901702fada9b088eded9e7d1e6R1-R46) * Implemented an `ImageGeneration` handler to create images using weather and departure board data, RazorLight templates, and PuppeteerSharp. ### Refactoring and Integrations * Renamed `GetWeather` handler to `Weather` for better clarity and consistency. * Added new integrations, including `IResRobotClient` for departure board data and additional configuration settings for ResRobot API keys and default station. [[1]](diffhunk://#diff-f1f6243160cb9e7afc44fe4a2e4b435c3c24b81ec0a517292d354dde44ba5f67R1-R30) [[2]](diffhunk://#diff-dd9c1578547ac855792ea1d7c996d0f33b2529ffd51161fb1519dda076d304ceR8-R37) * Updated `WeatherClient` to fetch a 14-day forecast instead of 7 days and moved it to a dedicated namespace. ### Supporting Models and Configuration * Added models for image generation (`Image`) and microprocessor configuration (`MicroProcessorConfiguration`). [[1]](diffhunk://#diff-52de5950a5013fb0b9d61470055407accb531b5391eed32f0167ec3119dc3dcfR1-R7) [[2]](diffhunk://#diff-d1efbbb5a7f87fa17e438ec068a70cc1b329c90f31ec438292bc46fc29a70240R1-R12) * Created a `LocationNameResponse` model to handle responses from the ResRobot API. * Updated `HomeApi.csproj` to include new dependencies (`PuppeteerSharp`, `RazorLight`) and added support for copying RazorLight templates to the output directory. [[1]](diffhunk://#diff-6dc377d1cd7add61ac0aaad835f9ea837c5f1566fc595c08d6b4be1173ce6641R8-R17) [[2]](diffhunk://#diff-6dc377d1cd7add61ac0aaad835f9ea837c5f1566fc595c08d6b4be1173ce6641R28-R32)
Sign in to join this conversation.