# zubir2k/homeassistant-esolattakwim architecture

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

- Interactive diagram: https://gitdiagram.com/zubir2k/homeassistant-esolattakwim
- Repository: https://github.com/zubir2k/homeassistant-esolattakwim

## Overview

eSolat Takwim is a Home Assistant integration for Malaysian prayer times and Islamic calendar events. A user selects a JAKIM zone in the integration setup; Home Assistant sets up calendar and sensor entities, which obtain and expose prayer and Hijri data, while the calendar also retrieves Islamic events. Prayer times and calendar events are cached locally and reused when retrieval fails. The README also documents a Markdown card and Azan automation blueprint with audio and notification features. The graph includes these documented user-facing capabilities, but their runtime wiring is not established by the sampled source.

Main entry points: [`custom_components/esolattakwim/prayer_times.py`](https://github.com/zubir2k/homeassistant-esolattakwim/blob/main/custom_components/esolattakwim/prayer_times.py) (Prayer-time retrieval & cache), [`custom_components/esolattakwim/calendar.py`](https://github.com/zubir2k/homeassistant-esolattakwim/blob/main/custom_components/esolattakwim/calendar.py) (Calendar & Islamic events), [`custom_components/esolattakwim/__init__.py`](https://github.com/zubir2k/homeassistant-esolattakwim/blob/main/custom_components/esolattakwim/__init__.py) (Integration lifecycle), [`custom_components/esolattakwim/config_flow.py`](https://github.com/zubir2k/homeassistant-esolattakwim/blob/main/custom_components/esolattakwim/config_flow.py) (Zone setup)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_setup["Setup &amp; lifecycle"]
  node_flow["Zone setup<br/>[config_flow.py]"]
  node_lifecycle["Integration lifecycle<br/>[__init__.py]"]
  node_constants["Zones &amp; API config<br/>[const.py]"]
end

subgraph group_data["JAKIM data &amp; cache"]
  node_prayer["Prayer-time retrieval &amp; cache<br/>[prayer_times.py]"]
  node_utils["Prayer-time formatting<br/>[utils.py]"]
  node_jakim["JAKIM e-Solat"]
  node_prayerstore[("Prayer-time storage")]
end

subgraph group_entities["Home Assistant entities"]
  node_calendar["Calendar &amp; Islamic events<br/>[calendar.py]"]
  node_eventstore[("Calendar-event storage")]
  node_sensors["Prayer &amp; Hijri sensors<br/>[sensor.py]"]
end

subgraph group_user["User experiences"]
  node_card["Prayer-time Markdown card<br/>[MARKDOWN.md]"]
  node_blueprint["Azan automation blueprint"]
  node_audio["Azan &amp; supplication audio"]
end

node_user(("Home Assistant user"))

node_user -->|"selects zone"| node_flow
node_flow -->|"offers zones"| node_constants
node_lifecycle -->|"forwards setup"| node_calendar
node_lifecycle -->|"forwards setup"| node_sensors
node_calendar -->|"fetches &amp; reads"| node_prayer
node_calendar -->|"requests events"| node_jakim
node_prayer -->|"fetches times"| node_jakim
node_prayer -->|"loads &amp; saves"| node_prayerstore
node_prayer -->|"formats times"| node_utils
node_calendar -->|"loads &amp; saves"| node_eventstore
node_sensors -->|"reads times"| node_prayer
node_user -->|"uses template"| node_card
node_user -->|"imports automation"| node_blueprint
node_blueprint -.->|"plays audio"| node_audio

click node_flow "https://github.com/zubir2k/homeassistant-esolattakwim/blob/main/custom_components/esolattakwim/config_flow.py"
click node_lifecycle "https://github.com/zubir2k/homeassistant-esolattakwim/blob/main/custom_components/esolattakwim/__init__.py"
click node_constants "https://github.com/zubir2k/homeassistant-esolattakwim/blob/main/custom_components/esolattakwim/const.py"
click node_prayer "https://github.com/zubir2k/homeassistant-esolattakwim/blob/main/custom_components/esolattakwim/prayer_times.py"
click node_utils "https://github.com/zubir2k/homeassistant-esolattakwim/blob/main/custom_components/esolattakwim/utils.py"
click node_calendar "https://github.com/zubir2k/homeassistant-esolattakwim/blob/main/custom_components/esolattakwim/calendar.py"
click node_sensors "https://github.com/zubir2k/homeassistant-esolattakwim/blob/main/custom_components/esolattakwim/sensor.py"
click node_card "https://github.com/zubir2k/homeassistant-esolattakwim/blob/main/MARKDOWN.md"
click node_blueprint "https://github.com/zubir2k/homeassistant-esolattakwim/blob/main/blueprints/esolat_automation.yaml"
click node_audio "https://github.com/zubir2k/homeassistant-esolattakwim/tree/main/media"

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_flow,node_lifecycle,node_constants,node_user toneBlue
class node_prayer,node_utils,node_jakim,node_prayerstore toneAmber
class node_calendar,node_eventstore,node_sensors toneMint
class node_card,node_blueprint,node_audio toneRose
```

## Components

### Setup & lifecycle

- [Zone setup](https://github.com/zubir2k/homeassistant-esolattakwim/blob/main/custom_components/esolattakwim/config_flow.py): `custom_components/esolattakwim/config_flow.py`
- [Integration lifecycle](https://github.com/zubir2k/homeassistant-esolattakwim/blob/main/custom_components/esolattakwim/__init__.py): `custom_components/esolattakwim/__init__.py`
- [Zones & API config](https://github.com/zubir2k/homeassistant-esolattakwim/blob/main/custom_components/esolattakwim/const.py): `custom_components/esolattakwim/const.py`

### JAKIM data & cache

- [Prayer-time retrieval & cache](https://github.com/zubir2k/homeassistant-esolattakwim/blob/main/custom_components/esolattakwim/prayer_times.py): `custom_components/esolattakwim/prayer_times.py`
- [Prayer-time formatting](https://github.com/zubir2k/homeassistant-esolattakwim/blob/main/custom_components/esolattakwim/utils.py): `custom_components/esolattakwim/utils.py`
- **JAKIM e-Solat**
- **Prayer-time storage**

### Home Assistant entities

- [Calendar & Islamic events](https://github.com/zubir2k/homeassistant-esolattakwim/blob/main/custom_components/esolattakwim/calendar.py): `custom_components/esolattakwim/calendar.py`
- **Calendar-event storage**
- [Prayer & Hijri sensors](https://github.com/zubir2k/homeassistant-esolattakwim/blob/main/custom_components/esolattakwim/sensor.py): `custom_components/esolattakwim/sensor.py`

### User experiences

- [Prayer-time Markdown card](https://github.com/zubir2k/homeassistant-esolattakwim/blob/main/MARKDOWN.md): `MARKDOWN.md`
- [Azan automation blueprint](https://github.com/zubir2k/homeassistant-esolattakwim/blob/main/blueprints/esolat_automation.yaml): `blueprints/esolat_automation.yaml`
- [Azan & supplication audio](https://github.com/zubir2k/homeassistant-esolattakwim/tree/main/media): `media`

### Other components

- **Home Assistant user**

## Connections

- Home Assistant user → Zone setup: selects zone (evidence: `README.md`)
- Zone setup → Zones & API config: offers zones (evidence: `custom_components/esolattakwim/config_flow.py`)
- Integration lifecycle → Calendar & Islamic events: forwards setup (evidence: `custom_components/esolattakwim/__init__.py`)
- Integration lifecycle → Prayer & Hijri sensors: forwards setup (evidence: `custom_components/esolattakwim/__init__.py`)
- Calendar & Islamic events → Prayer-time retrieval & cache: fetches & reads (evidence: `custom_components/esolattakwim/calendar.py`)
- Calendar & Islamic events → JAKIM e-Solat: requests events (evidence: `custom_components/esolattakwim/calendar.py`)
- Prayer-time retrieval & cache → JAKIM e-Solat: fetches times (evidence: `custom_components/esolattakwim/prayer_times.py`)
- Prayer-time retrieval & cache → Prayer-time storage: loads & saves (evidence: `custom_components/esolattakwim/prayer_times.py`)
- Prayer-time retrieval & cache → Prayer-time formatting: formats times (evidence: `custom_components/esolattakwim/prayer_times.py`)
- Calendar & Islamic events → Calendar-event storage: loads & saves (evidence: `custom_components/esolattakwim/calendar.py`)
- Prayer & Hijri sensors → Prayer-time retrieval & cache: reads times (evidence: `custom_components/esolattakwim/sensor.py`)
- Home Assistant user → Prayer-time Markdown card: uses template (evidence: `README.md`)
- Home Assistant user → Azan automation blueprint: imports automation (evidence: `README.md`)
- Azan automation blueprint → Azan & supplication audio: plays audio
