Thank you for your contribution! To submit your changes please fork this repository and open a pull request.
To add a new language follow these steps:
- Fork this repository (with all branches)
- Change branch to
dev
- Create a new json file named with a correct language code in
/src/localize/languages/
directory - Copy content of
src/localize/languages/en.json
file to a newly created file - Replace English texts with your translations (do not replace keys!)
- Import your file in
src/localize/localize.ts
- Add a new entry in translations list
- Create a pull request
To add a new platform follow these steps:
- Fork this repository (with all branches)
- Change branch to
dev
- Create a new json file in
src/model/generators/platform_templates
directory - Copy content of
src/model/generators/platform_templates/new.json
file to a newly created file - Adjust configuration according to parameters of added platform
- Import your file in
src/model/generators/platform-generator.ts
- Add a new entry in supported platforms list
- Create a pull request
To build this card run following commands:
npm install
npm run build
Building and hosting with devcontainer
Note: this is available only in vscode ensure you have the Remote Containers extension installed.
- Fork and clone the repository.
- Open a devcontainer terminal and run
npm start
when it's ready. - The compiled
.js
file will be accessible onhttp://127.0.0.1:5000/xiaomi-vacuum-map-card.js
. - On a running Home Assistant installation add this to your Lovelace
resources:
- url: 'http://127.0.0.1:5000/xiaomi-vacuum-map-card.js'
type: module
Change "127.0.0.1" to the IP of your development machine.
If you need a fresh test instance you can install a fresh Home Assistant instance inside the devcontainer as well.
- Run the command
container start
. - Home Assistant will install and will eventually be running on port
9123