WebThingsIO / gateway

WebThings Gateway - a self-hosted web application for monitoring and controlling a building over the web
http://webthings.io/gateway
Mozilla Public License 2.0
2.62k stars 339 forks source link

Add `profile` member to Thing Descriptions - closes #2909 #3077

Closed benfrancis closed 1 year ago

benfrancis commented 1 year ago

This PR adds the profile member to Thing Descriptions as per the W3C WoT Thing Description 1.1 and WoT Profile 1.0 specifications.

Once #3074 and this PR have landed, web things exposed by WebThings Gateway should be conformant with the HTTP Basic Profile and HTTP SSE Profile from the latest Working Draft of the W3C WoT Profile specification.

There may still be a few niggles to iron out, but this is a big milestone.

benfrancis commented 1 year ago

If @relu91 isn't able to get to this, might you be able to find time to review, @tim-hellhake?

codecov-commenter commented 1 year ago

Codecov Report

Merging #3077 (9a93725) into master (7b5282e) will increase coverage by 0.03%. The diff coverage is 100.00%.

:exclamation: Current head 9a93725 differs from pull request most recent head ebaea13. Consider uploading reports for the commit ebaea13 to get more accurate results

@@            Coverage Diff             @@
##           master    #3077      +/-   ##
==========================================
+ Coverage   65.81%   65.85%   +0.03%     
==========================================
  Files         125      125              
  Lines        9400     9411      +11     
  Branches     1742     1748       +6     
==========================================
+ Hits         6187     6198      +11     
  Misses       3212     3212              
  Partials        1        1              
Impacted Files Coverage Δ
src/constants.ts 100.00% <100.00%> (ø)
src/models/thing.ts 72.07% <100.00%> (+0.73%) :arrow_up:

... and 2 files with indirect coverage changes

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

benfrancis commented 1 year ago

r=me

relu91 commented 1 year ago

Sorry for not being able to review this in time, but given the uncertain future of the profile does this worth it?

benfrancis commented 1 year ago

@relu91 wrote:

Sorry for not being able to review this in time, but given the uncertain future of the profile does this worth it?

Yes, it's absolutely worth it. Unless you know something I don't know, WoT Profiles 1.0 and WoT Profiles 2.0 have been included as deliverables in the next W3C WoT Working Group charter so will continue be worked on for at least another two years.

The main reason that WoT Profiles 1.0 has not already been published as a W3C Recommendation is the lack of implementations, which is why I've spent the last six months working on profile implementations in WebThings Gateway (producer) and WebThings Cloud (consumer).

In my view the Web of Things can not provide meaningful interoperability without profiles, so they are absolutely essential. I would strongly encourage other WoT developers to implement the latest draft of the WoT Profiles specification in order to contribute to the standaridsation process.

benfrancis commented 1 year ago

Note: The primary stated purpose of the W3C WoT Testfest this week is to gather implementation experience of Profiles, which is why I've landed this today, so that it can be included in the implementation report.

relu91 commented 1 year ago

That is cool, I was worried that after Michael stepped down we were losing a lot of support for the Profile document. But you are right let's see how things proceed.