Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

4.x Release #150

Merged
merged 36 commits into from
Dec 27, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
1d05905
Preparing of 4.x release
peter-murray Nov 18, 2019
beecd26
Changes to support TypeScript definitions
peter-murray Nov 18, 2019
915e680
4.0.0-alpha
peter-murray Nov 18, 2019
efe8981
Adding typescript definition files into published package
peter-murray Nov 18, 2019
e3c9e5e
4.0.0-alpha-1
peter-murray Nov 18, 2019
5556ef6
Excluding .idea directory from package
peter-murray Nov 18, 2019
8d55ddd
4.0.0-alpha-2
peter-murray Nov 18, 2019
cc6770a
Removing v2 API
peter-murray Nov 19, 2019
e15be6a
Adding ability to run tests on commit
peter-murray Nov 19, 2019
e42664a
- Making cache compatible with ID related changes and support Light a…
peter-murray Nov 27, 2019
b52715c
- Adding support to use Objects as well as number/string for IDs
peter-murray Nov 27, 2019
3cb551a
- Adding deprecatedFunction() to output deprecation messages for func…
peter-murray Nov 27, 2019
7e27501
- Adding timeout to description loading (as API can become unresponsive)
peter-murray Nov 27, 2019
fd1fdbc
- Making N-UPnP functionality more responsive and in line with API us…
peter-murray Nov 27, 2019
4baf7b3
- Finishing off all the time patterns that the bridge can support
peter-murray Nov 29, 2019
03ee65e
- Fixing issues with arguments from the timePatterns usage.
peter-murray Nov 30, 2019
2626015
- Creation of various types of Groups so that attributes can be appro…
peter-murray Nov 30, 2019
f4404b6
- BridgeObject and BridgeObjectWithId separation as there are some ob…
peter-murray Nov 30, 2019
07437fe
- Adding rate limiting to the bridge communications
peter-murray Nov 30, 2019
97f546e
- Fixing name of workflow
peter-murray Nov 30, 2019
3667a1b
- Introduction of a time pattern type
peter-murray Nov 30, 2019
ffe8472
- Standarization of the API endpoints and adding JSDoc and deprecatio…
peter-murray Nov 30, 2019
1479fc6
Updating documentation and examples
peter-murray Nov 30, 2019
5c68171
- Fixing typescript definitions
peter-murray Dec 15, 2019
a236764
- Correcting typo in attribute name
peter-murray Dec 15, 2019
1542e1b
- Adding serialization tests and updating tests to avoid deprecated f…
peter-murray Dec 15, 2019
c553e3b
Updates for generating TypeScript definitions
peter-murray Dec 16, 2019
2c2fb0a
- Adding test for RGB
peter-murray Dec 16, 2019
7ad01cf
- Fixing error in handling of payload data, as it needs to support an…
peter-murray Dec 16, 2019
87ca119
- New object for bridge configuration data
peter-murray Dec 16, 2019
3b5dc27
- Fixing issues with color gamuts that made this nott work as intende…
peter-murray Dec 16, 2019
aac7a4f
4.0.0-alpha-3
peter-murray Dec 16, 2019
c673bda
Adding v2 compatibility notes
peter-murray Dec 20, 2019
ea4670d
4.0.0-beta.1
peter-murray Dec 20, 2019
ac814bb
Updting Tests via GitHub Actions
peter-murray Dec 27, 2019
dbf5254
Merge branch 'master' into 4.x
peter-murray Dec 27, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
9 changes: 6 additions & 3 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,25 @@
name: Node CI
name: Node Tests

on: [push]

jobs:
build:

runs-on: ubuntu-latest
runs-on: ${{ matrix.os }}

strategy:
max-parallel: 4
matrix:
os: [ubuntu-18.04, macos-latest, windows-latest]
node-version: [10.x, 12.x]

steps:
- uses: actions/checkout@v1

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}

- name: npm test
run: |
npm ci
Expand Down
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,7 @@ node_modules
# Scratch Files
scratch.js

.DS_Store
.DS_Store

# TypeScript Definition Files
*.d.ts
2 changes: 2 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
!*.d.ts
.idea
137 changes: 137 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,142 @@
# Change Log

## 4.0.0
- Deprecated v2 API and shim and modules removed from library

- Introduced rate limiting in the Light and Group set States to be compliant with the Hue API documentation best practices.
This only has an impact on this library, so it may be possible if you are running other software on your network
accessing the Bridge, you will still able to overload it.
* The whole API is currently limited to 12 requests per second by default (currently not configurable)
* `lights.setLightState()` is limited to 10 requests per second
* `groups.setState()` is limited to 1 request per second

- `v3.discovery.nupnp()` Now returns a different payload as it no longer accesses the XML Discovery endpoint to return
the bridge data as this can become unreliable when the bridge is overloaded. See the [documentation](./docs/discovery.md#n-upnpsearch)
for specifics.

- `v3.api` removed the `create` function as it was deprecated, use `createRemote()` fro the remote API, `createLocal()`
for the local API or `createInsecureLocal()` for non-hue bridges that do not support https connections

- `v3.Scene` has been removed, use the following functions to create a new Scene instance:
* `v3.model.createLightScene()`
* `v3.model.createGroupScene()`

This change has also allowed for the separation of the attributes and getter/setters locked down properly based on
the type of Scene, i.e. Cannot change the lights in a GroupScene (as they are controlled by the Group).

- `v3.sensors` has been removed, use `v3.model.createCLIPxxx()` functions instead

- `v3.rules` has been moved into `v3.model`
* To create a `Rule` use `v3.model.createRule()`
* To create a `RuleCondition` use `v3.model.ruleConditions.[group|sensor]`
* To create a `RuleAction` use `v3.model.ruleActions.[light|group|sensor|scene]`

- `v3.model` added to support exposing the underlying model objects that represent bridge objects. This module will allow
you to create all of the necessary objects, e.g. `createGroupScene()`

- Capabilities API:
* `capabilities.getAll()` now returns a [`Capabilities` object](./docs/capabilities.md#capabilities-object)

- Groups API:
* The following API functions will accept a Light Object as the `id` parameter as well as an integer value:
* `groups.get(id)`
* `groups.getGroup(id)`
* `deleteGroup(id)`
* `enableStreaming(id)`
* `disableStreaming(id)`
* `groups.createGroup(group)` introduced, it expects a pre-configured Group instance created using the model functions:
* `model.createLightGroup()`
* `model.createEntertainment()`
* `model.createRoom()`
* `model.createZone()`
* `groups.get(id)` has been deprecated, use `groups.getGroup(id)` instead.
* `groups.createGroup(name, lights)` has been deprecated, use `groups.createGroup(group)` instead.
* `groups.createRoom(name, lights, roomClass)` has been deprecated, use `groups.createGroup(group)` instead.
* `groups.createZone(name, lights, roomClass)` has been deprecated, use `groups.createGroup(group)` instead.
* `groups.updateAttributes(id, data)` has been deprecated, Use `groups.updateGroupAttributes(group)` instead.

- Lights API:
* `getLightById(id)` is deprecated use `getLight(id)` instead
* `rename(id, name)` is deprecated, use `renameLight(light)` instead
* The following API functions will accept a Light Object as the `id` parameter as well as an integer value:
* `getLight(id)`
* `getLightById(id)`
* `getLightAttributesAndState(id)`
* `getLightState(id)`
* `setLightState(id, state)`
* `deleteLight(id)`

- Scenes API:
* `getScene(id)` introduced, can take a scene id or `Scene` instance as the id value
* `get(id)` has been deprecated, use `getScene(id)` instead
* `getByName(name)` has been depricated use `getSceneByName(name)` instead
* `updateScene(scene)` introduced to replace `update(id, scene)` for updating Scenes
* `update(id, scene)` has been deprecated, will be removed in `5.x`, use `updateScene(scene)` instead
* `deleteScene(id)` can accept a scene id or a `Scene` object as the `id` parameter
* `activateScene(id)` can accept a scene id value or a `Scene` object
* `updateLightState(id, lightId, sceneLightState)` can take an id value or `Scene`/`Light` for the `id` and `lightId` values respectively

- Sensors API:
* `get(id)` has been depreciated use `getSensor(id)` instead
* `getSensor(id)` will accept a `Sensor` Object as the `id` or the integer `id` value as parameter.
* `updateName(id, name)` has been deprecated, will be removed in `5.x`, use `reanmeSensor(sensor)` instead
* `renameSensor(sensor)` has been added to allow updating of the name only for a sensor (makes API consistent with `lights` and `sensors`)
* `getSensorByName(name)` added to get sensors by `name`

- Rules API:
* The following API functions will accept a Rule Object as the `id` parameter as well as an integer value:
* `get(id)`
* `deleteRule(id)`
* Added `getRuleByName(name)` function to get rules by `name`
* Rule Actions were common to the new `Schedules`, so have been moved from `v3.model.ruleActions` to `v3.model.actions`.
Use of `v3.model.ruleActions` is considered deprecated.

- Schedules API:
* The schedules API is finally properly implemented, along with all the various Hue Bridge TimePatterns
* `model.timePatterns` provides an interface with creating the various timePatterns, consult the [documentation](./docs/timePatterns.mc) for details

* The previous `schedules.update(id, schedule)` function has been removed and replaced with `schedules.update(schedule)`.

_I am fairly sure that the previous version was most likely never used (base on the implmenetation as it would
have likely errored). With this knowledge, it was not deprecated and just removed. If you are impacted by this change, please raise an Issue._

- ResourceLinks API:
* New API interacting with `ResourceLinks` via, `api.resourceLinks`, see [documentation](./docs/resourcelinks.md) for more details.

- Configuration API:
* `get()` has been deprecated, use `getConfiguration()` instead
* `update()` has bee depricated, use `updateConfiguration()` instead

- All creation function calls to the bridge will now return the created model object. This change makes it consistent as
some calls would return the object, others would return the id but no other data.

This changes return object from the promise on the following calls:
* `api.rules.createRule()`
* `api.scenes.createScene()`
* `api.sensors.createSensor()`

- Type system from the `LightState` definitions is now used in all Bridge Object Models to define the attributes/properties
obtained from the Bridge.

This provides a consistent validation mechanism to all bridge related attributes data. As part of this being used in
the models, some validation is performed at the time of setting a value instead of waiting on when sending it to the
hue bridge (some things still have to wait be sent to the bridge) so the validation is closer to the point of call.

- Added ability to serialize a model object into JSON and then restore it to a corresponding object from the JSON
payload. This was requested to aid in server/client side code situations, as the creation of the model objects are
not directly exposed in the library by design. Related to issue #132

- Creating Sensors (CLIP variety) has changed as the classes for the sensor objects are no longer directly accessible.
All `CLIPxxx` sensors need to be built from the `v3.model.createCLIP[xxx]Sensor()` function for the desired type,
e.g. `v3.model.createCLIPGenericStatusSensor()` for a `CLIPGenericStatus` sensor.

The function call to instantiate the sensors also no longer take an object to set various attributes of the sensor,
you need to call the approriate setter on the class now to set the attribute, e.g. `sensor.manufacturername = 'node-hue-api-sensor';`

- TypeScript definitions added to the library

- Adding more in-depth tests to further increase coverage around types and models, and adding more edge case API level tests

## 3.4.3
- Long term fix for supporting older bridge types and creating new users. Issue #147

Expand Down
Loading