description: >
  Sample Focas service commissioning file

metadata:
  name: Sample Focas service
  icon: https://www.cybus.io/wp-content/uploads/2017/10/for-whom1.svg
  provider: cybus
  homepage: https://www.cybus.io
  version: 1.0.0

parameters:
  focasHost:
    type: string
    default: 192.168.2.170

  focasPort:
    type: integer
    default: 8193

  initialReconnectDelay:
    type: integer
    default: 1000

  maxReconnectDelay:
    type: integer
    default: 30000

  factorReconnectDelay:
    type: integer
    default: 2

resources:
  focasConnection:
    type: Cybus::Connection
    properties:
      protocol: Focas
      connection:
        host: !ref focasHost
        port: !ref focasPort
        connectionStrategy:
          initialDelay: !ref initialReconnectDelay
          maxDelay: !ref maxReconnectDelay
          incrementFactor: !ref factorReconnectDelay

  subscribeExample1:
    type: Cybus::Endpoint
    properties:
      protocol: Focas
      connection: !ref focasConnection
      subscribe:
        method: 'cnc_statinfo2'
        interval: 3000

  readExample1:
    type: Cybus::Endpoint
    properties:
      protocol: Focas
      connection: !ref focasConnection
      read:
        method: 'cnc_sysinfo'
