Skip to content

Commit

Permalink
Patch 1 (#3)
Browse files Browse the repository at this point in the history
* Update sensor.py

add console_batt used by wn1980

* Update calc.py (#1)

add console_batt for wn1980 console

* console_batt (#2)

* Update calc.py

add console_batt for wn1980 console

* add console_batt

* Update fake_client.py for console_batt

* Update const.py for console_batt

* Update test_calc.py for console_batt

* Update test_server.py for console_batt

* Update test_server.py

* Update example.data

* Update example.data

* Update fake_client.py typo

* Update sensor.py black format
  • Loading branch information
pantonvich authored Jan 30, 2024
1 parent 85ac6ff commit 998271e
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 6 deletions.
3 changes: 3 additions & 0 deletions aioecowitt/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,9 @@ class EcoWittMapping:
"wh65batt": EcoWittMapping("WH65 Battery", EcoWittSensorTypes.BATTERY_BINARY),
"wh68batt": EcoWittMapping("WH68 Battery", EcoWittSensorTypes.BATTERY_VOLTAGE),
"wh80batt": EcoWittMapping("WH80 Battery", EcoWittSensorTypes.BATTERY_VOLTAGE),
"console_batt": EcoWittMapping(
"Console Battery", EcoWittSensorTypes.BATTERY_VOLTAGE
),
"soilbatt1": EcoWittMapping("Soil Battery 1", EcoWittSensorTypes.BATTERY_VOLTAGE),
"soilbatt2": EcoWittMapping("Soil Battery 2", EcoWittSensorTypes.BATTERY_VOLTAGE),
"soilbatt3": EcoWittMapping("Soil Battery 3", EcoWittSensorTypes.BATTERY_VOLTAGE),
Expand Down
2 changes: 1 addition & 1 deletion misc/example.data
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<MultiDictProxy('PASSKEY': '34271334ED1FADA6D8B988B14267E55D', 'stationtype': 'EasyWeatherV1.4.9', 'dateutc': '2020-05-04 14:34:26', 'tempinf': '79.0', 'humidityin': '33', 'baromrelin': '28.583', 'baromabsin': '28.583', 'tempf': '70.3', 'humidity': '32', 'winddir': '200', 'windspeedmph': '0.4', 'windgustmph': '1.1', 'rainratein': '0.000', 'eventrainin': '0.000', 'dailyrainin': '0.000', 'weeklyrainin': '0.079', 'monthlyrainin': '0.079', 'yearlyrainin': '0.079', 'solarradiation': '205.52', 'uv': '2', 'freq': '915M', 'model': 'HP3500_V1.6.2')>


<MultiDictProxy('PASSKEY': '345544D8EAF42E1B8824A86D8250D5A3', 'stationtype': 'GW2000A_V2.1.5', 'runtime': '188738', 'dateutc': '2022-07-15 15:26:14', 'tempinf': '78.80', 'humidityin': '53', 'baromrelin': '27.885', 'baromabsin': '27.885', 'tempf': '87.08', 'humidity': '34', 'winddir': '289', 'windspeedmph': '2.91', 'windgustmph': '3.13', 'maxdailygust': '12.53', 'solarradiation': '530.62', 'uv': '4', 'rrain_piezo': '0.000', 'erain_piezo': '0.000', 'hrain_piezo': '0.000', 'drain_piezo': '0.000', 'wrain_piezo': '0.000', 'mrain_piezo': '0.000', 'yrain_piezo': '0.000', 'ws90cap_volt': '5.4', 'ws90_ver': '119', 'wh90batt': '2.74', 'freq': '868M', 'model': 'GW2000A')>
<MultiDictProxy('PASSKEY': '345544D8EAF42E1B8824A86D8250D5A3', 'stationtype': 'GW2000A_V2.1.5', 'runtime': '188738', 'dateutc': '2022-07-15 15:26:14', 'tempinf': '78.80', 'humidityin': '53', 'baromrelin': '27.885', 'baromabsin': '27.885', 'tempf': '87.08', 'humidity': '34', 'winddir': '289', 'windspeedmph': '2.91', 'windgustmph': '3.13', 'maxdailygust': '12.53', 'solarradiation': '530.62', 'uv': '4', 'rrain_piezo': '0.000', 'erain_piezo': '0.000', 'hrain_piezo': '0.000', 'drain_piezo': '0.000', 'wrain_piezo': '0.000', 'mrain_piezo': '0.000', 'yrain_piezo': '0.000', 'ws90cap_volt': '5.4', 'ws90_ver': '119', 'wh90batt': '2.74', 'console_batt': '2.5', 'freq': '868M', 'model': 'GW2000A')>
2 changes: 1 addition & 1 deletion misc/fake_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
'soilmoisture1': 0,
'wh65batt': 1,
'wh25batt': 0,
'console_bat': 2.5,
'console_batt': 2.5,
'soilbatt1': 1.5,
'leak_ch1': 0,
'leakbatt1': 5,
Expand Down
8 changes: 4 additions & 4 deletions tests/test_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ def on_change(sensor: server.EcoWittSensor) -> None:
text = await resp.text()
assert text == "OK"

assert len(sensors) == 50
assert len(ecowitt_server.sensors) == 50
assert len(sensors) == 51
assert len(ecowitt_server.sensors) == 51
assert len(ecowitt_server.stations) == 1

assert "PASSKEY" not in ecowitt_server.last_values[GW2000A_DATA["PASSKEY"]]
Expand All @@ -69,8 +69,8 @@ def on_change(sensor: server.EcoWittSensor) -> None:
text = await resp.text()
assert text == "OK"

assert len(sensors) == 50
assert len(ecowitt_server.sensors) == 50
assert len(sensors) == 51
assert len(ecowitt_server.sensors) == 51
assert len(ecowitt_server.stations) == 1


Expand Down

0 comments on commit 998271e

Please sign in to comment.