Skip to content

Commit

Permalink
feat: Add water device class to entity config
Browse files Browse the repository at this point in the history
Closes #733

fix(entity-config): Add missing moisture and wind speed device classes to entity config
  • Loading branch information
zachowj committed Nov 3, 2022
1 parent e4630fa commit 4e05721
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
4 changes: 3 additions & 1 deletion locales/en-US/entity-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,10 @@
"volatile_organic_compounds": "volatile organic compounds",
"voltage": "voltage",
"volume": "volume",
"water": "water",
"weight": "weight",
"window": "window"
"window": "window",
"wind_speed": "wind speed"
},
"entity_category": "Category",
"entity_category_options": {
Expand Down
6 changes: 6 additions & 0 deletions src/nodes/entity-config/editor/data/sensor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ const sensorDeviceClasses = [
'gas',
'humidity',
'illuminance',
'moisture',
'monetary',
'nitrogen_dioxide',
'nitrogen_monoxide',
Expand All @@ -33,7 +34,9 @@ const sensorDeviceClasses = [
'volatile_organic_compounds',
'voltage',
'volume',
'water',
'weight',
'wind_speed',
] as const;

// ISO 4217 Monetary value with a currency.
Expand All @@ -60,6 +63,7 @@ export const sensorUnitOfMeasurement: Record<
gas: ['m³', 'ft³'],
humidity: ['%'],
illuminance: ['lx', 'lm'],
moisture: ['%'],
monetary: monetaryList, // ISO 4217 Monetary value with a currency.
nitrogen_dioxide: ['µg/m³'],
nitrogen_monoxide: ['µg/m³'],
Expand All @@ -80,7 +84,9 @@ export const sensorUnitOfMeasurement: Record<
volatile_organic_compounds: ['µg/m³'],
voltage: ['V'],
volume: ['fl. oz.', 'ft³', 'gal', 'L', 'mL', 'm³'],
water: ['L', 'gal', 'm³', 'ft³'],
weight: ['g', 'kg', 'lb', 'mg', 'oz', 'µg'],
wind_speed: ['ft/s', 'km/h', 'kn', 'm/s', 'mph'],
};

export default [
Expand Down

0 comments on commit 4e05721

Please sign in to comment.