Skip to content

Commit

Permalink
fix: incorrect unit of measure
Browse files Browse the repository at this point in the history
grams of H₂O per gram of Air⁻¹ should be milligrams of H₂O per gram of
Air⁻¹
  • Loading branch information
TheRealWaldo committed Jul 11, 2021
1 parent 82610d9 commit 1f40058
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,17 +70,17 @@ sensor:
| `critical_temp_sensor` | Yes | Temperature sensor to use for calculations to avoid mold and condensation. Typically the coldest sensor in the room.
| `name` | No | Friendly name **Default**: Optimal Humidity
| `type` | No | The type of sensor to use for the primary state. Value can be any of the attributes listed below. **Default**: `optimal_humidity`
| `indoor_pressure_sensor` | No | Pressue sensor to use for calculations. If not included, will use the elevation set in Home Assistant to calculate the Standard Air Pressure.
| `comfortable_specific_humidity` | No | Overrides the comfortable specific humidity calculation. In grams of H₂O per gram of Air⁻¹ **Default**: Calculated based on `indoor_pressure_sensor` if available, or from Home Assistants elevation setting if not.
| `indoor_pressure_sensor` | No | Pressure sensor to use for calculations. If not included, will use the elevation set in Home Assistant to calculate the Standard Air Pressure.
| `comfortable_specific_humidity` | No | Overrides the comfortable specific humidity calculation. In milligrams of H₂O per gram of Air⁻¹ **Default**: Calculated based on `indoor_pressure_sensor` if available, or from Home Assistants elevation setting if not.

### Attributes

|Attribute|Unit|Description
|:---|---|---
| `dewpoint` | °C/°F | Dewpoint from the `indoor_temp_sensor` and `indoor_humidity_sensor` and `indoor_pressure_sensor` combined.
| `optimal_humidity` | %RH | The optimal set point in relative humidity for a humidifier or dehumidifier.
| `comfortable_specific_humidity` | grams of H₂O per gram of Air⁻¹ | Calculated based on `indoor_pressure_sensor` or Home Assitants elevation setting, 21°C and 45%RH. Can be overriden by using the `comfortable_specific_humidity` option.
| `specific_humidity` | grams of H₂O per gram of Air⁻¹ | Specific humidity from the `indoor_temp_sensor` and `indoor_humidity_sensor` and `indoor_pressure_sensor` combined.
| `comfortable_specific_humidity` | milligrams of H₂O per gram of Air⁻¹ | Calculated based on `indoor_pressure_sensor` or Home Assitants elevation setting, 21°C and 45%RH. Can be overriden by using the `comfortable_specific_humidity` option.
| `specific_humidity` | milligrams of H₂O per gram of Air⁻¹ | Specific humidity from the `indoor_temp_sensor` and `indoor_humidity_sensor` and `indoor_pressure_sensor` combined.
| `critical_humidity` | %RH | Calculated critical humidity at the coldest point in the room, using the `critical_temp_sensor`.
| `mold_warningr` | boolean | Whether or not there is a risk of mold at either the critical point or the indoor sensor location.
| `humidex` | °C/°F | Humidex usin the Canadian standard.
Expand Down
6 changes: 3 additions & 3 deletions custom_components/optimal_humidity/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@

DEFAULT_NAME = "Optimal Humidity"

GRAMS_OF_WATER_TO_GRAMS_OF_AIR = "g_H₂O g_Air⁻¹"
MILLIGRAMS_OF_WATER_TO_GRAMS_OF_AIR = "mg_H₂O g_Air⁻¹"
SENSOR_TYPES = {
ATTR_DEWPOINT: (
ATTR_DEWPOINT,
Expand All @@ -48,7 +48,7 @@
),
ATTR_SPECIFIC_HUMIDITY: (
ATTR_SPECIFIC_HUMIDITY,
GRAMS_OF_WATER_TO_GRAMS_OF_AIR,
MILLIGRAMS_OF_WATER_TO_GRAMS_OF_AIR,
"",
"mdi:water",
),
Expand Down Expand Up @@ -78,7 +78,7 @@
),
ATTR_COMFORTABLE_SPECIFIC_HUMIDITY: (
ATTR_COMFORTABLE_SPECIFIC_HUMIDITY,
GRAMS_OF_WATER_TO_GRAMS_OF_AIR,
MILLIGRAMS_OF_WATER_TO_GRAMS_OF_AIR,
"",
"mdi:water",
),
Expand Down
6 changes: 3 additions & 3 deletions custom_components/optimal_humidity/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
CONF_INDOOR_HUMIDITY,
CONF_CRITICAL_TEMP,
CONF_INDOOR_PRESSURE,
GRAMS_OF_WATER_TO_GRAMS_OF_AIR,
MILLIGRAMS_OF_WATER_TO_GRAMS_OF_AIR,
IDEAL_HUMIDITY,
IDEAL_TEMPERATURE,
SENSOR_TYPES,
Expand Down Expand Up @@ -520,7 +520,7 @@ def _calc_specific_humidity(self):
_LOGGER.debug(
"Specific humidity: %s %s",
self._specific_humidity,
GRAMS_OF_WATER_TO_GRAMS_OF_AIR,
MILLIGRAMS_OF_WATER_TO_GRAMS_OF_AIR,
)

def _calc_critical_humidity(self):
Expand Down Expand Up @@ -599,7 +599,7 @@ def _calc_comfortable_specific_humidity(self):
_LOGGER.debug(
"Optimal specific humidity set to %s%s",
self._comfortable_specific_humidity,
GRAMS_OF_WATER_TO_GRAMS_OF_AIR,
MILLIGRAMS_OF_WATER_TO_GRAMS_OF_AIR,
)

def _calc_optimal_humidex(self):
Expand Down

0 comments on commit 1f40058

Please sign in to comment.