# mampfes/hacs_waste_collection_schedule architecture

> Architecture diagram of the GitHub repository mampfes/hacs_waste_collection_schedule, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/mampfes/hacs_waste_collection_schedule
- Repository: https://github.com/mampfes/hacs_waste_collection_schedule

## Overview

Waste Collection Schedule is a Home Assistant integration that turns provider, ICS/iCal, and user-defined collection schedules into calendar and sensor entities. The main path is configuration, source construction, fetching and normalizing collection entries, then exposing them through Home Assistant. Provider adapters cover many municipal services; shared source and collection modules provide internal reuse. The tree and excerpts support the source-shell behavior and several adapters, but do not include the coordinator or every entity implementation, so uncertain internal wiring is omitted.

Main entry points: [`custom_components/waste_collection_schedule/waste_collection_schedule/source`](https://github.com/mampfes/hacs_waste_collection_schedule/tree/master/custom_components/waste_collection_schedule/waste_collection_schedule/source) (Provider adapters), [`custom_components/waste_collection_schedule/waste_collection_api.py`](https://github.com/mampfes/hacs_waste_collection_schedule/blob/master/custom_components/waste_collection_schedule/waste_collection_api.py) (Waste collection API), [`custom_components/waste_collection_schedule/waste_collection_schedule/collection.py`](https://github.com/mampfes/hacs_waste_collection_schedule/blob/master/custom_components/waste_collection_schedule/waste_collection_schedule/collection.py) (Collection entry), [`custom_components/waste_collection_schedule/__init__.py`](https://github.com/mampfes/hacs_waste_collection_schedule/blob/master/custom_components/waste_collection_schedule/__init__.py) (Integration setup)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_setup["Setup and configuration"]
  node_config_flow["Config flow<br/>[config_flow.py]"]
  node_yaml_setup["YAML setup<br/>[init_yaml.py]"]
  node_ui_setup["UI setup<br/>[init_ui.py]"]
  node_integration["Integration setup<br/>[__init__.py]"]
end

subgraph group_sources["Schedule sources"]
  node_source_shell["Source shell"]
  node_provider_sources["Provider adapters"]
  node_ics_source["ICS source"]
  node_static_sources["Static and wrapper sources"]
  node_provider_services["Shared provider helpers"]
end

subgraph group_domain["Collection domain"]
  node_collection["Collection entry<br/>[collection.py]"]
  node_aggregator["Collection aggregator"]
  node_api["Waste collection API"]
end

subgraph group_ha["Home Assistant outputs"]
  node_sensor["Sensors<br/>[sensor.py]"]
  node_calendar["Calendar<br/>[calendar.py]"]
  node_services["Fetch service<br/>[service.py]"]
end

node_user(("Home Assistant user"))
node_ha_runtime(("Home Assistant"))
node_provider_sites(("Collection providers"))

node_user -->|"configures"| node_config_flow
node_user -.->|"configures"| node_yaml_setup
node_config_flow -->|"sets up"| node_ui_setup
node_yaml_setup -->|"sets up"| node_integration
node_ui_setup -->|"sets up"| node_integration
node_integration -->|"constructs"| node_source_shell
node_source_shell -->|"dispatches"| node_provider_sources
node_source_shell -->|"dispatches"| node_ics_source
node_source_shell -->|"dispatches"| node_static_sources
node_provider_sources -.->|"uses helpers"| node_provider_services
node_provider_sources -->|"fetches schedule"| node_provider_sites
node_ics_source -->|"reads calendar"| node_provider_sites
node_provider_sources -->|"creates entries"| node_collection
node_ics_source -->|"creates entries"| node_collection
node_static_sources -->|"creates entries"| node_collection
node_source_shell -->|"customizes entries"| node_collection
node_source_shell -->|"provides entries"| node_aggregator
node_aggregator -->|"aggregates"| node_api
node_api -->|"provides schedules"| node_sensor
node_api -->|"provides schedules"| node_calendar
node_sensor -->|"publishes entities"| node_ha_runtime
node_calendar -->|"publishes events"| node_ha_runtime
node_user -->|"requests refresh"| node_services
node_services -->|"triggers fetch"| node_api

click node_config_flow "https://github.com/mampfes/hacs_waste_collection_schedule/blob/master/custom_components/waste_collection_schedule/config_flow.py"
click node_yaml_setup "https://github.com/mampfes/hacs_waste_collection_schedule/blob/master/custom_components/waste_collection_schedule/init_yaml.py"
click node_ui_setup "https://github.com/mampfes/hacs_waste_collection_schedule/blob/master/custom_components/waste_collection_schedule/init_ui.py"
click node_integration "https://github.com/mampfes/hacs_waste_collection_schedule/blob/master/custom_components/waste_collection_schedule/__init__.py"
click node_provider_sources "https://github.com/mampfes/hacs_waste_collection_schedule/tree/master/custom_components/waste_collection_schedule/waste_collection_schedule/source"
click node_ics_source "https://github.com/mampfes/hacs_waste_collection_schedule/tree/master/custom_components/waste_collection_schedule/waste_collection_schedule/source"
click node_static_sources "https://github.com/mampfes/hacs_waste_collection_schedule/tree/master/custom_components/waste_collection_schedule/waste_collection_schedule/source"
click node_provider_services "https://github.com/mampfes/hacs_waste_collection_schedule/tree/master/custom_components/waste_collection_schedule/waste_collection_schedule/service"
click node_collection "https://github.com/mampfes/hacs_waste_collection_schedule/blob/master/custom_components/waste_collection_schedule/waste_collection_schedule/collection.py"
click node_aggregator "https://github.com/mampfes/hacs_waste_collection_schedule/blob/master/custom_components/waste_collection_schedule/waste_collection_schedule/collection_aggregator.py"
click node_api "https://github.com/mampfes/hacs_waste_collection_schedule/blob/master/custom_components/waste_collection_schedule/waste_collection_api.py"
click node_sensor "https://github.com/mampfes/hacs_waste_collection_schedule/blob/master/custom_components/waste_collection_schedule/sensor.py"
click node_calendar "https://github.com/mampfes/hacs_waste_collection_schedule/blob/master/custom_components/waste_collection_schedule/calendar.py"
click node_services "https://github.com/mampfes/hacs_waste_collection_schedule/blob/master/custom_components/waste_collection_schedule/service.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_config_flow,node_yaml_setup,node_ui_setup,node_integration,node_user toneBlue
class node_source_shell,node_provider_sources,node_ics_source,node_static_sources,node_provider_services toneAmber
class node_collection,node_aggregator,node_api toneMint
class node_sensor,node_calendar,node_services toneRose
class node_ha_runtime,node_provider_sites toneIndigo
```

## Components

### Setup and configuration

- [Config flow](https://github.com/mampfes/hacs_waste_collection_schedule/blob/master/custom_components/waste_collection_schedule/config_flow.py): `custom_components/waste_collection_schedule/config_flow.py`
- [YAML setup](https://github.com/mampfes/hacs_waste_collection_schedule/blob/master/custom_components/waste_collection_schedule/init_yaml.py): `custom_components/waste_collection_schedule/init_yaml.py`
- [UI setup](https://github.com/mampfes/hacs_waste_collection_schedule/blob/master/custom_components/waste_collection_schedule/init_ui.py): `custom_components/waste_collection_schedule/init_ui.py`
- [Integration setup](https://github.com/mampfes/hacs_waste_collection_schedule/blob/master/custom_components/waste_collection_schedule/__init__.py): `custom_components/waste_collection_schedule/__init__.py`

### Schedule sources

- **Source shell**
- [Provider adapters](https://github.com/mampfes/hacs_waste_collection_schedule/tree/master/custom_components/waste_collection_schedule/waste_collection_schedule/source): `custom_components/waste_collection_schedule/waste_collection_schedule/source`
- [ICS source](https://github.com/mampfes/hacs_waste_collection_schedule/tree/master/custom_components/waste_collection_schedule/waste_collection_schedule/source): `custom_components/waste_collection_schedule/waste_collection_schedule/source`
- [Static and wrapper sources](https://github.com/mampfes/hacs_waste_collection_schedule/tree/master/custom_components/waste_collection_schedule/waste_collection_schedule/source): `custom_components/waste_collection_schedule/waste_collection_schedule/source`
- [Shared provider helpers](https://github.com/mampfes/hacs_waste_collection_schedule/tree/master/custom_components/waste_collection_schedule/waste_collection_schedule/service): `custom_components/waste_collection_schedule/waste_collection_schedule/service`

### Collection domain

- [Collection entry](https://github.com/mampfes/hacs_waste_collection_schedule/blob/master/custom_components/waste_collection_schedule/waste_collection_schedule/collection.py): `custom_components/waste_collection_schedule/waste_collection_schedule/collection.py`
- [Collection aggregator](https://github.com/mampfes/hacs_waste_collection_schedule/blob/master/custom_components/waste_collection_schedule/waste_collection_schedule/collection_aggregator.py): `custom_components/waste_collection_schedule/waste_collection_schedule/collection_aggregator.py`
- [Waste collection API](https://github.com/mampfes/hacs_waste_collection_schedule/blob/master/custom_components/waste_collection_schedule/waste_collection_api.py): `custom_components/waste_collection_schedule/waste_collection_api.py`

### Home Assistant outputs

- [Sensors](https://github.com/mampfes/hacs_waste_collection_schedule/blob/master/custom_components/waste_collection_schedule/sensor.py): `custom_components/waste_collection_schedule/sensor.py`
- [Calendar](https://github.com/mampfes/hacs_waste_collection_schedule/blob/master/custom_components/waste_collection_schedule/calendar.py): `custom_components/waste_collection_schedule/calendar.py`
- [Fetch service](https://github.com/mampfes/hacs_waste_collection_schedule/blob/master/custom_components/waste_collection_schedule/service.py): `custom_components/waste_collection_schedule/service.py`

### Other components

- **Home Assistant user**
- **Home Assistant**
- **Collection providers**

## Connections

- Home Assistant user → Config flow: configures
- Home Assistant user → YAML setup: configures
- Config flow → UI setup: sets up
- YAML setup → Integration setup: sets up
- UI setup → Integration setup: sets up
- Integration setup → Source shell: constructs
- Source shell → Provider adapters: dispatches
- Source shell → ICS source: dispatches
- Source shell → Static and wrapper sources: dispatches
- Provider adapters → Shared provider helpers: uses helpers
- Provider adapters → Collection providers: fetches schedule
- ICS source → Collection providers: reads calendar
- Provider adapters → Collection entry: creates entries
- ICS source → Collection entry: creates entries
- Static and wrapper sources → Collection entry: creates entries
- Source shell → Collection entry: customizes entries
- Source shell → Collection aggregator: provides entries
- Collection aggregator → Waste collection API: aggregates
- Waste collection API → Sensors: provides schedules
- Waste collection API → Calendar: provides schedules
- Sensors → Home Assistant: publishes entities
- Calendar → Home Assistant: publishes events
- Home Assistant user → Fetch service: requests refresh
- Fetch service → Waste collection API: triggers fetch
