Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,30 @@ showcase updates itself. (Manual local regen still works too; the sandbox needs

Newest first. One short entry per working session: what shipped + open threads.

### 2026-07-21 — Sun card: AstroWeather moon data + azimuth positioning (v0.17.1)
- **User:** add "next full moon", "next dark night", and make the moon graphic
reflect the moon azimuth — data from the AstroWeather integration
(mawinkler/astroweather).
- `_moonView` now positions the moon glyph on the sky **by azimuth**: a dedicated
`moon_azimuth_entity` (or an `azimuth`/`moon_azimuth` attribute on the moon
sensor) maps E(90)→S(180)→W(270) to left→top→right along a dome; `moon_altitude`
(when present as an attr) scales how high it rides. No azimuth → centred disk
fallback. Verified E/S/W → cx 40/100/160.
- Added chips below the ends row: moonrise ↑ / moonset ↓ (moved off the old
subrow), **Full in Xd** (`next_full_moon_entity`, a timestamp via `relFuture`),
and **Dark …** (`next_dark_night_entity` — a timestamp → "in Xh", or a duration
sensor like AstroWeather `deep_sky_darkness` → "6.2 h"). Fixed a `relFuture`
rollover bug ("4d 24h" → "5d"; minute carry too).
- `getGridOptions`/`getCardSize` bump to **4 rows** when any optional moon sensor
is set (room for the chip row); 3 otherwise. New config keys: `moon_azimuth_entity`,
`next_full_moon_entity`, `next_dark_night_entity` (+ existing moonrise/moonset/
illumination). Editor Moon section extended + hint mentions AstroWeather.
- Wired smoke (moon azimuth/next-full-moon/deep-sky-darkness fixtures + case) and
preview (Sun & Moon demo now passes all sensors). README + docs/cards.md option
table, AstroWeather example, sizing note. VERSION 0.17.0 → 0.17.1. Verified in
Chromium (azimuth placement, chips, 4-row grid, no console errors); build +
smoke green.

### 2026-07-21 — Sun card: moon-phase view after sunset (v0.17.0)
- **User:** refactor the sun card to also show moon phases / rise / set, with an
option to show the moon info after sunset. Kept the daytime sun-path arc as-is
Expand Down
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -236,8 +236,12 @@ title: Sun
accent: amber
show_moon: true # after sunset: moon phase + illumination
moon_entity: sensor.moon # optional (defaults to sensor.moon)
# moonrise_entity: sensor.moonrise # optional
# moonset_entity: sensor.moonset # optional
# Optional (AstroWeather): azimuth positions the moon; plus full-moon / dark-night chips
# moon_azimuth_entity: sensor.astroweather_moon_azimuth
# moonrise_entity: sensor.astroweather_moonrise
# moonset_entity: sensor.astroweather_moonset
# next_full_moon_entity: sensor.astroweather_moon_next_full_moon
# next_dark_night_entity: sensor.astroweather_deep_sky_darkness
```

```yaml
Expand Down
29 changes: 24 additions & 5 deletions docs/cards.md
Original file line number Diff line number Diff line change
Expand Up @@ -544,7 +544,7 @@ units: us

Flat **sun-path arc**: a dome of the sky from sunrise to sunset with the sun riding along it, the **traveled portion filled with the accent**, **sunrise/sunset times** at each end, and a live **"sets in / rises in"** countdown in the middle.

Optionally, **after sunset** it flips to a **moon view**: a moon-phase glyph drawn to the current illuminated fraction, the phase name + **illumination %**, the next **sunrise**, and — when their sensors are configured — **moonrise / moonset**.
Optionally, **after sunset** it flips to a **moon view**: a moon-phase glyph drawn to the current illuminated fraction and **positioned on the sky by the moon's azimuth**, the phase name + **illumination %**, the next **sunrise**, and chips for **moonrise / moonset**, **next full moon**, and **next dark night** when their sensors are configured.

| Key | Type | Default | Notes |
|-----|------|---------|-------|
Expand All @@ -553,11 +553,16 @@ Optionally, **after sunset** it flips to a **moon view**: a moon-phase glyph dra
| `title` | string | — | Card header. |
| `accent` | string | `amber` | Colours the traveled arc and the sun. |
| `show_moon` | bool | `true` | After sunset, show the moon view instead of the resting sun arc. |
| `moon_entity` | string | `sensor.moon` | Moon-phase sensor (the Moon integration's `sensor.moon`). Its state is a phase name like `waxing_gibbous`, or a numeric phase. |
| `moonrise_entity` | string | — | Optional sensor with a moonrise timestamp. |
| `moonset_entity` | string | — | Optional sensor with a moonset timestamp. |
| `moon_entity` | string | `sensor.moon` | Moon-phase sensor (the Moon integration's `sensor.moon`). State is a phase name like `waxing_gibbous`, or a numeric phase. |
| `moon_azimuth_entity` | string | — | Optional azimuth sensor (degrees) — positions the moon on the sky (E→S→W maps left→top→right). Also read from an `azimuth`/`moon_azimuth` attribute on the moon sensor. AstroWeather: `moon_azimuth`. |
| `moonrise_entity` | string | — | Optional moonrise timestamp sensor. |
| `moonset_entity` | string | — | Optional moonset timestamp sensor. |
| `next_full_moon_entity` | string | — | Optional timestamp sensor → a "Full in Xd" chip. AstroWeather: `moon_next_full_moon`. |
| `next_dark_night_entity` | string | — | Optional. A timestamp → "Dark in Xh", or a duration sensor (e.g. AstroWeather `deep_sky_darkness` hours) → "Dark 6.2 h". |
| `moon_illumination_entity` | string | — | Optional illumination-% sensor. If unset, illumination is computed from the phase. |

The azimuth / next-full-moon / dark-night values are designed to pair with the **[AstroWeather](https://github.com/mawinkler/astroweather)** integration, but any sensor providing those works. When any of the optional moon sensors are set, the tile is one grid row taller to fit the chip row.

Daytime progress uses the next setting as today's sunset and approximates today's sunrise from the next rising. At night, with `show_moon` on and a moon sensor available, the card shows the moon phase; otherwise the arc rests with a moon on the horizon. Tap opens more-info.

```yaml
Expand All @@ -579,6 +584,20 @@ moonrise_entity: sensor.moonrise # optional
moonset_entity: sensor.moonset # optional
```

```yaml
# Full moon view with AstroWeather sensors.
type: custom:prism-sun-card
entity: sun.sun
title: Sun & Moon
accent: amber
moon_entity: sensor.astroweather_moon_phase
moon_azimuth_entity: sensor.astroweather_moon_azimuth
moonrise_entity: sensor.astroweather_moonrise
moonset_entity: sensor.astroweather_moonset
next_full_moon_entity: sensor.astroweather_moon_next_full_moon
next_dark_night_entity: sensor.astroweather_deep_sky_darkness
```

---

## `custom:prism-uv-card`
Expand Down Expand Up @@ -730,7 +749,7 @@ Cards implement `getGridOptions()` for the sections layout:
| Wind | 3 | 6 |
| Weather | 3 | 6 |
| Forecast | 3 | 12 |
| Sun | 3 | 6 |
| Sun | 3 (4 with moon chips) | 6 |
| UV | 3 | 6 |
| Rain | 3 | 6 |
| Air Quality | 3 | 6 |
Expand Down
Loading
Loading