This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
Dynamic Weather Card is a custom Home Assistant Lovelace card with realistic canvas-based weather animations. Built with Lit (Web Components) and TypeScript, distributed via HACS.
bun install # Install dependencies
bun run dev # Development with watch mode
bun run build # Production build (runs lint first)
bun run lint # Check code style
bun run lint:fix # Auto-fix lint issues
bun run typecheck # TypeScript type checkingNo automated tests. Manual testing via demo.html - open in browser to test various weather conditions and configurations.
See AGENTS.md for detailed architecture documentation. Key points:
- Entry point:
src/index.tsregisterscustom:dynamic-weather-card - Main component:
src/components/card.ts- Lit Element handling UI, canvas, and HA integration - Animation system:
src/animations/- Each weather condition has its own class extendingBaseAnimation - i18n:
src/internationalization/- Singletoni18nobject withi18n.t('key')for translations
- Create class in
src/animations/extendingBaseAnimation - Implement
draw(time, width, height, timeOfDay)method - Register in
card.tsatinitializeAnimations()and add case indraw()method
- Create
src/internationalization/locales/XX/translation.ts - Import in
src/internationalization/index.ts
- Strict TypeScript with ESLint enforcement
- Conventional Commits:
feat:,fix:,docs:,chore: - PRs target
devbranch, notmain - Branch naming:
feature/,fix/,docs/,chore/
Single bundled file: dynamic-weather-card.js (ESM, minified, target: browser)