mirror of
https://github.com/He4eT/simple-spaceapi.git
synced 2026-05-04 17:37:24 +00:00
SpaceAPI: unify unit formats
This commit is contained in:
parent
3f5282b3a7
commit
34cc2742a0
3 changed files with 6 additions and 4 deletions
|
|
@ -312,7 +312,7 @@ export default ({ strapi }: { strapi: Core.Strapi }) => ({
|
||||||
])(properties))
|
])(properties))
|
||||||
.map(([k, {value, unit}]) => [k, {
|
.map(([k, {value, unit}]) => [k, {
|
||||||
value,
|
value,
|
||||||
unit: unit === 'Degree' ? '°' : unit,
|
unit: unit === 'degree' ? '°' : unit,
|
||||||
}]);
|
}]);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,8 @@
|
||||||
"collectionName": "components_wind_directions",
|
"collectionName": "components_wind_directions",
|
||||||
"info": {
|
"info": {
|
||||||
"displayName": "Direction",
|
"displayName": "Direction",
|
||||||
"icon": "feather"
|
"icon": "feather",
|
||||||
|
"description": ""
|
||||||
},
|
},
|
||||||
"options": {},
|
"options": {},
|
||||||
"attributes": {
|
"attributes": {
|
||||||
|
|
@ -13,7 +14,7 @@
|
||||||
"unit": {
|
"unit": {
|
||||||
"type": "enumeration",
|
"type": "enumeration",
|
||||||
"enum": [
|
"enum": [
|
||||||
"Degree"
|
"degree"
|
||||||
],
|
],
|
||||||
"required": true
|
"required": true
|
||||||
}
|
}
|
||||||
|
|
|
||||||
3
types/generated/components.d.ts
vendored
3
types/generated/components.d.ts
vendored
|
|
@ -267,11 +267,12 @@ export interface StateStateIcon extends Struct.ComponentSchema {
|
||||||
export interface WindDirection extends Struct.ComponentSchema {
|
export interface WindDirection extends Struct.ComponentSchema {
|
||||||
collectionName: 'components_wind_directions';
|
collectionName: 'components_wind_directions';
|
||||||
info: {
|
info: {
|
||||||
|
description: '';
|
||||||
displayName: 'Direction';
|
displayName: 'Direction';
|
||||||
icon: 'feather';
|
icon: 'feather';
|
||||||
};
|
};
|
||||||
attributes: {
|
attributes: {
|
||||||
unit: Schema.Attribute.Enumeration<['Degree']> & Schema.Attribute.Required;
|
unit: Schema.Attribute.Enumeration<['degree']> & Schema.Attribute.Required;
|
||||||
value: Schema.Attribute.Decimal & Schema.Attribute.Required;
|
value: Schema.Attribute.Decimal & Schema.Attribute.Required;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue