# Condition

# Condition


```
class Condition : Node
```

<br />

|---|---|---|
| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) |||
| ↳ | [com.google.home.automation.Node](https://developers.home.google.com/reference/kotlin/com/google/home/automation/Node) ||
|   | ↳ | [com.google.home.automation.Condition](https://developers.home.google.com/reference/kotlin/com/google/home/automation/Condition) |

*** ** * ** ***

A logical state that controls whether an automation that has been triggered by a `https://developers.home.google.com/reference/kotlin/com/google/home/automation/Starter` or `https://developers.home.google.com/reference/kotlin/com/google/home/automation/StateReader`" should continue or stop executing.

## Summary

| ### Public functions |
|---|---|
| `open https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html` | `https://developers.home.google.com/reference/kotlin/com/google/home/automation/Condition#toString()()` |

| ### Public properties |
|---|---|
| `https://developers.home.google.com/reference/kotlin/com/google/home/automation/Expression` | `https://developers.home.google.com/reference/kotlin/com/google/home/automation/Condition#expression()` The expression that determines whether the condition passes or not. |
| `https://developer.android.com/reference/java/time/Duration.html?` | `https://developers.home.google.com/reference/kotlin/com/google/home/automation/Condition#forDuration()` How long the condition lasts. |

| ### Inherited properties |
|---|
| From [com.google.home.automation.Node](https://developers.home.google.com/reference/kotlin/com/google/home/automation/Node) |---|---| | `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html?` | `https://developers.home.google.com/reference/kotlin/com/google/home/automation/Node#nodeId()` String identifier of this node. | |

## Public functions

### toString

```
open fun toString(): String
```

## Public properties

### expression

```
val expression: Expression
```

The expression that determines whether the condition passes or not. If the expression evaluates to `true`, the condition passes, otherwise, it fails and execution stops.

### forDuration

```
val forDuration: Duration?
```

How long the condition lasts. The duration may be as short as one minute or as long as 30 minutes.