Skip to content

Latest commit

 

History

History
58 lines (43 loc) · 2.45 KB

CONTRIBUTING.md

File metadata and controls

58 lines (43 loc) · 2.45 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
  2. Create a new json file named with a correct language code in /src/localize/languages/ directory
  3. Copy content of src/localize/languages/en.json file to a newly created file
  4. Replace English texts with your translations (do not replace keys!)
  5. Import your file in src/localize/localize.ts
  6. Add a new entry in translations list
  7. Create a pull request

Adding new platform

To add a new platform follow these steps:

  1. Fork this repository
  2. Create a new json file in src/model/generators/platform_templates directory
  3. Copy content of src/model/generators/platform_templates/new.json file to a newly created file
  4. Adjust configuration according to parameters of added platform
  5. Import your file in src/model/generators/platform-generator.ts
  6. Add a new entry in supported platforms list
  7. 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/boilerplate-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