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))
|
||||
.map(([k, {value, unit}]) => [k, {
|
||||
value,
|
||||
unit: unit === 'Degree' ? '°' : unit,
|
||||
unit: unit === 'degree' ? '°' : unit,
|
||||
}]);
|
||||
|
||||
return {
|
||||
|
|
|
|||
|
|
@ -2,7 +2,8 @@
|
|||
"collectionName": "components_wind_directions",
|
||||
"info": {
|
||||
"displayName": "Direction",
|
||||
"icon": "feather"
|
||||
"icon": "feather",
|
||||
"description": ""
|
||||
},
|
||||
"options": {},
|
||||
"attributes": {
|
||||
|
|
@ -13,7 +14,7 @@
|
|||
"unit": {
|
||||
"type": "enumeration",
|
||||
"enum": [
|
||||
"Degree"
|
||||
"degree"
|
||||
],
|
||||
"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 {
|
||||
collectionName: 'components_wind_directions';
|
||||
info: {
|
||||
description: '';
|
||||
displayName: 'Direction';
|
||||
icon: 'feather';
|
||||
};
|
||||
attributes: {
|
||||
unit: Schema.Attribute.Enumeration<['Degree']> & Schema.Attribute.Required;
|
||||
unit: Schema.Attribute.Enumeration<['degree']> & Schema.Attribute.Required;
|
||||
value: Schema.Attribute.Decimal & Schema.Attribute.Required;
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue