A Kotlin library for using the myQ API to interact with Liftmaster/Chamberlain devices.
repositories {
maven("https://jitpack.io")
}
dependencies {
implementation("com.github.DiamondMiner88:myq:1.0.1")
}
MyQ().apply {
login("[email protected]", "password")
// OR
login("[refresh_token]")
// Save this if using multiple times to shorten login procces
getRefreshToken()
// Cache this during runtime only
val devices = fetchDevices()
device.forEach {
println("${it.serial} ${it.deviceFamily}: ${it.name}")
}
val goDevice = device.find { it.deviceFamily == "garagedoor" }
setGarageDoorState(goDevice, open = true)
// Same thing
setLampState(lampDevice, isOn = true)
}
- Not the entire API is implemented
- Locks are not supported (yet)
- Device states are just parsed into a JsonObject for now, since I do not have the full data for all types of devices.
- If you have an account with locks/lamps registered on it, I would appreciate it if you would let me test with it! (@email on user page)