# zubir2k/homeassistant-esolatgps architecture

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

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

## Overview

eSolat GPS is a Home Assistant integration that turns Home and Person GPS locations into prayer-time sensors, with offline JAKIM zone resolution in Malaysia and Aladhan times elsewhere. Its coordinator refreshes location data; sensor entities expose prayer schedules and diagnostics, while a bundled dashboard card presents live prayer information. The README documents these capabilities, but several implementation details are unsampled, so those relationships are shown only where source excerpts or documentation support them.

Main entry points: [`custom_components/esolatgps/coordinator.py`](https://github.com/zubir2k/homeassistant-esolatgps/blob/main/custom_components/esolatgps/coordinator.py) (Location update coordinator), [`custom_components/esolatgps/config_flow.py`](https://github.com/zubir2k/homeassistant-esolatgps/blob/main/custom_components/esolatgps/config_flow.py) (Config and options flow), [`custom_components/esolatgps/__init__.py`](https://github.com/zubir2k/homeassistant-esolatgps/blob/main/custom_components/esolatgps/__init__.py) (Integration lifecycle), [`custom_components/esolatgps/sensor.py`](https://github.com/zubir2k/homeassistant-esolatgps/blob/main/custom_components/esolatgps/sensor.py) (Prayer and diagnostic sensors)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_setup["Setup and lifecycle"]
  node_config["Config and options flow<br/>[config_flow.py]"]
  node_integration["Integration lifecycle<br/>[__init__.py]"]
  node_constants["Provider and sensor constants<br/>[const.py]"]
end

subgraph group_prayer["Prayer data"]
  node_coordinator["Location update coordinator<br/>[coordinator.py]"]
  node_zone_lookup["Offline JAKIM zone lookup<br/>[zones.py]"]
  node_zone_data["Bundled zone polygons"]
end

subgraph group_entities["Home Assistant entities"]
  node_sensor_platform["Prayer and diagnostic sensors<br/>[sensor.py]"]
  node_base_entity["Shared entity base<br/>[entity.py]"]
  node_diagnostics["Redacted diagnostics<br/>[diagnostics.py]"]
end

subgraph group_dashboard["Dashboard card"]
  node_card_registration["Card serving and registration"]
  node_card["Prayer-time dashboard card<br/>[esolatgps-card.js]"]
end

node_ha_user(("Home Assistant user"))
node_locations["Person and Home GPS"]
node_jakim["waktusolat.app / JAKIM"]
node_aladhan["Aladhan API"]
node_nominatim["Nominatim geocoding"]

node_ha_user -->|"configures"| node_config
node_config -->|"checks availability"| node_jakim
node_config -->|"creates options"| node_integration
node_integration -->|"starts refresh"| node_coordinator
node_integration -->|"registers card"| node_card_registration
node_locations -->|"provides coordinates"| node_coordinator
node_coordinator -->|"resolves zone"| node_zone_lookup
node_zone_lookup -->|"loads polygons"| node_zone_data
node_coordinator -->|"fetches timetables"| node_jakim
node_coordinator -->|"fetches timings"| node_aladhan
node_coordinator -->|"reverse geocodes"| node_nominatim
node_coordinator -->|"supplies update data"| node_sensor_platform
node_sensor_platform -->|"uses base"| node_base_entity
node_integration -->|"forwards sensor setup"| node_sensor_platform
node_diagnostics -->|"reads runtime data"| node_coordinator
node_card_registration -->|"serves script"| node_card
node_ha_user -->|"views dashboard"| node_card
node_card -->|"selects sensor data"| node_sensor_platform
node_coordinator -->|"uses settings"| node_constants
node_config -->|"uses settings"| node_constants

click node_config "https://github.com/zubir2k/homeassistant-esolatgps/blob/main/custom_components/esolatgps/config_flow.py"
click node_integration "https://github.com/zubir2k/homeassistant-esolatgps/blob/main/custom_components/esolatgps/__init__.py"
click node_constants "https://github.com/zubir2k/homeassistant-esolatgps/blob/main/custom_components/esolatgps/const.py"
click node_coordinator "https://github.com/zubir2k/homeassistant-esolatgps/blob/main/custom_components/esolatgps/coordinator.py"
click node_zone_lookup "https://github.com/zubir2k/homeassistant-esolatgps/blob/main/custom_components/esolatgps/zones.py"
click node_zone_data "https://github.com/zubir2k/homeassistant-esolatgps/blob/main/custom_components/esolatgps/data/jakim_zones.json.gz"
click node_sensor_platform "https://github.com/zubir2k/homeassistant-esolatgps/blob/main/custom_components/esolatgps/sensor.py"
click node_base_entity "https://github.com/zubir2k/homeassistant-esolatgps/blob/main/custom_components/esolatgps/entity.py"
click node_diagnostics "https://github.com/zubir2k/homeassistant-esolatgps/blob/main/custom_components/esolatgps/diagnostics.py"
click node_card_registration "https://github.com/zubir2k/homeassistant-esolatgps/blob/main/custom_components/esolatgps/card_registration.py"
click node_card "https://github.com/zubir2k/homeassistant-esolatgps/blob/main/custom_components/esolatgps/frontend/esolatgps-card.js"

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,node_integration,node_constants,node_ha_user toneBlue
class node_coordinator,node_zone_lookup,node_zone_data toneAmber
class node_sensor_platform,node_base_entity,node_diagnostics,node_aladhan toneMint
class node_card_registration,node_card toneRose
class node_locations,node_jakim,node_nominatim toneIndigo
```

## Components

### Setup and lifecycle

- [Config and options flow](https://github.com/zubir2k/homeassistant-esolatgps/blob/main/custom_components/esolatgps/config_flow.py): `custom_components/esolatgps/config_flow.py`
- [Integration lifecycle](https://github.com/zubir2k/homeassistant-esolatgps/blob/main/custom_components/esolatgps/__init__.py): `custom_components/esolatgps/__init__.py`
- [Provider and sensor constants](https://github.com/zubir2k/homeassistant-esolatgps/blob/main/custom_components/esolatgps/const.py): `custom_components/esolatgps/const.py`

### Prayer data

- [Location update coordinator](https://github.com/zubir2k/homeassistant-esolatgps/blob/main/custom_components/esolatgps/coordinator.py): `custom_components/esolatgps/coordinator.py`
- [Offline JAKIM zone lookup](https://github.com/zubir2k/homeassistant-esolatgps/blob/main/custom_components/esolatgps/zones.py): `custom_components/esolatgps/zones.py`
- [Bundled zone polygons](https://github.com/zubir2k/homeassistant-esolatgps/blob/main/custom_components/esolatgps/data/jakim_zones.json.gz): `custom_components/esolatgps/data/jakim_zones.json.gz`

### Home Assistant entities

- [Prayer and diagnostic sensors](https://github.com/zubir2k/homeassistant-esolatgps/blob/main/custom_components/esolatgps/sensor.py): `custom_components/esolatgps/sensor.py`
- [Shared entity base](https://github.com/zubir2k/homeassistant-esolatgps/blob/main/custom_components/esolatgps/entity.py): `custom_components/esolatgps/entity.py`
- [Redacted diagnostics](https://github.com/zubir2k/homeassistant-esolatgps/blob/main/custom_components/esolatgps/diagnostics.py): `custom_components/esolatgps/diagnostics.py`

### Dashboard card

- [Card serving and registration](https://github.com/zubir2k/homeassistant-esolatgps/blob/main/custom_components/esolatgps/card_registration.py): `custom_components/esolatgps/card_registration.py`
- [Prayer-time dashboard card](https://github.com/zubir2k/homeassistant-esolatgps/blob/main/custom_components/esolatgps/frontend/esolatgps-card.js): `custom_components/esolatgps/frontend/esolatgps-card.js`

### Other components

- **Home Assistant user**
- **Person and Home GPS**
- **waktusolat.app / JAKIM**
- **Aladhan API**
- **Nominatim geocoding**

## Connections

- Home Assistant user → Config and options flow: configures (evidence: `README.md`)
- Config and options flow → waktusolat.app / JAKIM: checks availability (evidence: `custom_components/esolatgps/config_flow.py`)
- Config and options flow → Integration lifecycle: creates options (evidence: `README.md`)
- Integration lifecycle → Location update coordinator: starts refresh (evidence: `custom_components/esolatgps/__init__.py`)
- Integration lifecycle → Card serving and registration: registers card (evidence: `custom_components/esolatgps/__init__.py`)
- Person and Home GPS → Location update coordinator: provides coordinates (evidence: `custom_components/esolatgps/coordinator.py`)
- Location update coordinator → Offline JAKIM zone lookup: resolves zone (evidence: `custom_components/esolatgps/coordinator.py`)
- Offline JAKIM zone lookup → Bundled zone polygons: loads polygons (evidence: `custom_components/esolatgps/zones.py`)
- Location update coordinator → waktusolat.app / JAKIM: fetches timetables (evidence: `custom_components/esolatgps/coordinator.py`)
- Location update coordinator → Aladhan API: fetches timings (evidence: `README.md`)
- Location update coordinator → Nominatim geocoding: reverse geocodes (evidence: `README.md`)
- Location update coordinator → Prayer and diagnostic sensors: supplies update data (evidence: `custom_components/esolatgps/sensor.py`)
- Prayer and diagnostic sensors → Shared entity base: uses base (evidence: `custom_components/esolatgps/sensor.py`)
- Integration lifecycle → Prayer and diagnostic sensors: forwards sensor setup (evidence: `custom_components/esolatgps/__init__.py`)
- Redacted diagnostics → Location update coordinator: reads runtime data (evidence: `custom_components/esolatgps/diagnostics.py`)
- Card serving and registration → Prayer-time dashboard card: serves script (evidence: `custom_components/esolatgps/card_registration.py`)
- Home Assistant user → Prayer-time dashboard card: views dashboard (evidence: `README.md`)
- Prayer-time dashboard card → Prayer and diagnostic sensors: selects sensor data (evidence: `README.md`)
- Location update coordinator → Provider and sensor constants: uses settings (evidence: `custom_components/esolatgps/coordinator.py`)
- Config and options flow → Provider and sensor constants: uses settings (evidence: `custom_components/esolatgps/config_flow.py`)
