-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #118 from ReneeVandervelde/scene-delete
Add delete-scene command/api
- Loading branch information
Showing
5 changed files
with
39 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
cli/src/main/kotlin/inkapplications/shade/cli/scenes/DeleteSceneCommand.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package inkapplications.shade.cli.scenes | ||
|
||
import com.github.ajalt.clikt.parameters.arguments.argument | ||
import inkapplications.shade.cli.AuthorizedShadeCommand | ||
import inkapplications.shade.cli.resourceId | ||
|
||
object DeleteSceneCommand: AuthorizedShadeCommand( | ||
help = "Delete a scene from the hue bridge" | ||
) { | ||
private val sceneId by argument().resourceId() | ||
|
||
override suspend fun runCommand(): Int { | ||
val response = shade.scenes.deleteScene(sceneId) | ||
|
||
logger.debug("Got response: $response") | ||
|
||
echo(response) | ||
|
||
return 0 | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters