### Setup Development Environment Source: https://github.com/thank-you-linus/linus-dashboard/blob/main/scripts/README.md Set up the development environment by creating a Python virtual environment, installing dependencies, and creating a config directory. This is typically the first step for new developers. ```bash ./scripts/setup ``` -------------------------------- ### Start Home Assistant Development Server Source: https://github.com/thank-you-linus/linus-dashboard/blob/main/scripts/README.md Start the Home Assistant development server with local configuration and custom components. Use this to run a local instance for development. ```bash ./scripts/develop ``` -------------------------------- ### Simple Development Server Source: https://github.com/thank-you-linus/linus-dashboard/blob/main/scripts/README.md An alternative, simpler script to start the development server for Home Assistant. ```bash ./scripts/dev ``` -------------------------------- ### Useful Project Commands Source: https://github.com/thank-you-linus/linus-dashboard/blob/main/CONTRIBUTING.md Utility commands for linting, initial setup, and launching Home Assistant in development mode. ```bash # Lint the code scripts/lint # Initial setup (already done automatically) scripts/setup # Launch Home Assistant in development mode scripts/develop ``` -------------------------------- ### Success Output Example Source: https://github.com/thank-you-linus/linus-dashboard/blob/main/docs/LOCAL_CI_TESTING.md Displays when all local CI checks pass successfully. Indicates code is ready for CI/CD. ```text ╔════════════════════════════════════════════════════════════════╗ ║ Summary ║ ╚════════════════════════════════════════════════════════════════╝ ✅ All checks passed! (7/7) 🎉 Your code is ready for CI/CD! ``` -------------------------------- ### Entity State Examples - Will Appear Source: https://github.com/thank-you-linus/linus-dashboard/blob/main/docs/ACTIVITY_DETECTION.md Examples of entities that will automatically appear in the Activity Detection popup. Ensure they are assigned to an area and match the specified device classes or entity types. ```yaml binary_sensor.living_room_motion: device_class: motion area_id: living_room state: "on" ``` ```yaml binary_sensor.desk_occupancy: device_class: occupancy area_id: office state: "off" ``` ```yaml media_player.tv: area_id: living_room state: "playing" ``` -------------------------------- ### ControllerCard Example Usage Source: https://github.com/thank-you-linus/linus-dashboard/blob/main/docs/development/CHIP_SYSTEM_ARCHITECTURE.md Demonstrates creating ControllerCards for floor titles and area subtitles with navigation and control chips. ```typescript // Floor title with chips new ControllerCard({ title: "First Floor", titleIcon: "mdi:floor-plan", titleNavigate: "first_floor", showControls: true, controlChipOptions: { area_slug: "first_floor" } }, "light", "first_floor"); // Area subtitle with chips new ControllerCard({ subtitle: "Living Room", subtitleIcon: "mdi:sofa", subtitleNavigate: "living_room", showControls: true, controlChipOptions: { area_slug: "living_room" } }, "light", "living_room"); ``` -------------------------------- ### AggregateChip Example: Global Light Chip Source: https://github.com/thank-you-linus/linus-dashboard/blob/main/docs/development/CHIP_SYSTEM_ARCHITECTURE.md Creates an AggregateChip to display all lights in the home. Setting `show_content: true` will display the total count of lights. ```typescript // Global light chip (all lights in home) new AggregateChip({ domain: "light", area_slug: "global", show_content: true, // Shows count: "12" }); ``` -------------------------------- ### Install Node.js and Python Dependencies Source: https://github.com/thank-you-linus/linus-dashboard/blob/main/docs/LOCAL_CI_TESTING.md Install project dependencies using npm for Node.js and pip for Python. Ensure these package managers are installed and accessible in your PATH. ```bash # Install Node.js dependencies npm ci # Install Python dependencies python3 -m pip install -r requirements.txt ``` -------------------------------- ### Entity State Examples - Will NOT Appear Source: https://github.com/thank-you-linus/linus-dashboard/blob/main/docs/ACTIVITY_DETECTION.md Examples of entities that will not appear in the Activity Detection popup due to incorrect device class, missing area assignment, or exclusion in configuration. ```yaml binary_sensor.door_sensor: device_class: door # ❌ Wrong device_class area_id: living_room ``` ```yaml binary_sensor.motion_sensor: # ❌ No area assigned device_class: motion ``` ```yaml binary_sensor.excluded_sensor: device_class: motion area_id: living_room # ❌ Domain/device_class excluded in Linus Dashboard config ``` -------------------------------- ### Polished Release Notes Source: https://github.com/thank-you-linus/linus-dashboard/blob/main/docs/AUTOMATED_BETA_RELEASE_PROCESS.md An example of release notes enhanced for user readability, including bold titles, problem statements, and user benefits. ```markdown ### 🐛 Bug Fixes - **Automatically clean up duplicate resource versions to prevent CustomElementRegistry conflicts** Fixed a critical issue where duplicate custom element registrations could cause dashboard loading failures. The system now automatically detects and cleans up duplicate resource versions to ensure smooth operation. - **Eliminate blocking I/O operations in async event loop** Resolved performance issues caused by blocking I/O operations in the async event loop. This fix improves dashboard responsiveness and prevents UI freezing. - **Modernize linting configuration and resolve all CI errors** Updated the linting configuration to use modern standards and fixed all CI pipeline errors, ensuring code quality and consistency. ``` -------------------------------- ### Failure Output Example Source: https://github.com/thank-you-linus/linus-dashboard/blob/main/docs/LOCAL_CI_TESTING.md Displays when local CI checks fail. Provides quick fixes for common issues like ESLint and TypeScript errors. ```text ╔════════════════════════════════════════════════════════════════╗ ║ Summary ║ ╚════════════════════════════════════════════════════════════════╝ ❌ 2 check(s) failed out of 7 💡 Quick fixes: For ESLint issues: npm run lint # Auto-fix most issues npm run lint:check # Check remaining issues For TypeScript issues: npm run type-check # See all type errors # Fix manually in your code editor Re-run this script after fixes: bash scripts/ci-local.sh ``` -------------------------------- ### Home Assistant Area Configuration with Specific Entities Source: https://github.com/thank-you-linus/linus-dashboard/blob/main/docs/AREA_SPECIFIC_ENTITIES.md Provides an example of how to configure a Home Assistant area with specific `temperature_entity_id` and `humidity_entity_id` in the `configuration.yaml` file. ```yaml # Exemple de configuration d'area avec entité spécifique area: - name: "Salon" temperature_entity_id: "sensor.salon_temperature_precise" humidity_entity_id: "sensor.salon_humidity_precise" ``` -------------------------------- ### Code Quality and Dependency Management Source: https://github.com/thank-you-linus/linus-dashboard/blob/main/README.md Commands for running code linters and installing project dependencies. ESLint and Prettier are used for code quality checks. ```bash make lint # Run ESLint and Prettier make install # Install all dependencies ``` -------------------------------- ### Markdown - Feature Highlighting Example Source: https://github.com/thank-you-linus/linus-dashboard/blob/main/docs/development/NOTIFICATION_IMPROVEMENTS.md This markdown snippet demonstrates the recommended way to highlight main feature highlights by using bold text. This practice is crucial for ensuring that key features are immediately visible in release notes and Discord notifications. ```markdown - **Full support for embedding dashboards** directly in Linus Dashboard ``` -------------------------------- ### AggregateChip Example: Bedroom Light Chip Source: https://github.com/thank-you-linus/linus-dashboard/blob/main/docs/development/CHIP_SYSTEM_ARCHITECTURE.md Instantiates an AggregateChip for lights within a specific area, such as a bedroom. This chip will only control and display lights in that designated area. ```typescript // Bedroom light chip new AggregateChip({ domain: "light", area_slug: "bedroom", }); ``` -------------------------------- ### Discord Pre-release Notification Log Source: https://github.com/thank-you-linus/linus-dashboard/blob/main/docs/DISCORD_WEBHOOKS_SETUP.md Example log output when preparing a Discord notification for a pre-release (beta). It shows the type, version, URL, and the webhook URL being used for the beta testers channel. ```log 📢 Preparing Discord notification... Type: prerelease Version: 1.4.1-beta.3 URL: https://github.com/.../releases/tag/1.4.1-beta.3 ✓ Using pre-release webhook → beta testers channel 📄 Using template: discord-prerelease.md ``` -------------------------------- ### Create Security Cards Source: https://github.com/thank-you-linus/linus-dashboard/blob/main/docs/DASHBOARD_ENHANCEMENTS.md Example of creating and adding 'Critical Safety' cards to a dashboard section. This snippet demonstrates dynamic card creation based on sensor data and applies specific heading styles and icons. ```typescript const criticalCards = await createCardsFromList(criticalSensors, {}, "global", "global"); if (criticalCards && criticalCards.length > 0) { globalSection.cards.push({ type: "heading", heading: "🔥 Critical Safety", heading_style: "subtitle", icon: "mdi:fire-alert", }); globalSection.cards.push(...criticalCards); } ``` -------------------------------- ### Perform Enhanced Release Checks Source: https://github.com/thank-you-linus/linus-dashboard/blob/main/docs/RELEASE_GUIDE.md Run the `release:check` command to perform an extensive set of 17 checks before a release. This includes Git status, branch correctness, dependency installation, linting, type checking, build success, and validation of various project files. ```bash release:check ``` -------------------------------- ### AggregateChip Example: Cover Chip for Blinds Source: https://github.com/thank-you-linus/linus-dashboard/blob/main/docs/development/CHIP_SYSTEM_ARCHITECTURE.md Configures an AggregateChip to specifically manage cover entities that have the device class 'blind' within a given area. This allows for targeted control of blinds. ```typescript // Cover chip for blinds only new AggregateChip({ domain: "cover", device_class: "blind", area_slug: "living_room", }); ``` -------------------------------- ### Clone and Open Project Source: https://github.com/thank-you-linus/linus-dashboard/blob/main/CONTRIBUTING.md Clone the repository and open the project in VS Code to begin development. ```bash git clone https://github.com/Thank-you-Linus/Linus-Dashboard.git cd Linus-Dashboard code . ``` -------------------------------- ### Full Release Cycle (Manual Control) Source: https://github.com/thank-you-linus/linus-dashboard/blob/main/docs/RELEASE_GUIDE.md Follow these steps for manual control over the release process. This involves generating notes, editing them, bumping versions, and pushing to GitHub. ```bash # 1. Generate release notes npm run release:notes # 2. Edit RELEASE_NOTES.md (add explanations, translations, mark main features with **) vim RELEASE_NOTES.md # 3. Format release notes for GitHub (optional, done automatically by CI) npm run release:format # 4. Verify everything is ready (optional) npm run release:check # 5. Bump version (choose one) npm run bump:alpha # For alpha testing npm run bump:beta # For beta testing npm run bump:release # For stable release # 6. Push to GitHub git push && git push --tags # 7. Wait for GitHub Actions to complete # 8. For stable releases: Create GitHub release manually # Go to: https://github.com/Thank-you-Linus/Linus-Dashboard/releases/new # 9. For stable releases only: Publish to forums npm run forums:open ``` -------------------------------- ### Frontend Development Commands Source: https://github.com/thank-you-linus/linus-dashboard/blob/main/CONTRIBUTING.md Commands to build the frontend for development or a single build. ```bash # For development with watch mode npm run build-dev # For a single build npm run build ``` -------------------------------- ### Create Beta/Alpha Release Source: https://github.com/thank-you-linus/linus-dashboard/blob/main/scripts/README.md Use these npm scripts to initiate a one-command beta or alpha release. They automate the entire process, including generating notes, testing, version bumping, tagging, and pushing. ```bash npm run create:beta npm run create:alpha ``` -------------------------------- ### Raw Git Commit Messages Source: https://github.com/thank-you-linus/linus-dashboard/blob/main/docs/AUTOMATED_BETA_RELEASE_PROCESS.md Example of raw commit messages generated by Git, typically used for internal tracking. ```markdown ### 🐛 Bug Fixes fix: Automatically clean up duplicate resource versions to prevent CustomElementRegistry conflicts fix: eliminate blocking I/O operations in async event loop fix: modernize linting configuration and resolve all CI errors ``` -------------------------------- ### One-Command Release (Easiest) Source: https://github.com/thank-you-linus/linus-dashboard/blob/main/docs/RELEASE_GUIDE.md Use this script for the simplest release process. It handles multiple steps interactively. ```bash # Create a pre-release (interactive: alpha or beta) npm run create:prerelease # Create a stable release npm run create:release ``` -------------------------------- ### Simulate Pre-Release Workflow Source: https://github.com/thank-you-linus/linus-dashboard/blob/main/docs/LOCAL_CI_TESTING.md Run the pre-release workflow locally. This is useful for testing changes before creating a beta or alpha tag. ```bash npm run test:ci prerelease ``` -------------------------------- ### Create Hotfix Branch Source: https://github.com/thank-you-linus/linus-dashboard/blob/main/docs/development/RELEASE_WORKFLOW.md Use this command to create a new branch for an emergency hotfix, starting from the latest stable release tag. ```bash git checkout -b hotfix/1.4.1 v1.4.0 ``` -------------------------------- ### Simulate Release Workflow Source: https://github.com/thank-you-linus/linus-dashboard/blob/main/docs/LOCAL_CI_TESTING.md Run the release workflow locally. This simulates the checks performed before publishing a stable release. ```bash npm run test:ci release ``` -------------------------------- ### TypeScript Example Fix Source: https://github.com/thank-you-linus/linus-dashboard/blob/main/docs/LOCAL_CI_TESTING.md Illustrates fixing a type error by correctly assigning a potentially null value or handling null cases. ```typescript // ❌ Before (type error) const value: string = someFunction(); // someFunction returns string | null // ✅ After (fixed) const value: string | null = someFunction(); if (value !== null) { // Use value safely } ``` -------------------------------- ### Development Workflow Commands Source: https://github.com/thank-you-linus/linus-dashboard/blob/main/docs/development/ARCHITECTURE_OVERVIEW.md These commands are used for building the project. Use 'make build' for a fast, unminified development build, 'make build-prod' for a minified production build, and 'make build-watch' to automatically rebuild on changes. 'make lint' is mandatory before committing. ```bash make build # Development build (fast, unminified) make build-prod # Production build (minified, optimized) make build-watch # Watch mode (auto-rebuild on changes) make lint # ESLint + Prettier (MANDATORY before commit) ``` -------------------------------- ### Interactive Script for Beta Release (Original) Source: https://github.com/thank-you-linus/linus-dashboard/blob/main/docs/AUTOMATED_BETA_RELEASE_PROCESS.md This command represents the original interactive script for creating a prerelease. Note that it requires manual editing of release notes during execution. ```bash npm run create:prerelease ``` -------------------------------- ### Build Frontend Assets Source: https://github.com/thank-you-linus/linus-dashboard/blob/main/README.md Commands for building the frontend assets for development or production. The watch mode rebuilds automatically on changes. ```bash make build # Build frontend (development) make build-prod # Build frontend (production) make build-watch # Build frontend in watch mode ``` -------------------------------- ### Check Release Readiness Source: https://github.com/thank-you-linus/linus-dashboard/blob/main/scripts/README.md Run 17 pre-release checks to ensure the project is ready for release. This includes smoke tests and other validations. ```bash npm run release:check ``` -------------------------------- ### AggregateChip Example: Cover Chip Without Device Class Source: https://github.com/thank-you-linus/linus-dashboard/blob/main/docs/development/CHIP_SYSTEM_ARCHITECTURE.md Creates an AggregateChip for cover entities that do not have a specific `device_class` assigned. This is useful for managing generic cover devices within an area. ```typescript // Cover chip for entities WITHOUT device_class new AggregateChip({ domain: "cover", device_class: null, // Only entities without device_class area_slug: "living_room", }); ``` -------------------------------- ### Create Pre-release or Stable Release Source: https://github.com/thank-you-linus/linus-dashboard/blob/main/docs/RELEASE_GUIDE.md Use these npm scripts for an automated release process. The pre-release option is interactive, allowing you to choose between alpha or beta. ```bash # For pre-releases (interactive: choose alpha or beta) npm run create:prerelease ``` ```bash # For stable releases npm run create:release ``` -------------------------------- ### Test Before Creating a Release Source: https://github.com/thank-you-linus/linus-dashboard/blob/main/docs/LOCAL_CI_TESTING.md Ensure all checks pass before creating a beta release. This involves running the pre-release workflow locally and then proceeding with the release if successful. ```bash # 1. Run the pre-release workflow checks npm run test:ci prerelease # 2. If everything passes, create the release npm run create:prerelease ``` -------------------------------- ### Discord Stable Release Notification Log Source: https://github.com/thank-you-linus/linus-dashboard/blob/main/docs/DISCORD_WEBHOOKS_SETUP.md Example log output when preparing a Discord notification for a stable release. It indicates the type, version, URL, and the webhook URL used for the main announcements channel. ```log 📢 Preparing Discord notification... Type: release Version: 1.4.1 URL: https://github.com/.../releases/tag/1.4.1 ✓ Using stable release webhook → #annonces channel 📄 Using template: discord-release.md ``` -------------------------------- ### OpenCode Beta Release Command Source: https://github.com/thank-you-linus/linus-dashboard/blob/main/docs/AUTOMATED_BETA_RELEASE_PROCESS.md This is a placeholder for the OpenCode slash command that initiates the automated beta release process. It outlines the sequence of automated actions. ```bash /create-beta-release ``` -------------------------------- ### Get Global Entities Except Undisclosed Source: https://github.com/thank-you-linus/linus-dashboard/blob/main/docs/development/CHIP_SYSTEM_ARCHITECTURE.md Retrieves global entities for a given domain and optional device class, filtering out any entities associated with the 'UNDISCLOSED' area. This function is useful for ensuring that global UI elements do not display entities that are intentionally hidden or not yet disclosed. ```typescript export const getGlobalEntitiesExceptUndisclosed = memoize(function( domain: string, device_class?: string ): string[] { // 1. Get all entities for domain/device_class const domainTag = device_class ? `${domain}:${device_class}` : domain; const entities = device_class === undefined ? getAllDomainEntities(domain) // All variants : Helper.domains[domainTag] ?? []; // 2. Filter out UNDISCLOSED entities return entities.filter(entity => { // For AGGREGATE_DOMAINS without device_class, check all variants if (AGGREGATE_DOMAINS.includes(domain) && !device_class) { // Check base domain (e.g., "cover") if (Helper.areas[UNDISCLOSED]?.domains?.[domain]?.includes(entity.entity_id)) { return false; } // Check all device_class variants (e.g., "cover:blind", "cover:curtain") const deviceClasses = DEVICE_CLASSES[domain] || []; for (const dc of deviceClasses) { const variantTag = `${domain}:${dc}`; if (Helper.areas[UNDISCLOSED]?.domains?.[variantTag]?.includes(entity.entity_id)) { return false; } } return true; } // For other cases, simple filter return !Helper.areas[UNDISCLOSED]?.domains?.[domainTag]?.includes(entity.entity_id); }).map(e => e.entity_id); }); ``` -------------------------------- ### Available NPM Scripts for Release Management Source: https://github.com/thank-you-linus/linus-dashboard/blob/main/docs/RELEASE_GUIDE.md A comprehensive list of NPM scripts available for managing the release process, including one-command releases, manual controls, version management, testing, and publishing. ```bash # 🚀 One-Command Release (Easiest) npm run create:prerelease # Create pre-release (interactive: alpha or beta) npm run create:release # Create complete stable release (one command) # 📝 Release Preparation (Manual Control) npm run release:notes # Generate RELEASE_NOTES.md npm run release:format # Format release notes for GitHub (with collapsible sections) npm run release:validate # Validate RELEASE_NOTES.md npm run release:check # Validate release is ready (17 checks) npm run release:changelog # Generate CHANGELOG.md for HACS # 📦 Version Management (Manual Control) npm run bump:alpha # Bump to alpha version npm run bump:beta # Bump to beta version npm run bump:release # Bump to stable version npm run release:rollback # Rollback a failed release # 🧪 Testing npm run test:smoke # Run smoke tests on build # 📢 Publishing npm run forums:open # Open forum announcement pages ``` -------------------------------- ### Add Domain Configuration Source: https://github.com/thank-you-linus/linus-dashboard/blob/main/docs/development/CHIP_SYSTEM_ARCHITECTURE.md Configure a new domain by adding it to `configurationDefaults.ts`. Ensure `showControls` is set to `true` to enable chips for this domain. ```typescript my_domain: { showControls: true, // Enable chips hidden: false, order: 10, } ``` -------------------------------- ### Simulate All Checks Workflow Source: https://github.com/thank-you-linus/linus-dashboard/blob/main/docs/LOCAL_CI_TESTING.md Run all available checks locally for the most comprehensive testing. This includes all checks from all other workflows. ```bash npm run test:ci all ``` -------------------------------- ### Automated Beta Release Workflow Source: https://github.com/thank-you-linus/linus-dashboard/blob/main/docs/development/RELEASE_WORKFLOW.md This script outlines the steps for developing and committing changes, which then trigger an automated beta release process via GitHub Actions. It covers linting, version incrementing, building, and notifications. ```bash git add . git commit -m "feat: add state-aware badge icons" git push origin main ``` -------------------------------- ### Search Specific Directories by Keyword Source: https://github.com/thank-you-linus/linus-dashboard/blob/main/docs/DOCUMENTATION_MAP.md Utilize grep to search for keywords within specific project directories. This helps narrow down search results to relevant areas like aidriven or docs. ```bash grep -r "chip" .aidriven/ grep -r "release" docs/ ``` -------------------------------- ### Create Stable Release Source: https://github.com/thank-you-linus/linus-dashboard/blob/main/scripts/README.md Initiate a one-command stable release using this npm script. It handles validation, testing, version bumping, tagging, and pushing. ```bash npm run create:release ``` -------------------------------- ### Commit and Format Release Notes Source: https://github.com/thank-you-linus/linus-dashboard/blob/main/docs/AUTOMATED_BETA_RELEASE_PROCESS.md Stages and commits the generated release notes, then formats them for GitHub. This is part of the manual release note preparation process. ```bash git add RELEASE_NOTES.md git commit -m "docs: Prepare release notes for v1.4.0-beta.2" bash scripts/format-release-notes.sh ``` -------------------------------- ### Generate Release Notes Script Source: https://github.com/thank-you-linus/linus-dashboard/blob/main/docs/AUTOMATED_BETA_RELEASE_PROCESS.md Execute this bash script to generate raw release notes from commit history. It identifies commits since the last beta tag and creates a preliminary notes file. ```bash bash scripts/generate-release-notes.sh ``` -------------------------------- ### Priority-based Icon Logic for Activity Detection Source: https://github.com/thank-you-linus/linus-dashboard/blob/main/docs/DASHBOARD_ENHANCEMENTS.md Implements logic to determine the appropriate icon for the activity detection chip based on a priority of sensor types (motion, occupancy, presence, media player). This helps visualize the most relevant activity. ```jinja // Priority: motion > occupancy > presence > media_player const priorityIcon = ` {% set motion_active = [${motion_entities_str}] | select('is_state', 'on') | list | count > 0 %} {% set occupancy_active = [${occupancy_entities_str}] | select('is_state', 'on') | list | count > 0 %} {% set presence_active = [${presence_entities_str}] | select('is_state', 'on') | list | count > 0 %} {% set media_active = [${media_entities_str}] | select('is_state', 'playing') | list | count > 0 %} {% if motion_active %} mdi:motion-sensor {% elif occupancy_active %} mdi:account-check {% elif presence_active %} mdi:radar {% elif media_active %} mdi:cast {% else %} mdi:account-search {% endif %} `; ``` -------------------------------- ### Build Development Version Source: https://github.com/thank-you-linus/linus-dashboard/blob/main/docs/LOCAL_CI_TESTING.md Initiates a development build, which typically provides more detailed error messages for debugging. ```bash npm run build:dev ``` -------------------------------- ### Simulate Main Branch Check Source: https://github.com/thank-you-linus/linus-dashboard/blob/main/docs/LOCAL_CI_TESTING.md Run the default main branch check workflow locally. This includes linting, type checking, building, and smoke tests. ```bash npm run test:ci main-check ``` -------------------------------- ### Run Local CI Checks Source: https://github.com/thank-you-linus/linus-dashboard/blob/main/docs/development/RELEASE_WORKFLOW.md Execute linting, type checking, and build processes locally to catch issues before pushing to CI. Fix all linting errors before proceeding. ```bash # Run all checks npm run lint # MANDATORY - Fix all errors before proceeding npm run type-check # TypeScript validation npm run build # Production build # If all pass, you're ready to push git push origin main ``` -------------------------------- ### Run Smoke Tests Source: https://github.com/thank-you-linus/linus-dashboard/blob/main/scripts/README.md Execute pre-release validation tests, which include 17 checks such as build output, versions, manifests, and Python syntax. Called automatically by create-* scripts and CI/CD. ```bash npm run test:smoke ``` -------------------------------- ### Run Local CI Tests Before Pushing Source: https://github.com/thank-you-linus/linus-dashboard/blob/main/docs/LOCAL_CI_TESTING.md Execute local CI tests and then push your changes if they pass. This ensures code quality before it reaches the main branch. ```bash npm run test:ci && git push ``` -------------------------------- ### Release Workflow Diagram Source: https://github.com/thank-you-linus/linus-dashboard/blob/main/docs/development/RELEASE_WORKFLOW.md Visual representation of the typical release cycle from development to stable release and announcement. ```mermaid graph LR DEV[Develop Feature] --> COMMIT[Commit to main] COMMIT --> AUTO[Auto Beta Release] AUTO --> TEST[Community Testing] TEST --> BUG{Bugs Found?} BUG -->|Yes| FIX[Fix Bugs] FIX --> COMMIT BUG -->|No| STABLE[Stable Release] STABLE --> ANNOUNCE[Announce on Forums] ``` -------------------------------- ### Mermaid Sequence Diagram for Linus Integration Data Flow Source: https://github.com/thank-you-linus/linus-dashboard/blob/main/docs/development/ARCHITECTURE_OVERVIEW.md Visualizes the sequence of interactions between User, Home Assistant, Linus Integration, Frontend Strategy, Registry Manager, Strategy Engine, and View Classes during the dashboard's operation. This diagram illustrates how data is fetched, processed, and rendered. ```mermaid sequenceDiagram participant User participant HA as Home Assistant participant INT as Linus Integration participant FE as Frontend Strategy participant REG as RegistryManager participant STRAT as Strategy Engine participant VIEW as View Classes User->>HA: Install Linus via HACS HA->>INT: Load integration (__init__.py) INT->>HA: Register static resources (/linus-strategy.js?v=1.4.0) User->>HA: Add Linus Dashboard integration INT->>INT: Run config flow INT->>HA: Save configuration (weather, alarm entities) User->>HA: Open Linus Dashboard HA->>FE: Load frontend bundle FE->>REG: Request entities via hass.states REG->>HA: Fetch all entities HA-->>REG: Return entity list REG->>REG: Filter & organize entities REG-->>STRAT: Provide organized data STRAT->>STRAT: Generate views based on areas STRAT->>VIEW: Instantiate HomeView, AreaViews, DomainViews VIEW->>VIEW: Generate cards & chips VIEW-->>FE: Return dashboard config FE->>User: Render organized dashboard ``` -------------------------------- ### Search Markdown Files by Keyword Source: https://github.com/thank-you-linus/linus-dashboard/blob/main/docs/DOCUMENTATION_MAP.md Use grep to search for a specific keyword across all markdown files in the docs directory. This is useful for quickly locating relevant documentation sections. ```bash grep -r "keyword" docs/ ``` -------------------------------- ### Make Pre-Push Hook Executable Source: https://github.com/thank-you-linus/linus-dashboard/blob/main/docs/LOCAL_CI_TESTING.md Command to make the pre-push Git hook script executable. This is required for the hook to run automatically. ```bash chmod +x .git/hooks/pre-push ``` -------------------------------- ### Add show_content to AggregateChip Constructor Source: https://github.com/thank-you-linus/linus-dashboard/blob/main/docs/development/CHIP_SYSTEM_ARCHITECTURE.md This snippet shows how to add `show_content: true` to the AggregateChip constructor to fix missing entity counts in global badges. Ensure this is passed when initializing AggregateChip in domain views. ```typescript const aggregateChip = new AggregateChip({ domain: this.domain, area_slug: "global", translationKey: "cover", activeStates: ["open", "opening"], features: [], show_content: true, // ← Added this }); ``` -------------------------------- ### Generate Release Notes Source: https://github.com/thank-you-linus/linus-dashboard/blob/main/scripts/README.md Generate the RELEASE_NOTES.md file from git commits using this npm script. It's automatically called by the create-* scripts. ```bash npm run release:notes ``` -------------------------------- ### Sync Dependencies Source: https://github.com/thank-you-linus/linus-dashboard/blob/main/scripts/README.md Sync versions between package.json and package-lock.json to ensure consistency. Run this script after updating dependencies. ```bash npm run sync:deps ``` -------------------------------- ### Package.json - Release Script Addition Source: https://github.com/thank-you-linus/linus-dashboard/blob/main/docs/development/NOTIFICATION_IMPROVEMENTS.md This JSON file defines the project's npm scripts. A new script, 'release:format', has been added to execute the bash script for formatting release notes. ```json { "name": "linus-dashboard", "version": "1.0.0", "scripts": { "release:notes": "npm run release:notes", "release:format": "bash scripts/format-release-notes.sh" // ... other scripts ... } // ... other package.json content ... } ``` -------------------------------- ### Bump to Stable Version Source: https://github.com/thank-you-linus/linus-dashboard/blob/main/docs/RELEASE_GUIDE.md Update the project version to a stable release by removing any pre-release suffixes. ```bash npm run bump:release ``` -------------------------------- ### Create Domain View with Global Chip Source: https://github.com/thank-you-linus/linus-dashboard/blob/main/docs/development/CHIP_SYSTEM_ARCHITECTURE.md Implement a domain view by extending `AbstractView` and defining `createSectionBadges`. This includes adding a global aggregate chip and a refresh chip. ```typescript class MyDomainView extends AbstractView { createSectionBadges(): LovelaceBadgeConfig[] { const badges: LovelaceBadgeConfig[] = []; // Global chip const aggregateChip = new AggregateChip({ domain: "my_domain", area_slug: "global", show_content: true, }); if (aggregateChip.getChip()) { badges.push({ type: "custom:mushroom-chips-card", chips: [aggregateChip.getChip()], alignment: "end" }); } // Refresh chip (centered) badges.push({ type: "custom:mushroom-chips-card", chips: [new RefreshChip().getChip()], alignment: "center" }); return badges; } } ``` -------------------------------- ### Bump Beta Version Script Source: https://github.com/thank-you-linus/linus-dashboard/blob/main/docs/AUTOMATED_BETA_RELEASE_PROCESS.md Automates the process of bumping the version to the next beta release. It prompts for confirmation and updates the version number. ```bash printf "y\n" | bash scripts/bump-version.sh beta ``` -------------------------------- ### Map Domains to Icons Source: https://github.com/thank-you-linus/linus-dashboard/blob/main/docs/development/CHIP_SYSTEM_ARCHITECTURE.md Provides a mapping from domain names to their corresponding Material Design Icons for consistent visual representation. ```typescript const DOMAIN_ICONS = { light: "mdi:lightbulb", climate: "mdi:thermostat", cover: "mdi:window-shutter", fan: "mdi:fan", switch: "mdi:light-switch", media_player: "mdi:cast", // ... more domains }; ```