Sensors: Wind

This commit is contained in:
He4eT 2025-04-01 23:40:11 +02:00
commit 95d6a5f4ac
10 changed files with 254 additions and 0 deletions

View 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
}
}
}

View file

@ -0,0 +1,7 @@
/**
* wind-sensor controller
*/
import { factories } from '@strapi/strapi'
export default factories.createCoreController('api::wind-sensor.wind-sensor');

View file

@ -0,0 +1,7 @@
/**
* wind-sensor router
*/
import { factories } from '@strapi/strapi';
export default factories.createCoreRouter('api::wind-sensor.wind-sensor');

View file

@ -0,0 +1,7 @@
/**
* wind-sensor service
*/
import { factories } from '@strapi/strapi';
export default factories.createCoreService('api::wind-sensor.wind-sensor');

View 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
}
}
}

View 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
}
}
}

View 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
}
}
}

View 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
}
}
}