Skip to content

Commit

Permalink
Bump black from 23.12.1 to 24.2.0 (#148)
Browse files Browse the repository at this point in the history
* Bump black from 23.12.1 to 24.2.0

Bumps [black](https://github.com/psf/black) from 23.12.1 to 24.2.0.
- [Release notes](https://github.com/psf/black/releases)
- [Changelog](https://github.com/psf/black/blob/main/CHANGES.md)
- [Commits](psf/black@23.12.1...24.2.0)

---
updated-dependencies:
- dependency-name: black
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>

* Run black

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Martin Hjelmare <[email protected]>
  • Loading branch information
dependabot[bot] and MartinHjelmare authored Mar 5, 2024
1 parent 6d6a504 commit a98547c
Show file tree
Hide file tree
Showing 10 changed files with 87 additions and 78 deletions.
1 change: 1 addition & 0 deletions aioecowitt/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""aioEcoWitt API wrapper."""

from .server import EcoWittListener
from .sensor import EcoWittSensor, EcoWittSensorTypes
from .station import EcoWittStation
1 change: 1 addition & 0 deletions aioecowitt/__main__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Run local Test server."""

from __future__ import annotations

import asyncio
Expand Down
1 change: 1 addition & 0 deletions aioecowitt/calc.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Weather datapoint calculator."""

from __future__ import annotations

import datetime as dt
Expand Down
1 change: 1 addition & 0 deletions aioecowitt/sensor.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Sensor and mapping data from ecowitt."""

from __future__ import annotations

import datetime as dt
Expand Down
1 change: 1 addition & 0 deletions aioecowitt/server.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""aioEcoWitt API server."""

from __future__ import annotations

import logging
Expand Down
1 change: 1 addition & 0 deletions aioecowitt/station.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Station mapping from ecowitt."""

from __future__ import annotations

from dataclasses import dataclass, field
Expand Down
155 changes: 78 additions & 77 deletions misc/fake_client.py
Original file line number Diff line number Diff line change
@@ -1,90 +1,91 @@
"""
A bone-simple fake client used to test the hass integration
"""

import http.client
import sys
import urllib.parse

MY_PASSKEY = '34271334ED1FADA6D8B988B14267E55D'
MY_PASSKEY = "34271334ED1FADA6D8B988B14267E55D"
# MY_PASSKEY = '35271334ED1FADA7D8B988B22222E22D'

paramset_a = {
'PASSKEY': MY_PASSKEY,
'stationtype': 'EasyWeatherV1.4.9',
'dateutc': '2020-11-13+17:10:24',
'tempinf': 76.8,
'humidityin': 22,
'baromrelin': 28.760,
'baromabsin': 28.760,
'tempf': 65.8,
'humidity': 24,
'winddir': 319,
'windspeedmph': 0.9,
'windgustmph': 1.1,
'rainratein': 0.000,
'eventrainin': 0.000,
'dailyrainin': 0.000,
'weeklyrainin': 0.024,
'monthlyrainin': 0.028,
'yearlyrainin': 0.843,
'solarradiation': 375.53,
'uv': 3,
'pm25_ch1': 8.0,
'pm25_avg_24h_ch1': 5.2,
'freq': '915M',
'model': 'HP3500_V1.6.2',
'leak_ch1': 0,
'leakbatt1': 5,
"PASSKEY": MY_PASSKEY,
"stationtype": "EasyWeatherV1.4.9",
"dateutc": "2020-11-13+17:10:24",
"tempinf": 76.8,
"humidityin": 22,
"baromrelin": 28.760,
"baromabsin": 28.760,
"tempf": 65.8,
"humidity": 24,
"winddir": 319,
"windspeedmph": 0.9,
"windgustmph": 1.1,
"rainratein": 0.000,
"eventrainin": 0.000,
"dailyrainin": 0.000,
"weeklyrainin": 0.024,
"monthlyrainin": 0.028,
"yearlyrainin": 0.843,
"solarradiation": 375.53,
"uv": 3,
"pm25_ch1": 8.0,
"pm25_avg_24h_ch1": 5.2,
"freq": "915M",
"model": "HP3500_V1.6.2",
"leak_ch1": 0,
"leakbatt1": 5,
}

paramset_b = {
'PASSKEY': MY_PASSKEY,
'stationtype': 'EasyWeatherV1.5.4',
'dateutc': '2020-11-16+15:30:24',
'tempinf': 68.7,
'humidityin': 52,
'baromrelin': 29.785,
'baromabsin': 29.785,
'tempf': 46.4,
'humidity': 94,
'winddir': 260,
'winddir_avg10m': 260,
'windspeedmph': 0.0,
'windspdmph_avg10m': 0.0,
'windgustmph': 0.0,
'maxdailygust': 6.9,
'rainratein': 0.000,
'eventrainin': 0.118,
'hourlyrainin': 0.000,
'dailyrainin': 0.118,
'weeklyrainin': 0.118,
'monthlyrainin': 0.378,
'yearlyrainin': 6.268,
'solarradiation': 0.00,
'uv': 0,
'soilmoisture1': 0,
'soilad1': 120,
'wh65batt': 1,
'wh25batt': 0,
'console_batt': 2.5,
'soilbatt1': 1.5,
'leak_ch1': 0,
'leakbatt1': 5,
'leak_ch2': 1,
'leakbatt2': 3,
'tf_co2': 56.7,
'humi_co2': 72,
'pm25_co2': 24.7,
'pm25_24h_co2': 29.4,
'pm10_co2': 24.7,
'pm10_24h_co2': 29.9,
'co2': 455,
'co2_24h': 464,
'co2_batt': 6,
'tf_ch1': 71.1,
'tf_batt1': 1.40,
'freq': '868M',
'model': 'HP1000SE-PRO_Pro_V1.6.0',
"PASSKEY": MY_PASSKEY,
"stationtype": "EasyWeatherV1.5.4",
"dateutc": "2020-11-16+15:30:24",
"tempinf": 68.7,
"humidityin": 52,
"baromrelin": 29.785,
"baromabsin": 29.785,
"tempf": 46.4,
"humidity": 94,
"winddir": 260,
"winddir_avg10m": 260,
"windspeedmph": 0.0,
"windspdmph_avg10m": 0.0,
"windgustmph": 0.0,
"maxdailygust": 6.9,
"rainratein": 0.000,
"eventrainin": 0.118,
"hourlyrainin": 0.000,
"dailyrainin": 0.118,
"weeklyrainin": 0.118,
"monthlyrainin": 0.378,
"yearlyrainin": 6.268,
"solarradiation": 0.00,
"uv": 0,
"soilmoisture1": 0,
"soilad1": 120,
"wh65batt": 1,
"wh25batt": 0,
"console_batt": 2.5,
"soilbatt1": 1.5,
"leak_ch1": 0,
"leakbatt1": 5,
"leak_ch2": 1,
"leakbatt2": 3,
"tf_co2": 56.7,
"humi_co2": 72,
"pm25_co2": 24.7,
"pm25_24h_co2": 29.4,
"pm10_co2": 24.7,
"pm10_24h_co2": 29.9,
"co2": 455,
"co2_24h": 464,
"co2_batt": 6,
"tf_ch1": 71.1,
"tf_batt1": 1.40,
"freq": "868M",
"model": "HP1000SE-PRO_Pro_V1.6.0",
}


Expand All @@ -101,12 +102,12 @@ def usage():
port = sys.argv[2]

# add a sensor
if len(sys.argv) > 3 and sys.argv[3] == 'add':
paramset_b['humidity2'] = 21
if len(sys.argv) > 3 and sys.argv[3] == "add":
paramset_b["humidity2"] = 21

print("Connecting to host {0} on port {0}".format(host, port))
conn = http.client.HTTPConnection(host, port)
headers = {'Content-type': 'application/x-www-form-urlencoded'}
headers = {"Content-type": "application/x-www-form-urlencoded"}
params = urllib.parse.urlencode(paramset_b)
print(params)
conn.request("POST", "", params, headers)
Expand Down
2 changes: 1 addition & 1 deletion requirements_tests.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
pytest==8.1.0
pytest-aiohttp==1.0.5
pytest-timeout==2.2.0
black==23.12.1
black==24.2.0
flake8==7.0.0
isort==5.13.2
mypy==1.8.0
Expand Down
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Setup module for EcoWitt."""

from pathlib import Path

from setuptools import find_packages, setup
Expand Down
1 change: 1 addition & 0 deletions tests/test_sensor.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Test ecowitt sensor module."""

import pytest

from aioecowitt import server
Expand Down

0 comments on commit a98547c

Please sign in to comment.