Skip to content

Releases: home-assistant/home-assistant-js-websocket

3.2.1

03 Nov 21:26

Choose a tag to compare

What's Changed

  • Fix support for optional subscribeUpdates (#75) @balloob

3.2.0

03 Nov 20:42

Choose a tag to compare

Now possible to get collection objects, instead of just subscribing to them.

// Will only initialize one collection per connection.
getCollection<State>(
  conn: Connection,
  key: string,
  fetchCollection: (conn: Connection) => Promise<State>,
  subscribeUpdates: (
    conn: Connection,
    store: Store<State>
  ) => Promise<UnsubscribeFunc>,
): Collection<State>

// Returns object with following type
class Collection<State> {
  state: State;
  async refresh(): Promise<void>;
  subscribe(subscriber: (state: State) => void): UnsubscribeFunc;
}

You can also import the service, config and entities collections:

import { entitiesColl, servicesColl, configColl } from 'home-assistant-js-websocket';

Commits

3.1.6

31 Oct 20:23

Choose a tag to compare

What's Changed

3.1.5

28 Oct 18:31

Choose a tag to compare

What's Changed

3.1.4

12 Sep 12:15

Choose a tag to compare

What's Changed

  • Fix re-subscribing to all events after reconnect (#58) @balloob

3.1.3

11 Sep 07:26
ff15397

Choose a tag to compare

What's Changed

  • Make type of event type in subscribeEvents optional (#56) @balloob

3.1.2

10 Sep 11:22

Choose a tag to compare

What's Changed

  • fetch call add credentials:'same-origin' to avoid omit cookie (#54) @yulongying

3.1.1

07 Sep 18:03

Choose a tag to compare

What's Changed

3.1.0 was skipped because I accidentally pushed without updating dist files

3.0.0

30 Aug 14:23
1a05bbb

Choose a tag to compare

Major rewrite, cleanup and typescriptation of this lib. See release notes of the RCs for the ins and outs.

3.0.0-rc5

30 Aug 13:30

Choose a tag to compare

3.0.0-rc5 Pre-release
Pre-release

Breaking change

The following methods have been removed from the connection object and can now be imported individually: conn.getStates(), conn.getConfig(), conn.getServices(), conn.callService().

Replace calls with:

import { getServices } from 'home-assistant-js-websocket';
const services = await getServices(conn);