Regarding zetta browser

28 views
Skip to first unread message

kedia.y...@gmail.com

unread,
Jun 19, 2017, 5:37:52 AM6/19/17
to zetta-discuss
I am IoT beginner. I was trying my hands on Zetta.

If i am writing this as init. 

LED.prototype.init = function(config) {
  var controls = ['capability1' , 'capability2'];

  config
    .type('device')
    .state('off')
    .name('my-device')
    .when('on', { allow: controls.concat(['turn-off', 'color-loop']) })
    .when('off', { allow: controls.concat(['turn-on', 'color-loop']) })
    .when('colorloop', { allow: controls.concat(['turn-on', 'turn-off']) })
    .map('turn-on', this.turnOn)
    .map('turn-off', this.turnOff)
    .map('capability1', this.cap1)
    .map('capability2', this.cap2)
    .map('color-loop', this.colorLoop);
};


Is it possible to hide 'turn-on' , 'turn-off' , 'colorloop' from the zetta browser UI by modifying my code. 

I want that it should show 'capability1' and 'capability2' as the only available options to the user.

Thank you

Adam Magaluk

unread,
Jun 19, 2017, 7:20:43 AM6/19/17
to kedia.y...@gmail.com, zetta-discuss
No it's not possible today. Each State and it's available are sent to the API. The browser consumes the entire API but could be forked with custom logic to hide things.

We've previously discussed hidden transitions here: https://github.com/zettajs/zetta-device/issues/18 

Why are you trying to hide `turn-on' , 'turn-off' , 'colorloop' from the browsers? Do you need to be able to call those transitions through the zetta API outside the browser?
 


--
You received this message because you are subscribed to the Google Groups "zetta-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to zetta-discus...@googlegroups.com.
To post to this group, send email to zetta-...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/zetta-discuss/07fddb37-bf44-4e60-8b93-aa0d1b592a62%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Yash Kedia

unread,
Jun 19, 2017, 7:45:19 AM6/19/17
to Adam Magaluk, zetta-discuss
Thank you Adam.

Capability is the set of transitions, so I want user to fire that capability and respective transitions and state changes occur automatically at back-end and user just gets the final output.    

To unsubscribe from this group and stop receiving emails from it, send an email to zetta-discuss+unsubscribe@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages