Skip to content

GroupedLight

S222em edited this page Jun 17, 2022 · 51 revisions

Class: GroupedLight

Represents a Hue grouped light

Hierarchy

Table of contents

Constructors

Properties

Accessors

Methods

Constructors

constructor

new GroupedLight(bridge)

Parameters

Name Type
bridge Bridge

Inherited from

Resource.constructor

Defined in

src/structures/Base.ts:17

Properties

bridge

Readonly bridge: Bridge

The bridge this Base belongs to

Inherited from

Resource.bridge

Defined in

src/structures/Base.ts:11


data

data: ApiGroupedLight

Raw data received from the API

Inherited from

Resource.data

Defined in

src/structures/Base.ts:15


type

type: ApiResourceType = ApiResourceType.GroupedLight

The type of this resource

Overrides

Resource.type

Defined in

src/structures/GroupedLight.ts:12

Accessors

group

get group(): Group<ApiRoom | ApiZone>

Connected group

Returns

Group<ApiRoom | ApiZone>

Defined in

src/structures/GroupedLight.ts:24


groupId

get groupId(): string

Connected group ID

Returns

string

Defined in

src/structures/GroupedLight.ts:37


id

get id(): string

ID of this grouped light

Returns

string

Overrides

Resource.id

Defined in

src/structures/GroupedLight.ts:17

Methods

_clone

_clone(): GroupedLight

Clones this Base

internal

Returns

GroupedLight

Inherited from

Resource._clone

Defined in

src/structures/Base.ts:34


_edit

Protected _edit(data): Promise<void>

Edits this group light with raw API data structure

internal

Parameters

Name Type
data ApiGroupedLight

Returns

Promise<void>

Overrides

Resource._edit

Defined in

src/structures/GroupedLight.ts:93


_patch

_patch(data): void

Patches this Base with new data received from the API

internal

Parameters

Name Type Description
data ApiGroupedLight Data to patch

Returns

void

Inherited from

Resource._patch

Defined in

src/structures/Base.ts:26


_update

_update(data): GroupedLight

Clones and patches this Base

internal

Parameters

Name Type Description
data any Data to patch

Returns

GroupedLight

Inherited from

Resource._update

Defined in

src/structures/Base.ts:43


fetch

fetch(): Promise<GroupedLight>

Fetch this grouped light from the bridge

Returns

Promise<GroupedLight>

Overrides

Resource.fetch

Defined in

src/structures/GroupedLight.ts:75


isOn

isOn(): boolean

Whether a light in the group is on

Returns

boolean

Defined in

src/structures/GroupedLight.ts:83


off

off(): Promise<void>

Edits the on state of all lights to false

Returns

Promise<void>

Defined in

src/structures/GroupedLight.ts:61


on

on(): Promise<void>

Edits the on state of all lights to true

Returns

Promise<void>

Defined in

src/structures/GroupedLight.ts:54


state

state(state): Promise<void>

Edits the state of this grouped light

example groupedLight.state({ on: true });

Parameters

Name Type
state LightStateOptions

Returns

Promise<void>

Defined in

src/structures/GroupedLight.ts:47


toggle

toggle(): Promise<void>

Toggles the on state of all lights

Returns

Promise<void>

Defined in

src/structures/GroupedLight.ts:68


transformState

Static transformState(options): ApiGroupedLight

Parameters

Name Type
options LightStateOptions

Returns

ApiGroupedLight

Defined in

src/structures/GroupedLight.ts:97

hue.ts

Clone this wiki locally