GSoC 2019 Coding Period Week 13

I made a video tutorial Build a Web of Things project using the WoT:API module. This video contains the entire process from enabling the module to lighting the LED. The main demonstration content is as follows: Download the WoT:API module using composer composer require 'drupal/wotapi:1.x-dev' -vvv Enable all modules of the WOTAPI package. Add thing type: Lamp Manage fields » Add field » Thing property:Switch. check: Create referenced entities if they don’t already exist.

GSoC 2019 Coding Period Week 12

I created a route /things/{thing_id}/actions to execute the action that the user requested through the POST. Interface description: Actions resource.

GSoC 2019 Coding Period Week 11

I create a custom Thing action field to associate the user-created Thing Action with a Thing.

GSoC 2019 Coding Period Week 10

I don’t think actions should be predefined. This is the description of the Action object. 2.11 Action object An action object describes a function which can be carried out on a device. Take a blinking LED on plugged into a Raspberry Pi as an example. I followed the tutorial Blinking LED on Raspberry Pi using Golang and succeeded in making the LED blinking. I need to customize the GPIO pin and set the pin to output mode.

GSoC 2019 Coding Period Week 9

Answer the previous question mentioned in the blog post. How does type restrict the type of field that stores the property value? Remove the type item in the Thing property type form. I’ve made some progress. I can get the information from a specific Thing property entity. It contains the field value and storage information. It means it doesn’t need to fill out the value of type in the bundle of the Thing property type.

GSoC 2019 Coding Period Week 8

Since the JSON:API code base is very large, after copying the jsonapi module into the wotapi code base, I deleted a lot of things, such as the Query folder, but it was not enough. Cutting out the code base makes it easier for me to move forward. This is one endpoint of the jsonapi to the listing route to get a list of entities. All I need is a Thing Entity, and everything else is indexed to it based on a Thing Entity.

GSoC 2019 Coding Period Week 7

As I mentioned in another blog, I can edit the value of Thing property when creating the Thing entity by Inline Entity Form (IEF). After adding an Entity Reference type of field, commonly used WIDGET is Autocomplete/Autocomplete (tags style) instead of IEF. In the case of points, IEF is used by default after adding a field of entity reference type where the target type is points. So I need to refer to points to implement hook_entity_presave().

GSoC 2019 Coding Period Week 6

In the past few weeks, I have been thinking: why does the Property object in Thing resource not contain the value of the Thing property? It’s clear that type refers to the type of value the property stores, and the property itself is an Object containing fields such as title, description, and so on. Property object: "temperature": { "title": "Temperature", "type": "number", "unit": "degree celsius", "readOnly": true, "description": "An ambient temperature sensor", "links": [{"href": "/things/pi/properties/temperature"}] } Project resource:

GSoC 2019 Coding Period Week 5

Last week, I try to show mentor the demo of property. So, I add a new field to the thing bundle. When the mentor saw that there was no Thing property to add a new field, he asked me: why is there no Thing property? I said Property is in Other of Reference category. But he said it should be shown on the outside, and I insisted there was no difference.

GSoC 2019 Coding Period Week 4

I made a mistake last week. Thanks so much for the mentor pointing out my mistake. I filled in the wrong data in the screenshot of the blog for testing. The mentor found the problem after reading, and we spent a long time discussing related content. I placed the field that should be defined on the property entity incorrectly on the property bundle. Take the JSONAPI example again. Relationships under Entity contain the type and ID information of the related Entity, but not the storage information of the related Entity.