Skip to content

Latest commit

 

History

History
60 lines (45 loc) · 2.54 KB

CONTRIBUTING.md

File metadata and controls

60 lines (45 loc) · 2.54 KB

Contributing

Thank you for your contribution! To submit your changes please fork this repository and open a pull request.

Adding new translations

To add a new language follow these steps:

  1. Fork this repository (with all branches)
  2. Change branch to dev
  3. Create a new json file named with a correct language code in /src/localize/languages/ directory
  4. Copy content of src/localize/languages/en.json file to a newly created file
  5. Replace English texts with your translations (do not replace keys!)
  6. Import your file in src/localize/localize.ts
  7. Add a new entry in translations list
  8. Create a pull request

Adding new platform

To add a new platform follow these steps:

  1. Fork this repository (with all branches)
  2. Change branch to dev
  3. Create a new json file in src/model/generators/platform_templates directory
  4. Copy content of src/model/generators/platform_templates/new.json file to a newly created file
  5. Adjust configuration according to parameters of added platform
  6. Import your file in src/model/generators/platform-generator.ts
  7. Add a new entry in supported platforms list
  8. Create a pull request

Building with npm

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.

  1. Fork and clone the repository.
  2. Open a devcontainer terminal and run npm start when it's ready.
  3. The compiled .js file will be accessible on http://127.0.0.1:5000/xiaomi-vacuum-map-card.js.
  4. 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.

Bonus

If you need a fresh test instance you can install a fresh Home Assistant instance inside the devcontainer as well.

  1. Run the command container start.
  2. Home Assistant will install and will eventually be running on port 9123