mirror of
https://github.com/He4eT/simple-spaceapi.git
synced 2026-05-05 01:47:24 +00:00
Sensors: Wind
This commit is contained in:
parent
27d259b31c
commit
95d6a5f4ac
10 changed files with 254 additions and 0 deletions
35
src/api/wind-sensor/content-types/wind-sensor/schema.json
Normal file
35
src/api/wind-sensor/content-types/wind-sensor/schema.json
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
{
|
||||
"kind": "collectionType",
|
||||
"collectionName": "wind_sensors",
|
||||
"info": {
|
||||
"singularName": "wind-sensor",
|
||||
"pluralName": "wind-sensors",
|
||||
"displayName": "Sensor: Wind",
|
||||
"description": ""
|
||||
},
|
||||
"options": {
|
||||
"draftAndPublish": false
|
||||
},
|
||||
"attributes": {
|
||||
"location": {
|
||||
"type": "string",
|
||||
"required": true
|
||||
},
|
||||
"name": {
|
||||
"type": "string"
|
||||
},
|
||||
"description": {
|
||||
"type": "text"
|
||||
},
|
||||
"lastchange": {
|
||||
"type": "biginteger"
|
||||
},
|
||||
"properties": {
|
||||
"displayName": "Properties",
|
||||
"type": "component",
|
||||
"repeatable": false,
|
||||
"component": "wind.properties",
|
||||
"required": true
|
||||
}
|
||||
}
|
||||
}
|
||||
7
src/api/wind-sensor/controllers/wind-sensor.ts
Normal file
7
src/api/wind-sensor/controllers/wind-sensor.ts
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
/**
|
||||
* wind-sensor controller
|
||||
*/
|
||||
|
||||
import { factories } from '@strapi/strapi'
|
||||
|
||||
export default factories.createCoreController('api::wind-sensor.wind-sensor');
|
||||
7
src/api/wind-sensor/routes/wind-sensor.ts
Normal file
7
src/api/wind-sensor/routes/wind-sensor.ts
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
/**
|
||||
* wind-sensor router
|
||||
*/
|
||||
|
||||
import { factories } from '@strapi/strapi';
|
||||
|
||||
export default factories.createCoreRouter('api::wind-sensor.wind-sensor');
|
||||
7
src/api/wind-sensor/services/wind-sensor.ts
Normal file
7
src/api/wind-sensor/services/wind-sensor.ts
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
/**
|
||||
* wind-sensor service
|
||||
*/
|
||||
|
||||
import { factories } from '@strapi/strapi';
|
||||
|
||||
export default factories.createCoreService('api::wind-sensor.wind-sensor');
|
||||
21
src/components/wind/direction.json
Normal file
21
src/components/wind/direction.json
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
{
|
||||
"collectionName": "components_wind_directions",
|
||||
"info": {
|
||||
"displayName": "Direction",
|
||||
"icon": "feather"
|
||||
},
|
||||
"options": {},
|
||||
"attributes": {
|
||||
"value": {
|
||||
"type": "decimal",
|
||||
"required": true
|
||||
},
|
||||
"unit": {
|
||||
"type": "enumeration",
|
||||
"enum": [
|
||||
"Degree"
|
||||
],
|
||||
"required": true
|
||||
}
|
||||
}
|
||||
}
|
||||
21
src/components/wind/elevation.json
Normal file
21
src/components/wind/elevation.json
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
{
|
||||
"collectionName": "components_wind_elevations",
|
||||
"info": {
|
||||
"displayName": "Elevation",
|
||||
"icon": "feather"
|
||||
},
|
||||
"options": {},
|
||||
"attributes": {
|
||||
"value": {
|
||||
"type": "decimal",
|
||||
"required": true
|
||||
},
|
||||
"unit": {
|
||||
"type": "enumeration",
|
||||
"enum": [
|
||||
"m"
|
||||
],
|
||||
"required": true
|
||||
}
|
||||
}
|
||||
}
|
||||
38
src/components/wind/properties.json
Normal file
38
src/components/wind/properties.json
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
{
|
||||
"collectionName": "components_wind_properties",
|
||||
"info": {
|
||||
"displayName": "Properties",
|
||||
"icon": "feather",
|
||||
"description": ""
|
||||
},
|
||||
"options": {},
|
||||
"attributes": {
|
||||
"speed": {
|
||||
"displayName": "Speed",
|
||||
"type": "component",
|
||||
"repeatable": false,
|
||||
"component": "wind.speed",
|
||||
"required": true
|
||||
},
|
||||
"gust": {
|
||||
"type": "component",
|
||||
"repeatable": false,
|
||||
"component": "wind.speed",
|
||||
"required": true
|
||||
},
|
||||
"direction": {
|
||||
"displayName": "Direction",
|
||||
"type": "component",
|
||||
"repeatable": false,
|
||||
"component": "wind.direction",
|
||||
"required": true
|
||||
},
|
||||
"elevation": {
|
||||
"displayName": "Elevation",
|
||||
"type": "component",
|
||||
"repeatable": false,
|
||||
"component": "wind.elevation",
|
||||
"required": true
|
||||
}
|
||||
}
|
||||
}
|
||||
23
src/components/wind/speed.json
Normal file
23
src/components/wind/speed.json
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
{
|
||||
"collectionName": "components_wind_speeds",
|
||||
"info": {
|
||||
"displayName": "Speed",
|
||||
"icon": "cursor"
|
||||
},
|
||||
"options": {},
|
||||
"attributes": {
|
||||
"value": {
|
||||
"type": "decimal",
|
||||
"required": true
|
||||
},
|
||||
"unit": {
|
||||
"type": "enumeration",
|
||||
"enum": [
|
||||
"m/s",
|
||||
"km/h",
|
||||
"kn"
|
||||
],
|
||||
"required": true
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue