Digital-Alchemy-TS / type-writer

Tools for converting Home Assistant to Typescript types
https://docs.digital-alchemy.app
MIT License
0 stars 0 forks source link

Enum param support #11

Open zoe-codez opened 2 months ago

zoe-codez commented 2 months ago

Context

This field currently translates to a string

"get_forecasts": {
  "name": "Get forecasts",
  "description": "Get weather forecasts.",
  "fields": {
    "type": {
      "required": true,
      "selector": {
        "select": {
          "options": [
            "daily",
            "hourly",
            "twice_daily"
          ],
          "translation_key": "forecast_type"
        }
      },
      "name": "Forecast type",
      "description": "Forecast type: daily, hourly or twice daily."
    }
  },
}
zoe-codez commented 2 months ago

Needs support for the multiple flag

"selector": {
  "select": {
    "translation_key": "status",
    "options": [
      "needs_action",
      "completed"
    ],
    "multiple": true
  }
},