Skip to content

Commit

Permalink
README.md edit
Browse files Browse the repository at this point in the history
  • Loading branch information
sahilchaddha committed Nov 26, 2018
1 parent 5797041 commit 4325a1f
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 8 deletions.
3 changes: 2 additions & 1 deletion .npmignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
node_modules/
demo.gif
demo.gif
serial-no.jpeg
39 changes: 37 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,18 @@ Edit config.json. Refer to `config-sample.json`.
custom
```

### Writing Custom Preset
### Writing Custom Color Flow

If you want to write a custom flow, scene should be `custom` in config.json. Also provide `params` paramameter.

Example :
```json
{
"name": "Dark Cave",
"scene": "custom",
"params": "2000,1,255,70,2000,1,255,100,5000,1,255,70,3000,1,13369548,100,3000,1,13369548,10"
}
```

Sample Preset: `"1000, 2, 2700, 100, 500, 1,255, 10, 5000, 7, 0,0, 500, 2, 5000, 1"`

Expand Down Expand Up @@ -69,7 +80,7 @@ When this value is -1, brightness in this tuple is ignored (only color or CT cha

## TODO
```
// Edit README + Add Config Details for lights & custom presets + Add Supported Devices + RGB + shouldturnoff
// Add Supported Devices
// Demo
```

Expand Down Expand Up @@ -163,6 +174,30 @@ https://www.mi.com/us/mi-bedside-lamp/
}
```

## Plugin Config :

| Config | Type | Description | Default |
|------------------------------------|---------------------|-------------------------------------------------------|--------|
| addResetSwitch | bool | Should add Reset Switch to reset all scenes. | true|
| shouldTurnOff | bool | Should turn off lights after scene is over. set false if you want lights to go back to their original state | true|
| scenes | Array (Object) | Scenes | Required|
| rgb | Object (light ID: true/false) | Key-Value pair for light Ids you wish to use rgb pallete instead of hsv. | Optional|

### Scenes Config :

| Config | Type | Description | Default |
|------------------------------------|---------------------|-------------------------------------------------------|--------|
| name | string | Accessory Name | Required, Unique|
| scene | string | Scene Name. For lists of scenes refer to [Available Preset Scenes](https://github.com/sahilchaddha/homebridge-yeelight-platform#available-presets-scenes) | Required|
| params | string | Custom Color Flow Params. This parameter is required if scene is `custom`. Refer to [Writing Color Flow params](https://github.com/sahilchaddha/homebridge-yeelight-platform#writing-custom-preset) | Optional|
| lights | Array (string) | Array of Light Ids to set scene to. All other lights will be ignored. | Run scene on all lights|

### Getting Light ID :

Once your light is connected and displayed on Home App. You can get its light ID by simply looking at Serial Number of the accessory in Home App.

![SerialNo](https://raw.githubusercontent.com/sahilchaddha/homebridge-yeelight-platform/master/serial-no.jpeg)

## Lint

```shell
Expand Down
Binary file added serial-no.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 5 additions & 5 deletions src/flows.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ module.exports = {
night_mode: ['on', 'smooth', 500, 5],
birthday_party: [0, 0, '1996,1,14438425,80,1996,1,14448670,80,1996,1,11153940,80'],
candle_flicker: [0, 0, '800,2,2700,50,800,2,2700,30,1200,2,2700,80,800,2,2700,60,1200,2,2700,90,2400,2,2700,50,1200,2,2700,80,800,2,2700,60,400,2,2700,70'],
disco: [0, 0, '1000,1,1047627,80,2000,1,1032444,100,1000,1,16519104,80,2000,1,16534287,100,2000,1,1047746,40'],
disco: [0, 0, '1000,1,1047627,80,2000,1,1032444,100,1000,1,16519104,80,2000,1,16711696,100,2000,1,1047746,40'],
flash_notify: [0, 0, '1000,2,2700,100,1000,7,0,0,1000,2,2700,10,1000,7,0,0'],
police_1: [0, 0, '1000,1,1002236,100,1000,7,0,0,1000,1,16534287,10,1000,7,0,0'],
police_2: [0, 0, '1000,1,1002236,100,1000,1,1002236,10,1000,1,16534287,50,1000,1,1002236,30,1000,7,0,0,1000,1,16534287,10,1000,7,0,0'],
alarm: [0, 0, '1000,1,16534287,100,1000,1,16534287,20'],
gaming: [0, 0, '3000,1,16534287,80,2000,7,0,0,2000,1,1032444,90,1000,7,0,0,6000,1,3394611,100,3000,1,10040319,70,4000,7,0,0,3000,1,16737996,100,2000,7,0,0'],
police_1: [0, 0, '1000,1,1002236,100,1000,7,0,0,1000,1,16711696,10,1000,7,0,0'],
police_2: [0, 0, '1000,1,1002236,100,1000,1,1002236,10,1000,1,16711696,50,1000,1,1002236,30,1000,7,0,0,1000,1,16711696,10,1000,7,0,0'],
alarm: [0, 0, '500,1,16711696,100,500,1,16711696,10'],
gaming: [0, 0, '3000,1,16711696,80,2000,7,0,0,2000,1,1032444,90,1000,7,0,0,6000,1,3394611,100,3000,1,10040319,70,4000,7,0,0,3000,1,16737996,100,2000,7,0,0'],
calm: [0, 0, '2000,1,255,70,2000,1,255,100,5000,1,255,70,3000,1,13369548,100,3000,1,13369548,10'],
}

2 comments on commit 4325a1f

@alon-z
Copy link
Contributor

@alon-z alon-z commented on 4325a1f Nov 26, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested your module yesterday and I couldn’t figure out why the hell the lights turns off after each scene.
Thanks for this commit!

@sahilchaddha
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@alonikomax Thanks for reporting the bug. Have merged the PR

Please sign in to comment.