Initial commit: Add Pstryk Energy Card v4.1.0
- Add main card implementation with full/compact/super_compact modes - Support for sparkline and bars widgets with effects - Price color coding based on best/worst price ranges - Alert system for high/low price thresholds - Polish/English translations support - HACS integration configuration - Development guidelines in AGENTS.md
This commit is contained in:
27
AGENTS.md
Normal file
27
AGENTS.md
Normal file
@ -0,0 +1,27 @@
|
||||
# Agent Guidelines for Pstryk Energy Card
|
||||
|
||||
## Build/Test Commands
|
||||
- No build system - single JavaScript file (`pstryk-card.js`)
|
||||
- Test by adding card to Home Assistant dashboard
|
||||
- Debug mode: set `debug: true` in card config
|
||||
- No linting/formatting tools configured
|
||||
|
||||
## Code Style Guidelines
|
||||
- **Language**: Vanilla JavaScript ES6+ (no frameworks)
|
||||
- **File structure**: Single file with embedded CSS in template literals
|
||||
- **Class naming**: PascalCase (e.g., `PstrykCard`)
|
||||
- **Method naming**: camelCase with underscore prefix for private methods (e.g., `_getTranslations`)
|
||||
- **Variables**: camelCase, use const/let appropriately
|
||||
- **Comments**: Polish comments for user-facing text, English for technical notes
|
||||
- **Error handling**: Throw descriptive Error objects in `setConfig()` for validation
|
||||
- **Translations**: Support PL/EN via `_getTranslations()` method
|
||||
- **CSS**: Use CSS custom properties for theming, embed in `<style>` tags
|
||||
- **SVG**: Inline SVG for charts, use viewBox for responsiveness
|
||||
- **Home Assistant**: Follow custom card conventions, register with `customElements.define()`
|
||||
|
||||
## Key Patterns
|
||||
- Shadow DOM for encapsulation
|
||||
- Lifecycle methods: `connectedCallback()`, `disconnectedCallback()`
|
||||
- Config validation in `setConfig()`
|
||||
- Performance optimization in `set hass()` with change detection
|
||||
- Timer management for hourly refreshes
|
||||
Reference in New Issue
Block a user