-
Notifications
You must be signed in to change notification settings - Fork 27
Conversation
…d ocf schema files and updated the README for Wink Thermostat. Have not run test automation yet... that's the next step.
…and adds the main attribute.
Using the schema name as ResURI, and add ID to GET QueryString. This will make it easier to implement RAML in a cloud service that implements accessing this schema.
Also fixed the test scripts and package.json to make the tests work, and use the updating naming conventions in the opent2t library.
Fixed thingTranslator naming conventions to match what opent2t library expects, and updated RAML conventions to map to function names in thingTranslator. Test automation is currently failing, but due to an actual issue with the wink translator! So the test is actually working, but the translator is legitmately failing. That will be addressed separately as part of #52.
As part of this, I have moved the wink helper to the v2 api and signficantly cleaned it up. I have fixed the wink thermostat translator, but now the other wink translators need to be fixed as well. I will follow up with subsequent checkins to resolve as part of #40.
<property name="targetTemperatureLow" type="d" access="readwrite"> | ||
<description>Minimum target temperature (in Celsius).</description> | ||
</property> | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
change units to fahrenheit
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, I stuck with Celsius on purpose.... that's the SI unit. May be a little un-american of me, perhaps :)
For what it's worth, the Wink API (for which we are writing the first translator) also uses Celsius units: http://docs.winkapiv2.apiary.io/#reference/device/thermostats
#ByDesign
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree with using Celsius units here, as long as the type is decimal not integer so there is no loss of precision when converting on either side.
Note the OCF thermostat schema that we've been discussing actually specifies the units in the property JSON.
(I am an American, and I think non-metric units are silly and old-fashioned.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's not much point in making changes to the AllJoyn schemas now, until we decide whether and how we are going to align the AllJoyn schemas with OCF. Maybe we will even auto-convert them from OCF.
In reply to: 75208998 [](ancestors = 75208998,75194786)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sanjaiganesh I think this is #ByDesign. If you disagree, please file a bug.
|
@sanjaiganesh per the discussion in #51 we should put that in the build script rather than include files inside the package.json as a fixed entry. Please file a separate tracking issue if you are concerned. |
Any use of "files" or "main" in the package.json here is going to be wrong because of how the package.json file is in the wrong directory. Both properties will be automatically generated/overwritten by the build script anyway. In reply to: 240483336 [](ancestors = 240483336) Refers to: org.OpenT2T.WindowShade.SuperPopular.Sample/org.OpenT2T.Test.WindowShade/js/package.json:10 in 0f69203. [](commit_id = 0f69203, deletion_comment = False) |
@@ -3,9 +3,9 @@ | |||
<!-- associated voice handler --> | |||
<voice id="" /> | |||
<!-- associated schema --> | |||
<schema id="org.OpenT2T.Thermostat.SuperPopular.Sample" /> | |||
<schema id="org.opent2t.sample.thermostat.superpopular" /> | |||
<!-- associated onboarding module --> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we intending to support both a single element at the top level as well as one or more elements under a element? The parsing code in my lib PR currently only supports the latter, but I can change it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This nest thermostat translator has not been updated as part of this PR (none of the other translators have been updated either). So let's ignore whatever that says (other than renaming/casing changes of course).
The Wink Thermostat is under review here. Issue #36 tracks updating all the other translators (Once we agree on this one I can do a series of PRs modifying all the other translators one by one following the same pattern)
This class follows the AllJoyn schema, which is not in sync with the RAML schema of the same name. Since the schema .js file references the RAML version, this translator is not consistent with that. Refers to: org.opent2t.sample.thermostat.superpopular/com.nest.thermostat/js/thingTranslator.js:91 in 0f69203. [](commit_id = 0f69203, deletion_comment = False) |
var delay = require('delay') | ||
|
||
// This boilerplate code is copied from transpiled typescript AVA test code, which enables usage of 'yield' keyword. | ||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm concerned that this, and the use of __awaiter and yield below, makes the test code look far more complicated than it needs to be. We want other developers to be able to copy this test code to use for writing tests for translators they develop. If we're not using TypeScript, then we should just write the test code in normal ES6 syntax with .then() callbacks instead of awaits.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is .js file. I felt this was looking clean and we really want us to use a test runner like ava, for all its benefits. when we setup lab, we know how many total test cases and how many passed etc.. May be we can simplify this by removing this boilerplate code and fixing it.
In reply to: 75198452 [](ancestors = 75198452)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can have all those benefits while using normal .then() callbacks instead of this __awaiter which is messy and unfamiliar to people. AVA doesn't require TypeScript or await.
In reply to: 75208579 [](ancestors = 75208579,75198452)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a great discussion, but I'm hoping we don't need to block this PR for this. @sanjaiganesh I added issue #55 to track this... perhaps you could take a stab at it? For this PR I think this is #WontFix and we can clean it up later (very soon hopefully, perhaps tomorrow/friday).
@jasongin as long as you see my note about the nest thermostat translator being out of scope for this PR, I think I have addressed all feedback so far. Do you guys have more feedback? |
|
1 similar comment
|
There are a few large fixes in here. See below:
Sorry this is such a large merge... but needed multiple rounds of feedback of the holistic design. Will try to make future PRs atomic and easier to review one at a time.