Skip to content

Kelvin SmartApps™ Configuration

Kelvin SmartApps™ Configuration can optionally be defined and accessed by Kelvin SmartApps™ in order to configure Kelvin SmartApps™ as a whole. This use case is gonna be explained in the following section.

It holds "global" Kelvin SmartApps™ configurations that can be defined through an arbitrarily Object structure upon the app.yaml. i.e.:

app:
  type: kelvin
  kelvin:

    configuration:
      connection:
        ip: 192.168.0.1
        port: 4747
      credentials:
        username: my-username
        password: my-password

      temperature_threshold_tolerance: 5

This is how to access the Kelvin SmartApps™ Configuration:

  • app_configuration Object

    Access a single Kelvin SmartApps™ Configuration value directly from an app_configuration Dictionary Object embedded within KelvinApp:

    import asyncio
    
    from kelvin.application import KelvinApp
    
    
    async def main() -> None:
        app = KelvinApp()
        await app.connect()
    
        (...)
    
        # Get IP
        ip = app.app_configuration["connection"]["ip"]
    

    Info

    app.app_configuration will only be available after app.connect()