/snips-action-unit-converter

Snips action code for the Unit Converter app

Primary LanguageTypeScriptMIT LicenseMIT

snips-action-unit-converter

Snips action code for the Unit Conversion app

Build Status

Setup

sh setup.sh

Don't forget to edit the config.ini file.

An assistant containing the intents listed below must be installed on your system. Deploy it following these instructions.

Run

  • Dev mode:
# Dev mode watches for file changes and restarts the action.
npm run dev
  • Prod mode:
# 1) Lint, transpile and test.
npm start
# 2) Run the action.
node action-unit-converter.js

Test & Demo cases

This app only supports french 🇫🇷 and english 🇬🇧.

UnitConvert

Convert between two specified units

Convert a specific amount to the destination unit

Hey Snips, convert 6 kilometers in miles, please

Give the conversion between a unit and another

Hey Snips, one gallon is how many liters?

Debug

In the action-unit-converter.js file:

// Uncomment this line to print everything
// debug.enable(name + ':*')

Test & Lint

Requires mosquitto to be installed.

npm start

In test mode, i18n output and http calls are mocked.

  • http: mocks are written in tests/httpMocks/index.ts
  • i18n: mocked by snips-toolkit, see the documentation.

Contributing

Please see the Contribution Guidelines.

Copyright

This library is provided by Snips as Open Source software. See LICENSE for more information.