Skip to content

Commit e35be26

Browse files
authored
feat: MIN/MAX humidity (#38)
fixes #38
1 parent 7997572 commit e35be26

File tree

4 files changed

+35
-7
lines changed

4 files changed

+35
-7
lines changed

README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,9 @@ Configuration variables:
4343
- **rain_rate**: Rain rate (mm or in)
4444
- **pressure**: Pressure (hPa or inHg)
4545
- **humidity**: Relative humidity (%)
46-
- **humidity_indoor**: Relative humidity (%)
46+
- **humidity_indoor**: Relative indoor humidity (%)
47+
- **humidity_max**: Max relative humidity (%)
48+
- **humidity_min**: Min relative humidity (%)
4749
- **cloud_height**: Cloud Height (m or ft)
4850
- **forecast**: string based output ie.: night showers
4951
- **station**: station name with time added
@@ -54,8 +56,8 @@ Configuration variables:
5456
- **vp_solar**: Solar Irradiation (W/m² or BTU/(h×ft²))
5557
- **uv_index**: UV Index
5658
- **apparent_temp**: Apparent temperature (°C or °F)
57-
- **apparent_temp_min**: Min pparent temperature (°C or °F)
58-
- **apparent_temp_max**: Max pparent temperature (°C or °F)
59+
- **apparent_temp_min**: Min apparent temperature (°C or °F)
60+
- **apparent_temp_max**: Max apparent temperature (°C or °F)
5961
6062
## Install via [HACS](https://github.com/custom-components/hacs)
6163
You can find this integration in a store.

custom_components/clientraw/manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@
77
"iot_class": "cloud_polling",
88
"issue_tracker": "https://github.com/pilotak/homeassistant-clientraw/issues",
99
"requirements": [],
10-
"version": "2.7.1"
10+
"version": "2.8.0"
1111
}

custom_components/clientraw/sensor.py

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
async_call_later)
2525
from homeassistant.util.unit_system import METRIC_SYSTEM
2626

27-
__version__ = '2.7.1'
27+
__version__ = '2.8.0'
2828

2929
_LOGGER = logging.getLogger(__name__)
3030

@@ -147,6 +147,16 @@
147147
PERCENTAGE,
148148
PERCENTAGE,
149149
'mdi:water-percent'],
150+
'humidity_max': [
151+
'Max Humidity',
152+
PERCENTAGE,
153+
PERCENTAGE,
154+
'mdi:water-percent'],
155+
'humidity_min': [
156+
'Min Humidity',
157+
PERCENTAGE,
158+
PERCENTAGE,
159+
'mdi:water-percent'],
150160
'cloud_height': [
151161
'Cloud Height',
152162
UnitOfLength.METERS,
@@ -760,6 +770,20 @@ def try_again(err: str):
760770
else:
761771
new_state = STATE_UNAVAILABLE
762772

773+
elif dev.type == 'humidity_min':
774+
if self.data[164] != '-' and self.data[164] != '--' \
775+
and self.data[164] != '---':
776+
new_state = float(self.data[164])
777+
else:
778+
new_state = STATE_UNAVAILABLE
779+
780+
elif dev.type == 'humidity_max':
781+
if self.data[163] != '-' and self.data[163] != '--' \
782+
and self.data[163] != '---':
783+
new_state = float(self.data[163])
784+
else:
785+
new_state = STATE_UNAVAILABLE
786+
763787
_LOGGER.debug("%s %s", dev.type, new_state)
764788

765789
# pylint: disable=protected-access

info.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ Configuration variables:
4040
- **pressure**: Pressure (hPa or inHg)
4141
- **humidity**: Relative humidity (%)
4242
- **humidity_indoor**: Relative humidity (%)
43+
- **humidity_max**: Max relative humidity (%)
44+
- **humidity_min**: Min relative humidity (%)
4345
- **cloud_height**: Cloud Height (m or ft)
4446
- **forecast**: string based output ie.: night showers
4547
- **station**: station name with time added
@@ -50,8 +52,8 @@ Configuration variables:
5052
- **vp_solar**: Solar Irradiation (W/m² or BTU/(h×ft²))
5153
- **uv_index**: UV Index
5254
- **apparent_temp**: Apparent temperature (°C or °F)
53-
- **apparent_temp_min**: Min pparent temperature (°C or °F)
54-
- **apparent_temp_max**: Max pparent temperature (°C or °F)
55+
- **apparent_temp_min**: Min apparent temperature (°C or °F)
56+
- **apparent_temp_max**: Max apparent temperature (°C or °F)
5557
5658
A full configuration example can be found below:
5759

0 commit comments

Comments
 (0)