1
0
Fork 0
A commandline utility written in Kotlin to control your Elgato Key Light and Key Light Air.
 
Go to file
Florian Schrofner b74e361a2c add license 2022-02-20 17:21:11 +01:00
gradle/wrapper initial commit 2022-02-12 15:28:46 +01:00
src/nativeMain/kotlin/fi/schro add license 2022-02-20 17:21:11 +01:00
.gitignore initial commit 2022-02-12 15:28:46 +01:00
LICENSE add license 2022-02-20 17:21:11 +01:00
README.md add license 2022-02-20 17:21:11 +01:00
build.gradle.kts add apply command functionality 2022-02-19 17:37:09 +01:00
gradle.properties setup koin, add light repository, start network setup 2022-02-13 17:31:48 +01:00
gradlew initial commit 2022-02-12 15:28:46 +01:00
gradlew.bat initial commit 2022-02-12 15:28:46 +01:00
settings.gradle.kts initial commit 2022-02-12 15:28:46 +01:00

README.md

Happy Cat 🐈🌞

A commandline utility to control your Elgato Key Light and Key Light Air.
Change your light settings easily inside scripts or use configuration files to automatically apply your preferred setup over the course of the day, possibly even exploring the use as a light therapy device.

Usage

Happy cat is split up into multiple subcommands, each of which uses its own parameters. To find out more about each command, check out the help pages by appending --help after the command.

Important: Although the Elgato API uses its own values for light temperature internally, the happy cat command line is intended to use Kelvin. However, the conversion is currently broken and might not work properly.

Apply

Reads the provided configuration file, determines the currently active state and applies the state to the given light once. It's basically a oneshot version of the daemon command. For examples of the configuration file, check the corresponding paragraph below.

Example

hc apply ./elgato.config elgato.local

Daemon

Reads the given configuration file, then determines and applies the currently valid configuration every minute.

Example

hc daemon ./elgato.config elgato.local

Get

Reads and prints the current configuration of the specified light.

Example

hc get elgato.local

Set

Sets the given values of powerstatus, brightness and temperature to the specified light.

hc set -p ON -b 70 -t 4200 elgato.local

Configuration

To automatically apply settings, you can create your own configuration file which defines the settings for each timeframe. All values inside status are optional, if they are not defined, those parameters will remain unchanged. Timeframes can cross midnight, but must not overlap. If there are overlapping timeframes, the first valid timeframe will be chosen.

{
  "config": [
    {
      "start": "8:30",
      "end": "11:00",
      "status": {
        "power": "ON",
        "brightness": 100,
        "temperature": 6500
      }
    },
    {
      "start": "11:00",
      "end": "20:00",
      "status": {
        "brightness": 70,
        "temperature": 4300
      }
    },
    {
      "start": "20:00",
      "end": "8:30",
      "status": {
        "temperature": 3000
      }
    }
  ]
}

Automation

Probably one could automate the setup using systemd and/or cronjobs, but so far I didn't get to that.

License

This software is licensed under the MPL 2.0, see the LICENSE file.