HasAutomations

interface HasAutomations

Known direct subclasses
Structure

The top-level organizing construct for the Home.


Interface that allows for Automation creation, retrieval, update, and deletion operations.

Summary

Public functions

HomeObjectsFlow<Automation>

List all automations belonging to the structure.

suspend Automation

Create an Automation.

suspend Unit

Delete an Automation.

suspend Unit
deleteAutomation(automationId: Id)

Delete an Automation using an ID.

Public functions

automations

fun automations(): HomeObjectsFlow<Automation>

List all automations belonging to the structure. Only automations created through the Home APIs are returned.

Returns
HomeObjectsFlow<Automation>

The automations belonging to the structure that were created through the Home APIs.

createAutomation

suspend fun createAutomation(automation: BaseAutomation): Automation

Create an Automation. If successful, this returns the newly-created Automation. If a fatal error such as PERMISSION_DENIED is encountered, this throws HomeException.

Parameters
automation: BaseAutomation

The Automation on which to base the new Automation.

Returns
Automation

The created Automation.

deleteAutomation

suspend fun deleteAutomation(automation: Automation): Unit

Delete an Automation.

Parameters
automation: Automation

The Automation to delete.

deleteAutomation

suspend fun deleteAutomation(automationId: Id): Unit

Delete an Automation using an ID.

Parameters
automationId: Id

The ID of the Automation to delete.