theHacker / air-q-kotlin

small helper to access commonly required features which are missing in air-Q's UI and official Python library

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

air-q-kotlin

air-q-kotlin is a small helper written in Kotlin giving you the ability to access commonly required features which are missing in air-Q's UI and official Python library aioairq.

Motivation

I bought air-Q because it's advertised as "Cloud is optional". However, I was very disappointed when the built-in UI did not allow me to set any relevant configuration. One cannot set the many LED themes the device supports, it's not even possible to configure the IP setup. πŸ˜’

Support initially redirected me to official apps for Android and iOS. This is of course not the same as "Cloud", but for privacy-concerned people (like me πŸ€“) this is also unacceptable. I do not want to install additional software on some phone to configure another device.

Luckily, both the Python library and air-Q UI's JavaScript show how to access the API and from the structure of the config data one can easily guess what data to set to. This is how air-q-kotlin was born.

At this point, a thanks to the air-Q guys, providing me with additional documentation, making it a bit easier for me. πŸ˜€

Features

The following table compares all supported features between air-q-kotlin, the air-Q's UI and the official Python library (as of 2023-04-11).

Feature supported by
air-q-kotlin
supported by
air-Q's UI
supported by
aioairq
check for correct password by ping endpoint βœ… - βœ…
read all configuration keys/values βœ… βœ… βœ…
read current data βœ… βœ… βœ…
read average data ❌ ❌ βœ…
access the device's log βœ… ❌ ❌
set WLAN login data ❌ βœ… ❌
set air-Q's password ❌ βœ… ❌
read/change the device's category ❌ βœ… ❌
read/change the device's name βœ… βœ… ❌
enable/disable cloud upload ❌ βœ… ❌
enable/disable cloud remote βœ… ❌ ❌
trigger firmware update ❌ βœ… ❌
configure NTP server βœ… ❌ ❌
configure custom IP setup (disabling DHCP) βœ… ❌ ❌
set IP setup back to DHCP βœ… ❌ ❌
set LED brightness βœ… ❌ ❌
set LED brightness (day/night mode) βœ… ❌ ❌
set LED theme (individually for each side) βœ… ❌ ❌
identify air-Q device (by blinking its LEDs) βœ… ❌ ❌
manually restart air-Q device βœ… ❌ ❌
gracefully shutdown air-Q device βœ… ❌ ❌

air-Q has a lot more features to be configured. I only implemented the missing things I needed for it to operate. Also, air-Q support warned me not every feature is available for every device tier. So I tinkered with my device as little as possible.

Usage

air-q-kotlin is not a nice console tool, but for "run once".

  • Go to Main.kt, uncomment and change the parts you need.
  • Setup environment variables
    • AIRQ_HOST (mDNS name or current IP address) and
    • AIRQ_PASSWORD.
  • Run the application.

As the better alternative, you can use an IDE (I used IntelliJ).

  • Create a run configuration with above environment variables.
  • But a breakpoint in Main.kt after airQ is declared, that is the } line.
  • Run in Debug mode.
  • Use "Evaluate Expression" on the airQ instance to read from/apply to your air-Q device instantly. 😎

Screenshots

Custom IP setup

Screenshot

Accessing LED theme configuration

Screenshot

About

small helper to access commonly required features which are missing in air-Q's UI and official Python library

License:Apache License 2.0


Languages

Language:Kotlin 100.0%