Skip to content

Commit

Permalink
Adding more specific mapping for controllers
Browse files Browse the repository at this point in the history
  • Loading branch information
aholstenson committed Jan 23, 2018
1 parent d830c07 commit 0105563
Show file tree
Hide file tree
Showing 9 changed files with 16 additions and 16 deletions.
4 changes: 2 additions & 2 deletions lib/devices/gateway/86sw1.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
'use strict';

const SubDevice = require('./subdevice');
const { Controller } = require('abstract-things/controllers');
const { WallController, Actions } = require('abstract-things/controllers');

module.exports = class Switch1 extends SubDevice.with(Controller) {
module.exports = class Switch1 extends SubDevice.with(WallController, Actions) {
constructor(parent, info) {
super(parent, info);

Expand Down
4 changes: 2 additions & 2 deletions lib/devices/gateway/86sw2.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
'use strict';

const SubDevice = require('./subdevice');
const { Controller } = require('abstract-things/controllers');
const { WallController, Actions } = require('abstract-things/controllers');

module.exports = class Switch2 extends SubDevice.with(Controller) {
module.exports = class Switch2 extends SubDevice.with(WallController, Actions) {
constructor(parent, info) {
super(parent, info);

Expand Down
4 changes: 2 additions & 2 deletions lib/devices/gateway/cube.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict';

const SubDevice = require('./subdevice');
const { Controller } = require('abstract-things/controllers');
const { Controller, Actions } = require('abstract-things/controllers');

/**
* Cube device, emits `action` with an object when someone interacts with
Expand All @@ -16,7 +16,7 @@ const { Controller } = require('abstract-things/controllers');
* * `free_fall` - when the cube is dropped in a free fall
* * `swing` - when the cube is held in hand and the fake thrown
*/
module.exports = class Cube extends SubDevice.with(Controller) {
module.exports = class Cube extends SubDevice.with(Controller, Actions) {
constructor(parent, info) {
super(parent, info);

Expand Down
2 changes: 1 addition & 1 deletion lib/devices/gateway/subdevice.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class SubDeviceManagement {

module.exports = Thing.type(Parent => class SubDevice extends Parent {
static get types() {
return [ 'miio:subdevice' ];
return [ 'miio', 'miio:subdevice' ];
}

constructor(parent, info) {
Expand Down
4 changes: 2 additions & 2 deletions lib/devices/gateway/switch.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
'use strict';

const SubDevice = require('./subdevice');
const { Controller } = require('abstract-things/controllers');
const { Button, Actions } = require('abstract-things/controllers');

module.exports = class Switch extends SubDevice.with(Controller) {
module.exports = class Switch extends SubDevice.with(Button, Actions) {
constructor(parent, info) {
super(parent, info);

Expand Down
4 changes: 2 additions & 2 deletions lib/devices/gateway/switch2.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
'use strict';

const SubDevice = require('./subdevice');
const { Controller } = require('abstract-things/controllers');
const { Button, Actions } = require('abstract-things/controllers');

module.exports = class Switch extends SubDevice.with(Controller) {
module.exports = class Switch extends SubDevice.with(Button, Actions) {
constructor(parent, info) {
super(parent, info);

Expand Down
2 changes: 1 addition & 1 deletion lib/devices/yeelight.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ const Yeelight = Thing.type(Parent => class Yeelight extends Parent
* Set maximum fade time to 30s - seems to work well, longer values
* sometimes cause jumps on certain models.
*/
this.maxChangeTime = '30s';
this.updateMaxChangeTime('30s');
}

propertyUpdated(key, value) {
Expand Down
6 changes: 3 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"node": ">=6.6.0"
},
"dependencies": {
"abstract-things": "^0.8.0",
"abstract-things": "^0.9.0",
"appdirectory": "^0.1.0",
"chalk": "^2.3.0",
"debug": "^3.1.0",
Expand Down

0 comments on commit 0105563

Please sign in to comment.