Skip to content

Commit

Permalink
feat: MIN/MAX humidity (#38)
Browse files Browse the repository at this point in the history
fixes #38
  • Loading branch information
pilotak authored Jan 13, 2025
1 parent 7997572 commit e35be26
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 7 deletions.
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@ Configuration variables:
- **rain_rate**: Rain rate (mm or in)
- **pressure**: Pressure (hPa or inHg)
- **humidity**: Relative humidity (%)
- **humidity_indoor**: Relative humidity (%)
- **humidity_indoor**: Relative indoor humidity (%)
- **humidity_max**: Max relative humidity (%)
- **humidity_min**: Min relative humidity (%)
- **cloud_height**: Cloud Height (m or ft)
- **forecast**: string based output ie.: night showers
- **station**: station name with time added
Expand All @@ -54,8 +56,8 @@ Configuration variables:
- **vp_solar**: Solar Irradiation (W/m² or BTU/(h×ft²))
- **uv_index**: UV Index
- **apparent_temp**: Apparent temperature (°C or °F)
- **apparent_temp_min**: Min pparent temperature (°C or °F)
- **apparent_temp_max**: Max pparent temperature (°C or °F)
- **apparent_temp_min**: Min apparent temperature (°C or °F)
- **apparent_temp_max**: Max apparent temperature (°C or °F)
## Install via [HACS](https://github.com/custom-components/hacs)
You can find this integration in a store.
Expand Down
2 changes: 1 addition & 1 deletion custom_components/clientraw/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@
"iot_class": "cloud_polling",
"issue_tracker": "https://github.com/pilotak/homeassistant-clientraw/issues",
"requirements": [],
"version": "2.7.1"
"version": "2.8.0"
}
26 changes: 25 additions & 1 deletion custom_components/clientraw/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
async_call_later)
from homeassistant.util.unit_system import METRIC_SYSTEM

__version__ = '2.7.1'
__version__ = '2.8.0'

_LOGGER = logging.getLogger(__name__)

Expand Down Expand Up @@ -147,6 +147,16 @@
PERCENTAGE,
PERCENTAGE,
'mdi:water-percent'],
'humidity_max': [
'Max Humidity',
PERCENTAGE,
PERCENTAGE,
'mdi:water-percent'],
'humidity_min': [
'Min Humidity',
PERCENTAGE,
PERCENTAGE,
'mdi:water-percent'],
'cloud_height': [
'Cloud Height',
UnitOfLength.METERS,
Expand Down Expand Up @@ -760,6 +770,20 @@ def try_again(err: str):
else:
new_state = STATE_UNAVAILABLE

elif dev.type == 'humidity_min':
if self.data[164] != '-' and self.data[164] != '--' \
and self.data[164] != '---':
new_state = float(self.data[164])
else:
new_state = STATE_UNAVAILABLE

elif dev.type == 'humidity_max':
if self.data[163] != '-' and self.data[163] != '--' \
and self.data[163] != '---':
new_state = float(self.data[163])
else:
new_state = STATE_UNAVAILABLE

_LOGGER.debug("%s %s", dev.type, new_state)

# pylint: disable=protected-access
Expand Down
6 changes: 4 additions & 2 deletions info.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ Configuration variables:
- **pressure**: Pressure (hPa or inHg)
- **humidity**: Relative humidity (%)
- **humidity_indoor**: Relative humidity (%)
- **humidity_max**: Max relative humidity (%)
- **humidity_min**: Min relative humidity (%)
- **cloud_height**: Cloud Height (m or ft)
- **forecast**: string based output ie.: night showers
- **station**: station name with time added
Expand All @@ -50,8 +52,8 @@ Configuration variables:
- **vp_solar**: Solar Irradiation (W/m² or BTU/(h×ft²))
- **uv_index**: UV Index
- **apparent_temp**: Apparent temperature (°C or °F)
- **apparent_temp_min**: Min pparent temperature (°C or °F)
- **apparent_temp_max**: Max pparent temperature (°C or °F)
- **apparent_temp_min**: Min apparent temperature (°C or °F)
- **apparent_temp_max**: Max apparent temperature (°C or °F)
A full configuration example can be found below:
Expand Down

0 comments on commit e35be26

Please sign in to comment.