# hass_capabilities.yaml
# Copyright (C) 2020-2025 Kedron Holdings LLC, All Rights Reserved
# This file is part of Reactor.
#
# *** IMPORTANT ***
# This is a system file. DO NOT place overrides or make modifications here.
# You can add or override implementation section items by specifying them
# in local.HassController.implementation in your site configuration.
# You can add or override mapping section items by specifying your data in
# local.HassController.mapping in your site configuration.
---
version: 25231
revision: 1
format: 1
copyright: Copyright (C) 2020-2025 Kedron Holdings LLC, All Rights Reserved

capabilities:
  x_hass:
    attributes:
      domain:
        type: string
      entity_id:
        type: string
      state:
        type: string
      source:
        type: string
        default: null
    actions:
      call_service:
        arguments:
          service:
            type: string
            sort: 1
            control:
              type: select
              rpc: enum_services
              restricted: false
              keys:
                expr: "t=each key in response: do each subkey in response[key]: key + '.' + subkey done, t"
          data:
            type: object
            label: service_data
            sort: 2
        response: true
  x_hass_attr:
    attributes: {}

  x_hass_system:
    attributes: {}
    actions:
      call_service:
        arguments:
          service:
            type: string
            sort: 1
            control:
              type: select
              rpc: enum_services
              restricted: false
              keys:
                expr: "t=each key in response: do each subkey in response[key]: key + '.' + subkey done, t"
          target:
            type: object
            label: target
            sort: 2
          data:
            type: object
            label: service_data
            sort: 3
        response: true
      fire_event:
        arguments:
          event:
            type: string
            label: event_type
            sort: 1
          data:
            type: object
            label: event_data
            sort: 2
      reload_integration:
        arguments:
          id:
            type: string
            sort: 1
      reload_configuration:
        arguments: {}
      restart:
        arguments: {}
        # It is normal for this action to cause a timeout of the action Promise because Hass doesn't reply
        # (or it tries but has already starting closing client connections). PHR 2025-1-4
      debug:
        arguments:
          data:
            type: object
            bigtext: true
            uiclass: code
