Skip to content

Commit

Permalink
Update units of measurement (#106)
Browse files Browse the repository at this point in the history
  • Loading branch information
shbatm authored Jun 27, 2023
1 parent 9d20151 commit b2eda84
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 3 deletions.
29 changes: 28 additions & 1 deletion custom_components/isy994/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,18 @@
HVACMode,
)
from homeassistant.const import (
CONCENTRATION_MICROGRAMS_PER_CUBIC_METER,
CONCENTRATION_PARTS_PER_MILLION,
CURRENCY_CENT,
CURRENCY_DOLLAR,
DEGREE,
LIGHT_LUX,
PERCENTAGE,
POWER_VOLT_AMPERE_REACTIVE,
REVOLUTIONS_PER_MINUTE,
SERVICE_LOCK,
SERVICE_UNLOCK,
SIGNAL_STRENGTH_DECIBELS_MILLIWATT,
STATE_CLOSED,
STATE_CLOSING,
STATE_LOCKED,
Expand All @@ -41,6 +44,7 @@
STATE_UNLOCKED,
UV_INDEX,
Platform,
UnitOfApparentPower,
UnitOfElectricCurrent,
UnitOfElectricPotential,
UnitOfEnergy,
Expand Down Expand Up @@ -409,7 +413,7 @@
"92": f"{DEGREE} South",
UOM_8_BIT_RANGE: "", # Range 0-255, no unit.
UOM_DOUBLE_TEMP: UOM_DOUBLE_TEMP,
"102": "kWs",
"102": "kWs", # Kilowatt Seconds
"103": CURRENCY_DOLLAR,
"104": CURRENCY_CENT,
"105": UnitOfLength.INCHES,
Expand All @@ -427,6 +431,29 @@
"118": UnitOfPressure.HPA,
"119": UnitOfEnergy.WATT_HOUR,
"120": UnitOfVolumetricFlux.INCHES_PER_DAY,
"122": CONCENTRATION_MICROGRAMS_PER_CUBIC_METER, # Microgram per cubic meter
"123": f"bq/{UnitOfVolume.CUBIC_METERS}", # Becquerel per cubic meter
"124": f"pCi/{UnitOfVolume.LITERS}", # Picocuries per liter
"125": "pH",
"126": "bpm", # Beats per Minute
"127": UnitOfPressure.MMHG,
"128": "J",
"129": "BMI", # Body Mass Index
"130": f"{UnitOfVolume.LITERS}/{UnitOfTime.HOURS}",
"131": SIGNAL_STRENGTH_DECIBELS_MILLIWATT,
"132": "bpm", # Breaths per minute
"133": UnitOfFrequency.KILOHERTZ,
"134": f"{UnitOfLength.METERS}/{UnitOfTime.SECONDS}²",
"135": UnitOfApparentPower.VOLT_AMPERE, # Volt-Amp
"136": POWER_VOLT_AMPERE_REACTIVE, # VAR = Volt-Amp Reactive
"137": "", # NTP DateTime - Number of seconds since 1900
"138": UnitOfPressure.PSI,
"139": DEGREE, # Degree 0-360
"140": f"{UnitOfMass.MILLIGRAMS}/{UnitOfVolume.LITERS}",
"141": "N", # Netwon
"142": f"{UnitOfVolume.GALLONS}/{UnitOfTime.SECONDS}",
"143": "gpm", # Gallon per Minute
"144": "gph", # Gallon per Hour
}

UOM_TO_STATES: dict[str, dict[int, str]] = {
Expand Down
4 changes: 2 additions & 2 deletions custom_components/isy994/manifest.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
{
"domain": "isy994",
"name": "Universal Devices ISY/IoX",
"codeowners": ["@bdraco", "@shbatm"],
"config_flow": true,
"dhcp": [
Expand All @@ -19,12 +21,10 @@
}
],
"documentation": "https://www.home-assistant.io/integrations/isy994",
"domain": "isy994",
"integration_type": "hub",
"iot_class": "local_push",
"issue_tracker": "http://github.com/shbatm/hacs-isy994/issues",
"loggers": ["pyisyox"],
"name": "Universal Devices ISY/IoX",
"requirements": ["pyisyox==1.0.0a9"],
"ssdp": [
{
Expand Down

0 comments on commit b2eda84

Please sign in to comment.