Skip to content

Commit

Permalink
Add more categories/types of devices + new units (#1479)
Browse files Browse the repository at this point in the history
Co-authored-by: Pierre-Gilles Leymarie <pierregilles.leymarie@gmail.com>
  • Loading branch information
VonOx and Pierre-Gilles authored May 3, 2022
1 parent bc12998 commit 5ca643f
Show file tree
Hide file tree
Showing 4 changed files with 388 additions and 13 deletions.
111 changes: 107 additions & 4 deletions front/src/config/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -1556,36 +1556,104 @@
"deviceFeatureUnit": {
"celsius": "Celsius (°C)",
"fahrenheit": "Fahrenheit (°F)",
"kelvin": "Kelvin (K)",
"percent": "Percent (%)",
"pascal": "Pascal (Pa)",
"hPa": "Hectopascal (hPa)",
"bar": "Bar",
"psi": "Pound-force per square inch (psi)",
"lux": "Lux",
"ppm": "Parts per million (ppm)",
"watt": "Watt (W)",
"kilowatt": "Kilowatt (kW)",
"watt-hour": "Watt heure (Wh)",
"kilowatt-hour": "Kilowatt hour (kWh)",
"megawatt-hour": "Megawatt hour (MWh)",
"ampere": "Ampere (A)",
"milliampere": "Milliampere (mA)",
"millivolt": "Millivolt (mV)",
"volt": "Volt (V)",
"ppm": "Parts per million (ppm)",
"volt-ampere": "Voltampere (VA)",
"volt-ampere-reactive": "Voltampere reactive (var)",
"mm": "Millimeter (mm)",
"cm": "Centimeter (cm)",
"mm": "Millimeter (mm)"
"m": "Meter (m)",
"km": "Kilometer (km)",
"degree": "Angular degree (°)",
"liter": "Liter (l)",
"milliliter": "Milliliter (ml)",
"cubicmeter": "Cubic meter (m3)",
"euro": "Euro (€)",
"dollar": "Dollar ($)",
"bitcoin": "Bitcoin (₿)",
"litecoin": "Litecoin (Ł)",
"dogecoin": "Dogecoin (Ð)",
"ethereum": "Ethereum (⟠)",
"pound-sterling": "Pound sterling (£)",
"meter-per-second": "Meter per second (m/s)",
"kilometer-per-hour": "Kilometer per hour (km/h)",
"millimeter-per-hour": "Millimeter per hour (mm/h)",
"uv-index": "UV Index",
"microseconds": "Microseconds (μs)",
"milliseconds": "Milliseconds (ms)",
"seconds": "Seconds (s)",
"minutes": "Minutes (min)",
"hours": "Hours (h)",
"days": "Days (d)",
"weeks": "Weeks (w)",
"months": "Months (m)",
"years": "Years (y)"
},
"deviceFeatureUnitShort": {
"celsius": "°C",
"fahrenheit": "°F",
"kelvin": "K",
"percent": "%",
"pascal": "Pa",
"hPa": "hPa",
"bar": "bar",
"psi": "psi",
"lux": "lx",
"ppm": "ppm",
"watt": "W",
"kilowatt": "kW",
"watt-hour": "Wh",
"kilowatt-hour": "kWh",
"megawatt-hour": "MWh",
"ampere": "A",
"milliampere": "mA",
"millivolt": "mV",
"volt": "V",
"ppm": "ppm",
"volt-ampere": "VA",
"volt-ampere-reactive": "var",
"mm": "mm",
"cm": "cm",
"mm": "mm"
"m": "m",
"km": "km",
"degree": "°",
"liter": "l",
"milliliter": "ml",
"cubicmeter": "m3",
"euro": "",
"dollar": "$",
"bitcoin": "",
"litecoin": "Ł",
"dogecoin": "Ð",
"ethereum": "",
"pound-sterling": "£",
"meter-per-second": "m/s",
"kilometer-per-hour": "km/h",
"millimeter-per-hour": "mm/h",
"uv-index": "UV Index",
"microseconds": "μs",
"milliseconds": "ms",
"seconds": "s",
"minutes": "min",
"hours": "h",
"days": "d",
"weeks": "w",
"months": "m",
"years": "y"
},
"deviceFeatureValue": {
"type": {
Expand Down Expand Up @@ -1760,6 +1828,41 @@
"stop": "Stop",
"record": "Record"
},
"energy-sensor": {
"shortCategoryName": "Energy sensor",
"voltage": "Voltage",
"current": "Current",
"binary": "Switch",
"power": "Power",
"energy": "Energy",
"index": "Index"
},
"volume-sensor": {
"shortCategoryName": "Volume sensor",
"decimal": "Volume (decimal)",
"integer": "Volume (integer)"
},
"currency": {
"shortCategoryName": "Money",
"decimal": "Currency"
},
"speed-sensor": {
"shortCategoryName": "Speed sensor",
"decimal": "Speed"
},
"precipitation-sensor": {
"shortCategoryName": "Precipitation sensor",
"decimal": "Precipitation"
},
"uv-sensor": {
"shortCategoryName": "UV Sensor",
"integer": "UV Index"
},
"duration": {
"shortCategoryName": "Duration",
"decimal": "Duration (decimal)",
"integer": "Duration (integer)"
},
"unknown": {
"shortCategoryName": "Unknown",
"unknown": "Unknown"
Expand Down
111 changes: 107 additions & 4 deletions front/src/config/i18n/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -1556,36 +1556,104 @@
"deviceFeatureUnit": {
"celsius": "Celsius (°C)",
"fahrenheit": "Fahrenheit (°F)",
"kelvin": "Kelvin (K)",
"percent": "Pourcent (%)",
"pascal": "Pascal (Pa)",
"hPa": "Hectopascal (hPa)",
"bar": "Bar",
"psi": "Livre-force par pouce carré (psi)",
"lux": "Lux",
"ppm": "Partie par million (ppm)",
"watt": "Watt",
"kilowatt": "Kilowatt",
"watt-hour": "Watt heure (Wh)",
"kilowatt-hour": "Kilowatt heure (kWh)",
"megawatt-hour": "Mégawatt heure (MWh)",
"ampere": "Ampère (A)",
"milliampere": "Milliampère (mA)",
"millivolt": "Millivolt (mV)",
"volt": "Volt (V)",
"ppm": "Partie par million (ppm)",
"volt-ampere": "Voltampère (VA)",
"volt-ampere-reactive": "Voltampère réactif (var)",
"mm": "Millimètre (mm)",
"cm": "Centimètre (cm)",
"mm": "Millimètre (mm)"
"m": "Mètre (m)",
"km": "Kilomètre (km)",
"degree": "Degré d'angle (°)",
"liter": "Litre (l)",
"milliliter": "Millilitre (ml)",
"cubicmeter": "Mètre cube (m3)",
"euro": "Euro (€)",
"dollar": "Dollar ($)",
"bitcoin": "Bitcoin (₿)",
"litecoin": "Litecoin (Ł)",
"dogecoin": "Dogecoin (Ð)",
"ethereum": "Ethereum (⟠)",
"pound-sterling": "livre sterling (£)",
"meter-per-second": "Mètre par seconde (m/s)",
"kilometer-per-hour": "Kilomètre par heure (km/h)",
"millimeter-per-hour": "Millimètre par heure (mm/h)",
"uv-index": "Indice UV",
"microseconds": "Microsecondes (μs)",
"milliseconds": "Millisecondes (ms)",
"seconds": "Secondes (s)",
"minutes": "Minutes (min)",
"hours": "Heures (h)",
"days": "Jours (j)",
"weeks": "Semaines (sem)",
"months": "Mois (m)",
"years": "Années (an)"
},
"deviceFeatureUnitShort": {
"celsius": "°C",
"fahrenheit": "°F",
"kelvin": "K",
"percent": "%",
"pascal": "Pa",
"hPa": "hPa",
"bar": "bar",
"psi": "psi",
"lux": "lx",
"ppm": "ppm",
"watt": "W",
"kilowatt": "kW",
"watt-hour": "Wh",
"kilowatt-hour": "kWh",
"megawatt-hour": "MWh",
"ampere": "A",
"milliampere": "mA",
"millivolt": "mV",
"volt": "V",
"ppm": "ppm",
"volt-ampere": "VA",
"volt-ampere-reactive": "var",
"mm": "mm",
"cm": "cm",
"mm": "mm"
"m": "m",
"km": "km",
"degree": "°",
"liter": "l",
"milliliter": "ml",
"cubicmeter": "m3",
"euro": "",
"dollar": "$",
"bitcoin": "",
"litecoin": "Ł",
"dogecoin": "Ð",
"ethereum": "",
"pound-sterling": "£",
"meter-per-second": "m/s",
"kilometer-per-hour": "km/h",
"millimeter-per-hour": "mm/h",
"uv-index": "Indice UV",
"microseconds": "μs",
"milliseconds": "ms",
"seconds": "s",
"minutes": "min",
"hours": "h",
"days": "j",
"weeks": "sem",
"months": "m",
"years": "an"
},
"deviceFeatureValue": {
"type": {
Expand Down Expand Up @@ -1760,6 +1828,41 @@
"stop": "Stop",
"record": "Enregistrer"
},
"energy-sensor": {
"shortCategoryName": "Capteur d'énergie",
"voltage": "Tension",
"current": "Intensité",
"binary": "Relais",
"power": "Puissance",
"energy": "Energie",
"index": "Index"
},
"volume-sensor": {
"shortCategoryName": "Capteur de volume",
"decimal": "Volume (décimale)",
"integer": "Volume (entier)"
},
"currency": {
"shortCategoryName": "Devise",
"decimal": "Monnaie"
},
"speed-sensor": {
"shortCategoryName": "Vitesse",
"decimal": "Vitesse"
},
"precipitation-sensor": {
"shortCategoryName": "Capteur de précipitations",
"decimal": "Précipitation"
},
"uv-sensor": {
"shortCategoryName": "Capteur d'UV",
"integer": "Indice UV"
},
"duration": {
"shortCategoryName": "Durée",
"decimal": "Durée (décimale)",
"integer": "Durée (entier)"
},
"unknown": {
"shortCategoryName": "Inconnu",
"unknown": "Inconnu"
Expand Down
28 changes: 28 additions & 0 deletions front/src/utils/consts.js
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,34 @@ export const DeviceFeatureCategoriesIcon = {
[DEVICE_FEATURE_CATEGORIES.BUTTON]: {
[DEVICE_FEATURE_TYPES.BUTTON.CLICK]: 'circle'
},
[DEVICE_FEATURE_CATEGORIES.ENERGY_SENSOR]: {
[DEVICE_FEATURE_TYPES.ENERGY_SENSOR.BINARY]: 'power',
[DEVICE_FEATURE_TYPES.ENERGY_SENSOR.POWER]: 'zap',
[DEVICE_FEATURE_TYPES.ENERGY_SENSOR.ENERGY]: 'zap',
[DEVICE_FEATURE_TYPES.ENERGY_SENSOR.CURRENT]: 'zap',
[DEVICE_FEATURE_TYPES.ENERGY_SENSOR.VOLTAGE]: 'zap',
[DEVICE_FEATURE_TYPES.ENERGY_SENSOR.INDEX]: 'zap'
},
[DEVICE_FEATURE_CATEGORIES.SPEED_SENSOR]: {
[DEVICE_FEATURE_TYPES.SPEED_SENSOR.DECIMAL]: 'wind'
},
[DEVICE_FEATURE_CATEGORIES.UV_SENSOR]: {
[DEVICE_FEATURE_TYPES.UV_SENSOR.INTEGER]: 'sun'
},
[DEVICE_FEATURE_CATEGORIES.PRECIPITATION_SENSOR]: {
[DEVICE_FEATURE_TYPES.PRECIPITATION_SENSOR.DECIMAL]: 'umbrella'
},
[DEVICE_FEATURE_CATEGORIES.CURRENCY]: {
[DEVICE_FEATURE_TYPES.CURRENCY.DECIMAL]: 'dollar-sign'
},
[DEVICE_FEATURE_CATEGORIES.VOLUME_SENSOR]: {
[DEVICE_FEATURE_TYPES.VOLUME_SENSOR.DECIMAL]: 'package',
[DEVICE_FEATURE_TYPES.VOLUME_SENSOR.INTEGER]: 'package'
},
[DEVICE_FEATURE_CATEGORIES.DURATION]: {
[DEVICE_FEATURE_TYPES.DURATION.DECIMAL]: 'watch',
[DEVICE_FEATURE_TYPES.DURATION.INTEGER]: 'clock'
},
[DEVICE_FEATURE_CATEGORIES.UNKNOWN]: {
[DEVICE_FEATURE_TYPES.UNKNOWN.UNKNOWN]: 'help-circle'
}
Expand Down
Loading

0 comments on commit 5ca643f

Please sign in to comment.