fxbox / foxbox

The FoxBox daemon
Mozilla Public License 2.0
29 stars 29 forks source link

Thinkerbell Adapter now expects rules as an object instead of a serialized string. #529

Closed Yoric closed 8 years ago

Yoric commented 8 years ago

This should make things a bit more readable and a bit more robust.

In particular, this should fix 1) of https://github.com/fxbox/foxbox/pull/520#issuecomment-224869077 .

Yoric commented 8 years ago

r? @mcav (only for the #519 patch)

Yoric commented 8 years ago

Also, f? @azasypkin for the API changes. See changes in the tests for details.

mcav commented 8 years ago

lgtm

azasypkin commented 8 years ago

f+, looks good to me, just one question: is it expected that source getter still returns string instead of plain object?

https://local.609aebe9f46a699f80d6e0284c3334ddf879e125.box.knilxof.org:3000/api/v1/channels/get' -X PUT -H ..... --data-binary '[{"id":"thinkerbell/Everyday in the morning, camera takes a picture./source"}]'

Response: {"thinkerbell/Everyday in the morning, camera takes a picture./source":"{\"name\":\"Everyday in the morning, camera takes a picture.\",\"rules\":[{\"conditions\":[{\"feature\":\"clock/time-of-day-seconds\",\"source\":[{\"id\":\"getter:timeofday.clock@link.mozilla.org\"}],\"when\":{\"Geq\":{\"Duration\":28800}}}],\"execute\":[{\"destination\":[{\"id\":\"channel:snapshot.18db9b78-f188-11e5-9ce9-3ca9f47e346c@link.mozilla.org\"}],\"feature\":\"camera/store-snapshot\",\"value\":null}]}]}"}

Yoric commented 8 years ago

Good catch. I'll make both match.

Yoric commented 8 years ago

Ok, fixed.

@mcav, if you have a chance to take a look at the revised version, that would be great.

mcav commented 8 years ago

Okay, still looks good to me

On Jun 17, 2016, at 10:26 AM, David Rajchenbach-Teller notifications@github.com wrote:

Ok, fixed.

@mcav, if you have a chance to take a look at the revised version, that would be great.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

coveralls commented 8 years ago

Coverage Status

Coverage decreased (-0.05%) to 32.459% when pulling f04d91d9409d99b03f7d3f916fcc811c8adb5db7 on Yoric:refactor-thinkerbell into 7958cc3f71d532c690f0e3b2e46d7864d817dec1 on fxbox:master.