Files
mushroom-strategy/contributing/index.html
T
2025-05-28 18:05:59 +00:00

1099 lines
34 KiB
HTML

<!doctype html>
<html lang="en" class="no-js">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<meta name="description" content="The official documentation for Home Assistant's Mushroom Dashboard Strategy.">
<meta name="author" content="Ferry Cools">
<link rel="canonical" href="https://digilive.github.io/mushroom-strategy/contributing/">
<link rel="prev" href="../faq/">
<link rel="icon" href="../assets/images/favicon.png">
<meta name="generator" content="mkdocs-1.6.1, mkdocs-material-9.6.14">
<title>Contributing - Mushroom Strategy Documentation</title>
<link rel="stylesheet" href="../assets/stylesheets/main.342714a4.min.css">
<link rel="stylesheet" href="../assets/stylesheets/palette.06af60db.min.css">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,300i,400,400i,700,700i%7CRoboto+Mono:400,400i,700,700i&display=fallback">
<style>:root{--md-text-font:"Roboto";--md-code-font:"Roboto Mono"}</style>
<link rel="stylesheet" href="../stylesheets/extra.css">
<script>__md_scope=new URL("..",location),__md_hash=e=>[...e].reduce(((e,_)=>(e<<5)-e+_.charCodeAt(0)),0),__md_get=(e,_=localStorage,t=__md_scope)=>JSON.parse(_.getItem(t.pathname+"."+e)),__md_set=(e,_,t=localStorage,a=__md_scope)=>{try{t.setItem(a.pathname+"."+e,JSON.stringify(_))}catch(e){}}</script>
</head>
<body dir="ltr" data-md-color-scheme="default" data-md-color-primary="blue" data-md-color-accent="light-blue">
<input class="md-toggle" data-md-toggle="drawer" type="checkbox" id="__drawer" autocomplete="off">
<input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off">
<label class="md-overlay" for="__drawer"></label>
<div data-md-component="skip">
<a href="#contributing-to-mushroom-strategy" class="md-skip">
Skip to content
</a>
</div>
<div data-md-component="announce">
</div>
<header class="md-header" data-md-component="header">
<nav class="md-header__inner md-grid" aria-label="Header">
<a href=".." title="Mushroom Strategy Documentation" class="md-header__button md-logo" aria-label="Mushroom Strategy Documentation" data-md-component="logo">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 2a10 10 0 0 1 10 10 2 2 0 0 1-2 2H4a2 2 0 0 1-2-2A10 10 0 0 1 12 2m0 6a2 2 0 0 0 2-2 2 2 0 0 0-2-2 2 2 0 0 0-2 2 2 2 0 0 0 2 2m5 4a2 2 0 0 0 2-2 2 2 0 0 0-2-2 2 2 0 0 0-2 2 2 2 0 0 0 2 2M7 12a2 2 0 0 0 2-2 2 2 0 0 0-2-2 2 2 0 0 0-2 2 2 2 0 0 0 2 2m8 3 1.27 4.45.08.55c0 1.1-.9 2-2 2h-4.7a2 2 0 0 1-2-2l.08-.55L9 15z"/></svg>
</a>
<label class="md-header__button md-icon" for="__drawer">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M3 6h18v2H3zm0 5h18v2H3zm0 5h18v2H3z"/></svg>
</label>
<div class="md-header__title" data-md-component="header-title">
<div class="md-header__ellipsis">
<div class="md-header__topic">
<span class="md-ellipsis">
Mushroom Strategy Documentation
</span>
</div>
<div class="md-header__topic" data-md-component="header-topic">
<span class="md-ellipsis">
Contributing
</span>
</div>
</div>
</div>
<form class="md-header__option" data-md-component="palette">
<input class="md-option" data-md-color-media="(prefers-color-scheme: light)" data-md-color-scheme="default" data-md-color-primary="blue" data-md-color-accent="light-blue" aria-label="Switch to dark mode" type="radio" name="__palette" id="__palette_0">
<label class="md-header__button md-icon" title="Switch to dark mode" for="__palette_1" hidden>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 8a4 4 0 0 0-4 4 4 4 0 0 0 4 4 4 4 0 0 0 4-4 4 4 0 0 0-4-4m0 10a6 6 0 0 1-6-6 6 6 0 0 1 6-6 6 6 0 0 1 6 6 6 6 0 0 1-6 6m8-9.31V4h-4.69L12 .69 8.69 4H4v4.69L.69 12 4 15.31V20h4.69L12 23.31 15.31 20H20v-4.69L23.31 12z"/></svg>
</label>
<input class="md-option" data-md-color-media="(prefers-color-scheme: dark)" data-md-color-scheme="slate" data-md-color-primary="blue" data-md-color-accent="light-blue" aria-label="Switch to light mode" type="radio" name="__palette" id="__palette_1">
<label class="md-header__button md-icon" title="Switch to light mode" for="__palette_2" hidden>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 18c-.89 0-1.74-.2-2.5-.55C11.56 16.5 13 14.42 13 12s-1.44-4.5-3.5-5.45C10.26 6.2 11.11 6 12 6a6 6 0 0 1 6 6 6 6 0 0 1-6 6m8-9.31V4h-4.69L12 .69 8.69 4H4v4.69L.69 12 4 15.31V20h4.69L12 23.31 15.31 20H20v-4.69L23.31 12z"/></svg>
</label>
<input class="md-option" data-md-color-media="(prefers-color-scheme)" data-md-color-scheme="default" data-md-color-primary="indigo" data-md-color-accent="indigo" aria-label="Switch to light/dark mode (auto)" type="radio" name="__palette" id="__palette_2">
<label class="md-header__button md-icon" title="Switch to light/dark mode (auto)" for="__palette_0" hidden>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="m14.3 16-.7-2h-3.2l-.7 2H7.8L11 7h2l3.2 9zM20 8.69V4h-4.69L12 .69 8.69 4H4v4.69L.69 12 4 15.31V20h4.69L12 23.31 15.31 20H20v-4.69L23.31 12zm-9.15 3.96h2.3L12 9z"/></svg>
</label>
</form>
<script>var palette=__md_get("__palette");if(palette&&palette.color){if("(prefers-color-scheme)"===palette.color.media){var media=matchMedia("(prefers-color-scheme: light)"),input=document.querySelector(media.matches?"[data-md-color-media='(prefers-color-scheme: light)']":"[data-md-color-media='(prefers-color-scheme: dark)']");palette.color.media=input.getAttribute("data-md-color-media"),palette.color.scheme=input.getAttribute("data-md-color-scheme"),palette.color.primary=input.getAttribute("data-md-color-primary"),palette.color.accent=input.getAttribute("data-md-color-accent")}for(var[key,value]of Object.entries(palette.color))document.body.setAttribute("data-md-color-"+key,value)}</script>
<label class="md-header__button md-icon" for="__search">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M9.5 3A6.5 6.5 0 0 1 16 9.5c0 1.61-.59 3.09-1.56 4.23l.27.27h.79l5 5-1.5 1.5-5-5v-.79l-.27-.27A6.52 6.52 0 0 1 9.5 16 6.5 6.5 0 0 1 3 9.5 6.5 6.5 0 0 1 9.5 3m0 2C7 5 5 7 5 9.5S7 14 9.5 14 14 12 14 9.5 12 5 9.5 5"/></svg>
</label>
<div class="md-search" data-md-component="search" role="dialog">
<label class="md-search__overlay" for="__search"></label>
<div class="md-search__inner" role="search">
<form class="md-search__form" name="search">
<input type="text" class="md-search__input" name="query" aria-label="Search" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="search-query" required>
<label class="md-search__icon md-icon" for="__search">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M9.5 3A6.5 6.5 0 0 1 16 9.5c0 1.61-.59 3.09-1.56 4.23l.27.27h.79l5 5-1.5 1.5-5-5v-.79l-.27-.27A6.52 6.52 0 0 1 9.5 16 6.5 6.5 0 0 1 3 9.5 6.5 6.5 0 0 1 9.5 3m0 2C7 5 5 7 5 9.5S7 14 9.5 14 14 12 14 9.5 12 5 9.5 5"/></svg>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20 11v2H8l5.5 5.5-1.42 1.42L4.16 12l7.92-7.92L13.5 5.5 8 11z"/></svg>
</label>
<nav class="md-search__options" aria-label="Search">
<button type="reset" class="md-search__icon md-icon" title="Clear" aria-label="Clear" tabindex="-1">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"/></svg>
</button>
</nav>
<div class="md-search__suggest" data-md-component="search-suggest"></div>
</form>
<div class="md-search__output">
<div class="md-search__scrollwrap" tabindex="0" data-md-scrollfix>
<div class="md-search-result" data-md-component="search-result">
<div class="md-search-result__meta">
Initializing search
</div>
<ol class="md-search-result__list" role="presentation"></ol>
</div>
</div>
</div>
</div>
</div>
<div class="md-header__source">
<a href="https://github.com/DigiLive/mushroom-strategy/" title="Go to repository" class="md-source" data-md-component="source">
<div class="md-source__icon md-icon">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><!--! Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2024 Fonticons, Inc.--><path d="M439.55 236.05 244 40.45a28.87 28.87 0 0 0-40.81 0l-40.66 40.63 51.52 51.52c27.06-9.14 52.68 16.77 43.39 43.68l49.66 49.66c34.23-11.8 61.18 31 35.47 56.69-26.49 26.49-70.21-2.87-56-37.34L240.22 199v121.85c25.3 12.54 22.26 41.85 9.08 55a34.34 34.34 0 0 1-48.55 0c-17.57-17.6-11.07-46.91 11.25-56v-123c-20.8-8.51-24.6-30.74-18.64-45L142.57 101 8.45 235.14a28.86 28.86 0 0 0 0 40.81l195.61 195.6a28.86 28.86 0 0 0 40.8 0l194.69-194.69a28.86 28.86 0 0 0 0-40.81"/></svg>
</div>
<div class="md-source__repository">
GitHub
</div>
</a>
</div>
</nav>
</header>
<div class="md-container" data-md-component="container">
<nav class="md-tabs" aria-label="Tabs" data-md-component="tabs">
<div class="md-grid">
<ul class="md-tabs__list">
<li class="md-tabs__item">
<a href=".." class="md-tabs__link">
Home
</a>
</li>
<li class="md-tabs__item">
<a href="../getting-started/installation/" class="md-tabs__link">
Getting Started
</a>
</li>
<li class="md-tabs__item">
<a href="../options/" class="md-tabs__link">
Strategy Options
</a>
</li>
<li class="md-tabs__item">
<a href="../faq/" class="md-tabs__link">
FAQ
</a>
</li>
<li class="md-tabs__item md-tabs__item--active">
<a href="./" class="md-tabs__link">
Contributing
</a>
</li>
</ul>
</div>
</nav>
<main class="md-main" data-md-component="main">
<div class="md-main__inner md-grid">
<div class="md-sidebar md-sidebar--primary" data-md-component="sidebar" data-md-type="navigation" >
<div class="md-sidebar__scrollwrap">
<div class="md-sidebar__inner">
<nav class="md-nav md-nav--primary md-nav--lifted md-nav--integrated" aria-label="Navigation" data-md-level="0">
<label class="md-nav__title" for="__drawer">
<a href=".." title="Mushroom Strategy Documentation" class="md-nav__button md-logo" aria-label="Mushroom Strategy Documentation" data-md-component="logo">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 2a10 10 0 0 1 10 10 2 2 0 0 1-2 2H4a2 2 0 0 1-2-2A10 10 0 0 1 12 2m0 6a2 2 0 0 0 2-2 2 2 0 0 0-2-2 2 2 0 0 0-2 2 2 2 0 0 0 2 2m5 4a2 2 0 0 0 2-2 2 2 0 0 0-2-2 2 2 0 0 0-2 2 2 2 0 0 0 2 2M7 12a2 2 0 0 0 2-2 2 2 0 0 0-2-2 2 2 0 0 0-2 2 2 2 0 0 0 2 2m8 3 1.27 4.45.08.55c0 1.1-.9 2-2 2h-4.7a2 2 0 0 1-2-2l.08-.55L9 15z"/></svg>
</a>
Mushroom Strategy Documentation
</label>
<div class="md-nav__source">
<a href="https://github.com/DigiLive/mushroom-strategy/" title="Go to repository" class="md-source" data-md-component="source">
<div class="md-source__icon md-icon">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><!--! Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2024 Fonticons, Inc.--><path d="M439.55 236.05 244 40.45a28.87 28.87 0 0 0-40.81 0l-40.66 40.63 51.52 51.52c27.06-9.14 52.68 16.77 43.39 43.68l49.66 49.66c34.23-11.8 61.18 31 35.47 56.69-26.49 26.49-70.21-2.87-56-37.34L240.22 199v121.85c25.3 12.54 22.26 41.85 9.08 55a34.34 34.34 0 0 1-48.55 0c-17.57-17.6-11.07-46.91 11.25-56v-123c-20.8-8.51-24.6-30.74-18.64-45L142.57 101 8.45 235.14a28.86 28.86 0 0 0 0 40.81l195.61 195.6a28.86 28.86 0 0 0 40.8 0l194.69-194.69a28.86 28.86 0 0 0 0-40.81"/></svg>
</div>
<div class="md-source__repository">
GitHub
</div>
</a>
</div>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href=".." class="md-nav__link">
<span class="md-ellipsis">
Home
</span>
</a>
</li>
<li class="md-nav__item md-nav__item--nested">
<input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_2" >
<label class="md-nav__link" for="__nav_2" id="__nav_2_label" tabindex="0">
<span class="md-ellipsis">
Getting Started
</span>
<span class="md-nav__icon md-icon"></span>
</label>
<nav class="md-nav" data-md-level="1" aria-labelledby="__nav_2_label" aria-expanded="false">
<label class="md-nav__title" for="__nav_2">
<span class="md-nav__icon md-icon"></span>
Getting Started
</label>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="../getting-started/installation/" class="md-nav__link">
<span class="md-ellipsis">
Installation
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../getting-started/basic-setup/" class="md-nav__link">
<span class="md-ellipsis">
Basic Setup
</span>
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item md-nav__item--nested">
<input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_3" >
<label class="md-nav__link" for="__nav_3" id="__nav_3_label" tabindex="0">
<span class="md-ellipsis">
Strategy Options
</span>
<span class="md-nav__icon md-icon"></span>
</label>
<nav class="md-nav" data-md-level="1" aria-labelledby="__nav_3_label" aria-expanded="false">
<label class="md-nav__title" for="__nav_3">
<span class="md-nav__icon md-icon"></span>
Strategy Options
</label>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="../options/" class="md-nav__link">
<span class="md-ellipsis">
Overview
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../options/area-options/" class="md-nav__link">
<span class="md-ellipsis">
Area Options
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../options/card-options/" class="md-nav__link">
<span class="md-ellipsis">
Card Options
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../options/domain-options/" class="md-nav__link">
<span class="md-ellipsis">
Domain Options
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../options/home-view-options/" class="md-nav__link">
<span class="md-ellipsis">
Home View Options
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../options/view-options/" class="md-nav__link">
<span class="md-ellipsis">
View Options
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../full-example/" class="md-nav__link">
<span class="md-ellipsis">
Full Example
</span>
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item">
<a href="../faq/" class="md-nav__link">
<span class="md-ellipsis">
FAQ
</span>
</a>
</li>
<li class="md-nav__item md-nav__item--active">
<input class="md-nav__toggle md-toggle" type="checkbox" id="__toc">
<label class="md-nav__link md-nav__link--active" for="__toc">
<span class="md-ellipsis">
Contributing
</span>
<span class="md-nav__icon md-icon"></span>
</label>
<a href="./" class="md-nav__link md-nav__link--active">
<span class="md-ellipsis">
Contributing
</span>
</a>
<nav class="md-nav md-nav--secondary" aria-label="Table of contents">
<label class="md-nav__title" for="__toc">
<span class="md-nav__icon md-icon"></span>
Table of contents
</label>
<ul class="md-nav__list" data-md-component="toc" data-md-scrollfix>
<li class="md-nav__item">
<a href="#code-of-conduct" class="md-nav__link">
<span class="md-ellipsis">
📜 Code of Conduct
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#reporting-bugs" class="md-nav__link">
<span class="md-ellipsis">
🐞 Reporting Bugs
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#suggesting-features" class="md-nav__link">
<span class="md-ellipsis">
✨ Suggesting Features
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#contributing-code" class="md-nav__link">
<span class="md-ellipsis">
💻 Contributing Code
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#improving-documentation" class="md-nav__link">
<span class="md-ellipsis">
📄 Improving Documentation
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#translations" class="md-nav__link">
<span class="md-ellipsis">
🌐 Translations
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#get-support" class="md-nav__link">
<span class="md-ellipsis">
🙏 Get Support
</span>
</a>
</li>
</ul>
</nav>
</li>
</ul>
</nav>
</div>
</div>
</div>
<div class="md-content" data-md-component="content">
<article class="md-content__inner md-typeset">
<a href="https://github.com/DigiLive/mushroom-strategy/edit/main/docs/contributing.md" title="Edit this page" class="md-content__button md-icon">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M10 20H6V4h7v5h5v3.1l2-2V8l-6-6H6c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h4zm10.2-7c.1 0 .3.1.4.2l1.3 1.3c.2.2.2.6 0 .8l-1 1-2.1-2.1 1-1c.1-.1.2-.2.4-.2m0 3.9L14.1 23H12v-2.1l6.1-6.1z"/></svg>
</a>
<h1 id="contributing-to-mushroom-strategy">🤝 Contributing to Mushroom Strategy<a class="headerlink" href="#contributing-to-mushroom-strategy" title="Permanent link">#</a></h1>
<p>We love contributions from the community! Whether you're reporting a bug, suggesting a new feature, or submitting code
changes, your help makes the Mushroom Strategy better for everyone.</p>
<p>Please take a moment to review this guide before making a contribution.</p>
<h2 id="code-of-conduct">📜 Code of Conduct<a class="headerlink" href="#code-of-conduct" title="Permanent link">#</a></h2>
<p>To ensure a welcoming and inclusive environment, all contributors are expected to adhere to
our <a href="https://github.com/DigiLive/mushroom-strategy/blob/main/CODE_OF_CONDUCT.md">Code of Conduct</a>. Please read it
carefully.</p>
<hr />
<h2 id="reporting-bugs">🐞 Reporting Bugs<a class="headerlink" href="#reporting-bugs" title="Permanent link">#</a></h2>
<p>Found a bug? That's not ideal, but your report helps us squash it!</p>
<ol>
<li><strong>Check existing issues:</strong> Before opening a new issue, please search
our GitHub <a href="https://github.com/DigiLive/mushroom-strategy/issues">Issues</a>
or <a href="https://github.com/DigiLive/mushroom-strategy/discussions">Discussions</a> to see if the bug has already been
reported.</li>
<li><strong>Open a new issue:</strong> If it's a new bug, please open
a <a href="https://github.com/DigiLive/mushroom-strategy/issues/new?template=bug_report.yml">new issue</a>.</li>
<li>
<p><strong>Provide details:</strong> In your report, please include:</p>
</li>
<li>
<p>A clear and concise description of the bug.</p>
</li>
<li>Steps to reproduce the behavior.</li>
<li>Expected behavior.</li>
<li>Screenshots or animated GIFs (if applicable).</li>
<li>Your Home Assistant version and Mushroom Strategy version.</li>
</ol>
<hr />
<h2 id="suggesting-features">✨ Suggesting Features<a class="headerlink" href="#suggesting-features" title="Permanent link">#</a></h2>
<p>Have a great idea for a new feature or enhancement? We'd love to hear it!</p>
<ol>
<li><strong>Check existing suggestions:</strong> Search our GitHub <a href="https://github.com/DigiLive/mushroom-strategy/issues">Issues</a>
or <a href="https://github.com/DigiLive/mushroom-strategy/discussions">Discussions</a> to see if the feature has already been
requested.</li>
<li><strong>Open a new issue:</strong> If it's a new idea, open
a <a href="https://github.com/DigiLive/mushroom-strategy/issues/new?template=feature_request.yml">new issue</a>.</li>
<li><strong>Describe your idea:</strong> Clearly explain the feature, why you think it's useful, and any potential use cases.</li>
</ol>
<hr />
<h2 id="contributing-code">💻 Contributing Code<a class="headerlink" href="#contributing-code" title="Permanent link">#</a></h2>
<p>Want to get your hands dirty with the code? Awesome! We appreciate all code contributions.</p>
<ol>
<li><strong>Fork the Repository:</strong> Start by forking
the <a href="https://github.com/DigiLive/mushroom-strategy">DigiLive/mushroom-strategy</a> repository to your own GitHub
account.</li>
<li>
<p><strong>Clone Your Fork:</strong> Clone your forked repository to your local machine.</p>
<div class="highlight"><pre><span></span><code>git<span class="w"> </span>clone<span class="w"> </span>https://github.com/YOUR_USERNAME/mushroom-strategy.git
<span class="nb">cd</span><span class="w"> </span>mushroom-strategy
</code></pre></div>
</li>
<li>
<p><strong>Create a New Branch:</strong> Create a new branch for your feature or bug fix.<br />
Use a descriptive name (e.g., <code>feature/my-awesome-feature</code>, <code>bugfix/fix-admonition-rendering</code>).</p>
<div class="highlight"><pre><span></span><code>git<span class="w"> </span>checkout<span class="w"> </span>-b<span class="w"> </span>feature/my-new-feature
</code></pre></div>
</li>
<li>
<p><strong>Set up Development Environment:</strong></p>
<ul>
<li>Ensure you have Node.js and npm installed.</li>
<li>Install project dependencies: <code>npm install</code></li>
<li>You can build the strategy with <code>npm run build</code> (for production) or <code>npm run build-dev</code> (for development/testing).</li>
<li>Copy the built files to your Home Assistant's <code>www/community/mushroom-strategy</code> folder for testing.</li>
</ul>
</li>
<li>
<p><strong>Make Your Changes:</strong> Implement your bug fix or new feature.</p>
</li>
<li><strong>Test Your Changes:</strong> Thoroughly test your changes to ensure they work as expected and don't introduce new issues.</li>
<li>
<p><strong>Commit Your Changes:</strong></p>
<ul>
<li>We follow <a href="https://www.conventionalcommits.org/en/v1.0.0/">Conventional Commits</a> for clear commit history.</li>
<li>Example: <code>feat: add new card option</code> or <code>fix: correct card rendering issue</code></li>
</ul>
<div class="highlight"><pre><span></span><code>git<span class="w"> </span>add<span class="w"> </span>.
git<span class="w"> </span>commit<span class="w"> </span>-m<span class="w"> </span><span class="s2">&quot;feat: add super cool new feature&quot;</span>
</code></pre></div>
</li>
<li>
<p><strong>Push to Your Fork:</strong></p>
<div class="highlight"><pre><span></span><code>git<span class="w"> </span>push<span class="w"> </span>origin<span class="w"> </span>feature/my-new-feature
</code></pre></div>
</li>
<li>
<p><strong>Create a Pull Request (PR):</strong></p>
<ul>
<li>Go to your forked repository on GitHub.</li>
<li>You should see a prompt to create a pull request from your new branch to the <code>main</code> branch of
<code>DigiLive/mushroom-strategy</code>.</li>
<li>Provide a clear title and description for your PR, referencing any related issues.</li>
<li>Be prepared to discuss your changes and address any feedback during the review process.</li>
</ul>
</li>
</ol>
<hr />
<h2 id="improving-documentation">📄 Improving Documentation<a class="headerlink" href="#improving-documentation" title="Permanent link">#</a></h2>
<p>Good documentation is vital! If you find typos, unclear sections, or want to add more examples, please open a pull
request. The documentation is located in the <code>docs/</code> folder of this repository.</p>
<hr />
<h2 id="translations">🌐 Translations<a class="headerlink" href="#translations" title="Permanent link">#</a></h2>
<p>Help us make Mushroom Strategy accessible to more users around the world by contributing and improving translations!</p>
<p>Language tags have to follow <a href="https://tools.ietf.org/html/bcp47">BCP 47</a>.<br />
A list of most language tags can be found
here: <a href="http://www.iana.org/assignments/language-subtag-registry/language-subtag-registry">IANA subtag registry</a>.
Examples: fr, fr-CA, zh-Hans.</p>
<ol>
<li><strong>Check for Existing Translations:</strong> See if your language is already being worked on or exists.</li>
<li><strong>Locate Translation Files:</strong> Language files are found within the <code>src/translations</code> directory.
Each language has its own <code>locale.json</code> file (e.g., <code>en.json</code>, <code>nl.json</code>, <code>pt-BR.json</code>).</li>
<li>
<p><strong>Create or Update:</strong></p>
<ul>
<li><strong>To create a new language:</strong> Copy an existing <code>.json</code> file (e.g., <code>en.json</code>), rename it to your language
code (e.g., <code>de.json</code> for German), and translate the property values.</li>
<li><strong>To update an existing language:</strong> Open the <code>.json</code> file for your language and update any missing or
outdated translations.</li>
</ul>
</li>
<li>
<p><strong>Submit a Pull Request:</strong> Once your translations are complete, submit a pull request with your changes. Clearly
state which language you are contributing to or updating.</p>
</li>
</ol>
<div class="admonition info">
<p class="admonition-title">Info</p>
<p><strong>Integrating a new Translation:</strong></p>
<ul>
<li>For your new language file to be picked up, it needs to be imported and registered at file
<code>src/utilities/localize.ts</code>.</li>
<li>You will need to add an <code>import</code> statement for your new <code>.json</code> file at the top, following the existing pattern.</li>
<li>Then, you'll need to add it to the <code>languages</code> map, associating the language code with the imported module.</li>
</ul>
<p><strong>Special Handling for <code>language-country</code> Locales:</strong><br />
If you are adding a country-specific locale (e.g., <code>es-ES</code> for Spanish (Spain) or <code>en-GB</code> for English
(United Kingdom)), you should create a file like <code>en-GB.json</code> in the <code>translations</code> folder. In
<code>src/utilities/localize.ts</code>, you'll import it similarly and add it to the <code>languages</code> map using the full locale
code.<br />
Please ensure you follow existing patterns for <code>language-country</code> codes, which typically use a hyphen (<code>-</code>) + a
UPPER-cased country code in the file name and an underscore (<code>_</code>) + a lower-cased country code in the import key. </p>
<div class="admonition example">
<p class="admonition-title">Example</p>
<div class="highlight"><pre><span></span><code><span class="k">import</span><span class="w"> </span><span class="o">*</span><span class="w"> </span><span class="kr">as</span><span class="w"> </span><span class="nx">en</span><span class="w"> </span><span class="kr">from</span><span class="w"> </span><span class="s1">&#39;../translations/en.json&#39;</span><span class="p">;</span>
<span class="k">import</span><span class="w"> </span><span class="o">*</span><span class="w"> </span><span class="kr">as</span><span class="w"> </span><span class="nx">pt_br</span><span class="w"> </span><span class="kr">from</span><span class="w"> </span><span class="s1">&#39;../translations/pt-BR.json&#39;</span><span class="p">;</span>
<span class="cm">/** Registry of currently supported languages */</span>
<span class="kd">const</span><span class="w"> </span><span class="nx">languages</span><span class="o">:</span><span class="w"> </span><span class="kt">Record</span><span class="o">&lt;</span><span class="kt">string</span><span class="p">,</span><span class="w"> </span><span class="nx">unknown</span><span class="o">&gt;</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="p">{</span>
<span class="w"> </span><span class="nx">en</span><span class="p">,</span>
<span class="w"> </span><span class="s1">&#39;pt-BR&#39;</span><span class="o">:</span><span class="w"> </span><span class="nx">pt_br</span><span class="p">,</span>
<span class="p">};</span>
</code></pre></div>
</div>
</div>
<hr />
<h2 id="get-support">🙏 Get Support<a class="headerlink" href="#get-support" title="Permanent link">#</a></h2>
<p>If you have questions about contributing or need help with your setup, please open
a <a href="https://github.com/DigiLive/mushroom-strategy/discussions">discussion</a> on our GitHub repository.</p>
</article>
</div>
<script>var target=document.getElementById(location.hash.slice(1));target&&target.name&&(target.checked=target.name.startsWith("__tabbed_"))</script>
</div>
</main>
<footer class="md-footer">
<div class="md-footer-meta md-typeset">
<div class="md-footer-meta__inner md-grid">
<div class="md-copyright">
<div class="md-copyright__highlight">
Copyright &copy; 2024 - <script>document.write(new Date().getFullYear())</script> DigiLive. All Rights Reserved.
</div>
Made with
<a href="https://squidfunk.github.io/mkdocs-material/" target="_blank" rel="noopener">
Material for MkDocs
</a>
</div>
</div>
</div>
</footer>
</div>
<div class="md-dialog" data-md-component="dialog">
<div class="md-dialog__inner md-typeset"></div>
</div>
<script id="__config" type="application/json">{"base": "..", "features": ["navigation.tabs", "navigation.sections", "toc.integrate", "toc.follow", "search.suggest", "search.highlight", "content.code.copy", "content.tabs", "content.action.edit", "content.footnote.tooltips"], "search": "../assets/javascripts/workers/search.d50fe291.min.js", "tags": null, "translations": {"clipboard.copied": "Copied to clipboard", "clipboard.copy": "Copy to clipboard", "search.result.more.one": "1 more on this page", "search.result.more.other": "# more on this page", "search.result.none": "No matching documents", "search.result.one": "1 matching document", "search.result.other": "# matching documents", "search.result.placeholder": "Type to start searching", "search.result.term.missing": "Missing", "select.version": "Select version"}, "version": null}</script>
<script src="../assets/javascripts/bundle.13a4f30d.min.js"></script>
</body>
</html>