# GenericDeviceType


```
@HomeExperimentalGenericApi
open class GenericDeviceType : DeviceType, HasGenericEvents
```

<br />

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

*** ** * ** ***

## Summary

| ### Public constructors |
|---|
| `https://developers.home.google.com/reference/kotlin/com/google/home/GenericDeviceType#GenericDeviceType(kotlin.collections.Set,com.google.home.DeviceTypeFactory,com.google.home.DeviceType.Metadata,com.google.home.GenericTraitProvider,com.google.home.GenericEventProvider,com.google.home.GenericPartsProvider)( genericTraits: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-set/index.html<https://developers.home.google.com/reference/kotlin/com/google/home/GenericTrait>, factory: https://developers.home.google.com/reference/kotlin/com/google/home/DeviceTypeFactory<https://developers.home.google.com/reference/kotlin/com/google/home/DeviceType>, metadata: https://developers.home.google.com/reference/kotlin/com/google/home/DeviceType.Metadata, genericTraitProvider: https://developers.home.google.com/reference/kotlin/com/google/home/GenericTraitProvider, genericEventProvider: https://developers.home.google.com/reference/kotlin/com/google/home/GenericEventProvider, genericPartsProvider: https://developers.home.google.com/reference/kotlin/com/google/home/GenericPartsProvider )` |

| ### Public functions |
|---|---|
| `open operator https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html` | `https://developers.home.google.com/reference/kotlin/com/google/home/GenericDeviceType#equals(kotlin.Any)(other: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html?)` |
| `open https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html` | `https://developers.home.google.com/reference/kotlin/com/google/home/GenericDeviceType#hashCode()()` |

| ### Public properties |
|---|---|
| `open https://developers.home.google.com/reference/kotlin/com/google/home/DeviceTypeFactory<https://developers.home.google.com/reference/kotlin/com/google/home/DeviceType>` | `https://developers.home.google.com/reference/kotlin/com/google/home/GenericDeviceType#factory()` |
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-set/index.html<https://developers.home.google.com/reference/kotlin/com/google/home/GenericTrait>` | `https://developers.home.google.com/reference/kotlin/com/google/home/GenericDeviceType#genericTraits()` |
| `open https://developers.home.google.com/reference/kotlin/com/google/home/DeviceType.Metadata` | `https://developers.home.google.com/reference/kotlin/com/google/home/GenericDeviceType#metadata()` |

| ### Inherited functions |
|---|
| From [com.google.home.DeviceType](https://developers.home.google.com/reference/kotlin/com/google/home/DeviceType) |---|---| | `open https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.flow/-flow/index.html<https://developers.home.google.com/reference/kotlin/com/google/home/Event>` | `@https://developers.home.google.com/reference/kotlin/com/google/home/annotation/HomeExperimentalApi https://developers.home.google.com/reference/kotlin/com/google/home/DeviceType#eventsRecursive()()` Gets an observable flow of `https://developers.home.google.com/reference/kotlin/com/google/home/Event`s spanning this entire device type, including events emitted by this device type itself and all of its subordinate parts. | |
| From [com.google.home.HasEvents](https://developers.home.google.com/reference/kotlin/com/google/home/HasEvents) |---|---| | `open https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.flow/-flow/index.html<https://developers.home.google.com/reference/kotlin/com/google/home/Event>` | `https://developers.home.google.com/reference/kotlin/com/google/home/HasEvents#events()()` Gets a flow of all Events available for the object. | | `open https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.flow/-flow/index.html<T>` | `<T : https://developers.home.google.com/reference/kotlin/com/google/home/Event> https://developers.home.google.com/reference/kotlin/com/google/home/HasEvents#events(com.google.home.EventFactory)(event: https://developers.home.google.com/reference/kotlin/com/google/home/EventFactory<T>)` Gets a flow of a specific Event. | | `open https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.flow/-flow/index.html<https://developers.home.google.com/reference/kotlin/com/google/home/Event>` | `<T : https://developers.home.google.com/reference/kotlin/com/google/home/Trait> https://developers.home.google.com/reference/kotlin/com/google/home/HasEvents#events(com.google.home.TraitFactory)(trait: https://developers.home.google.com/reference/kotlin/com/google/home/TraitFactory<T>)` Gets a flow of all Events by this `https://developers.home.google.com/reference/kotlin/com/google/home/Trait`. | |
| From [com.google.home.HasGenericEvents](https://developers.home.google.com/reference/kotlin/com/google/home/HasGenericEvents) |---|---| | `open https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.flow/-flow/index.html<https://developers.home.google.com/reference/kotlin/com/google/home/GenericEvent>` | `https://developers.home.google.com/reference/kotlin/com/google/home/HasGenericEvents#genericEvents()()` Gets a flow of all Events available for the object. | | `open https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.flow/-flow/index.html<https://developers.home.google.com/reference/kotlin/com/google/home/GenericEvent>` | `https://developers.home.google.com/reference/kotlin/com/google/home/HasGenericEvents#genericEvents(kotlin.String)(eventId: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)` Gets a flow of a specific Event. | | `open https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.flow/-flow/index.html<https://developers.home.google.com/reference/kotlin/com/google/home/GenericEvent>` | `https://developers.home.google.com/reference/kotlin/com/google/home/HasGenericEvents#genericTraitEvents(kotlin.String)(traitId: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)` Gets a flow of all Events by this `https://developers.home.google.com/reference/kotlin/com/google/home/Trait`. | |
| From [com.google.home.HasParts](https://developers.home.google.com/reference/kotlin/com/google/home/HasParts) |---|---| | `open T` | `<T : https://developers.home.google.com/reference/kotlin/com/google/home/DeviceType> https://developers.home.google.com/reference/kotlin/com/google/home/HasParts#part(com.google.home.DeviceTypeFactory,kotlin.Array)(type: https://developers.home.google.com/reference/kotlin/com/google/home/DeviceTypeFactory<T>, vararg tags: https://developers.home.google.com/reference/kotlin/com/google/home/Tag)` Returns the first part that matches the given type and tags. | | `open T?` | `<T : https://developers.home.google.com/reference/kotlin/com/google/home/DeviceType> https://developers.home.google.com/reference/kotlin/com/google/home/HasParts#partOrNull(com.google.home.DeviceTypeFactory,kotlin.Array)(type: https://developers.home.google.com/reference/kotlin/com/google/home/DeviceTypeFactory<T>, vararg tags: https://developers.home.google.com/reference/kotlin/com/google/home/Tag)` Returns the first part that matches the given type and tags. | |
| From [com.google.home.TraitProvider](https://developers.home.google.com/reference/kotlin/com/google/home/TraitProvider) |---|---| | `open https://developers.home.google.com/reference/kotlin/com/google/home/Trait.TraitMetadata?` | `<T : https://developers.home.google.com/reference/kotlin/com/google/home/Trait> https://developers.home.google.com/reference/kotlin/com/google/home/TraitProvider#metadata(com.google.home.TraitFactory)(traitFactory: https://developers.home.google.com/reference/kotlin/com/google/home/TraitFactory<T>)` Access a specific trait metadata on the provider given a caller-provided TraitFactory. | | `open T?` | `<T : https://developers.home.google.com/reference/kotlin/com/google/home/Trait> https://developers.home.google.com/reference/kotlin/com/google/home/TraitProvider#trait(com.google.home.TraitFactory)(traitFactory: https://developers.home.google.com/reference/kotlin/com/google/home/TraitFactory<T>)` Access a specific trait on the provider given a caller-provided TraitFactory. | | `open https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-set/index.html<https://developers.home.google.com/reference/kotlin/com/google/home/Trait>` | `https://developers.home.google.com/reference/kotlin/com/google/home/TraitProvider#traits()()` Given a similar accessible trait set as the function above, returns a subset of those traits that are present in the associated `https://developers.home.google.com/reference/kotlin/com/google/home/HomeConfig#factoryRegistry()` union'ed with those already known to the extended sub-class (e.g specific DeviceType that is aware of the set of `https://developers.home.google.com/reference/kotlin/com/google/home/TraitFactory`s specified in its type definition). | |

| ### Inherited properties |
|---|
| From [com.google.home.DeviceType](https://developers.home.google.com/reference/kotlin/com/google/home/DeviceType) |---|---| | `https://developers.home.google.com/reference/kotlin/com/google/home/TraitProvider` | `https://developers.home.google.com/reference/kotlin/com/google/home/DeviceType#traitProvider()` | |
| From [com.google.home.HasParts](https://developers.home.google.com/reference/kotlin/com/google/home/HasParts) |---|---| | `open https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-set/index.html<https://developers.home.google.com/reference/kotlin/com/google/home/DeviceType>` | `https://developers.home.google.com/reference/kotlin/com/google/home/HasParts#parts()` The parts of this object represented as a set of device types. | |

## Public constructors

### GenericDeviceType

```
GenericDeviceType(
    genericTraits: Set<GenericTrait>,
    factory: DeviceTypeFactory<DeviceType>,
    metadata: DeviceType.Metadata,
    genericTraitProvider: GenericTraitProvider = GenericTraitProvider(genericTraits),
    genericEventProvider: GenericEventProvider = GenericEventProvider(null, genericTraits),
    genericPartsProvider: GenericPartsProvider = GenericPartsProvider()
)
```

## Public functions

### equals

```
open operator fun equals(other: Any?): Boolean
```

### hashCode

```
open fun hashCode(): Int
```

## Public properties

### factory

```
open val factory: DeviceTypeFactory<DeviceType>
```

### genericTraits

```
val genericTraits: Set<GenericTrait>
```

### metadata

```
open val metadata: DeviceType.Metadata
```