Stay organized with collections
Save and categorize content based on your preferences.
LightsRequest
class LightsRequest
Encapsulates a request to modify the state of multiple lights.
Summary
Nested classes |
|
Builder for creating device light change requests.
|
Public methods
getLightStates
fun getLightStates(): MutableList<LightState!>
Get a list of LightState. The states will be returned in same order as the light ids returned by getLights()
.
getLights
fun getLights(): MutableList<Int!>
Get a list of Light as ids.
Return |
MutableList<Int!> |
List of light ids in the request. This value cannot be null . |
getLightsAndStates
fun getLightsAndStates(): MutableMap<Light!, LightState!>
Get a map of lights and states. The map will contain all the lights as keys and the corresponding LightState requested as values.
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-02-10 UTC."],[],[],null,["# LightsRequest\n\nAdded in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nLightsRequest\n=============\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/android/hardware/lights/LightsRequest \"View this page in Java\") \n\n```\nclass LightsRequest\n```\n\n|---|--------------------------------------------|\n| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) ||\n| ↳ | [android.hardware.lights.LightsRequest](#) |\n\nEncapsulates a request to modify the state of multiple lights.\n\nSummary\n-------\n\n| Nested classes ||\n|---|-------------------------------------------------------------------------------------------------------------------------------|\n| | [Builder](/reference/kotlin/android/hardware/lights/LightsRequest.Builder) Builder for creating device light change requests. |\n\n| Public methods ||\n|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------|\n| [MutableList](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-mutable-list/index.html)\\\u003c[LightState](/reference/kotlin/android/hardware/lights/LightState)!\\\u003e | [getLightStates](#getLightStates())`()` Get a list of LightState. |\n| [MutableList](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-mutable-list/index.html)\\\u003c[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)!\\\u003e | [getLights](#getLights())`()` Get a list of Light as ids. |\n| [MutableMap](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-mutable-map/index.html)\\\u003c[Light](/reference/kotlin/android/hardware/lights/Light)!, [LightState](/reference/kotlin/android/hardware/lights/LightState)!\\\u003e | [getLightsAndStates](#getLightsAndStates())`()` Get a map of lights and states. |\n\nPublic methods\n--------------\n\n### getLightStates\n\nAdded in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun getLightStates(): MutableList\u003cLightState!\u003e\n```\n\nGet a list of LightState. The states will be returned in same order as the light ids returned by [getLights()](#getLights()).\n\n| Return ||\n|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------|\n| [MutableList](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-mutable-list/index.html)\u003c[LightState](/reference/kotlin/android/hardware/lights/LightState)!\u003e | List of light states This value cannot be `null`. |\n\n### getLights\n\nAdded in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun getLights(): MutableList\u003cInt!\u003e\n```\n\nGet a list of Light as ids.\n\n| Return ||\n|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------|\n| [MutableList](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-mutable-list/index.html)\u003c[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)!\u003e | List of light ids in the request. This value cannot be `null`. |\n\n### getLightsAndStates\n\nAdded in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun getLightsAndStates(): MutableMap\u003cLight!, LightState!\u003e\n```\n\nGet a map of lights and states. The map will contain all the lights as keys and the corresponding LightState requested as values.\n\n| Return ||\n|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------|\n| [MutableMap](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-mutable-map/index.html)\u003c[Light](/reference/kotlin/android/hardware/lights/Light)!,` `[LightState](/reference/kotlin/android/hardware/lights/LightState)!\u003e | This value cannot be `null`. |"]]