If you plan to contribute back to this repo, please fork & open a PR.
Only native speaker should translate to a specific language.
- Copy
src/translations/en.json
file and name it with appropriate language code. - Import your translation in
src/localize.js
file. - Mention your translation in
README.md
file. - Test it!
- Open a PR (only language file and readme are allowed).
- Find someone to check and approve your PR.
- Copy
const_template.js
file and name it with const underscore brand (for instanceconst_easee.js
). - Add import of your file in the top of
const.js
and add info about your new template brand in theconst CARDCONFIGTYPES
variable insideconst.js
. Se comments in file for further instructions. - Modify your new
const_template.js
file to fit your brand. See comments in template file for further instructions.#ENTITYPREFIX#
: The way it is made to work is that when user specifies theentity
main sensor, the code will assume alle other sensors contain a part of the name and use to replace you template value with correct entity ids for all other sensors. Use the#ENTITYPREFIX#
for this value that will be replaced. For instance the main entity is sensor.CHARGERNAME_status given by user, it will assume that a switch in the template will become switch.CHARGERNAME_smart_charging when you define it as _switch.#ENTITYPREFIX#smart_charging in your template.#SERVICEID#
: A replacement used in the service call, typically for a chargerid or something that must be part of the data when calling service of a specific charger. A part of theconst CARDCONFIGTYPES
variable insideconst.js
defines if this is a state, attribute or an entity id for your template.#SERVICEVAL#
: A replacement used in the service call, typically for the value from a dropdown or similar. Use this in the template where for instance a current limit is supposed to be sent to a charger.- More tags may be added, see comments in template file for further instructions.
- Mention your brand template in
README.md
file. - Test it (preferably have someone else with the same brand test it for you too!)
- Ask for help in Github issues if you need help with some specifics.
- Open a PR (only
const.js
, your newconst_template.js
andREADME.md
are allowed). Other suggestions or bugfixes should be given in separate PRs. - Find someone to check and approve your PR.
- Clone this repo to wherever you want:
git clone https://github.com/tmjo/charger-card.git
- Go into the repo folder:
cd charger-card
- Install dependencies (Node.js and npm are required):
npm install
- Run development server. It's going to watch source files, recompile on changes and server compiled file on local server.
npm start
- Add
http://localhost:5000/charger-card.js
to your Lovelace resources.
Now you can make changes to files in src
folder. Development server will automatically rebuild on changes. Lovelace will load resource from development server. Refresh the browser to see changes. Make sure cache is cleared or disabled (minimum Ctrl+F5 for hard refresh in Chrome).