Compare commits

..

8 Commits

Author SHA1 Message Date
Викторов Андрей Германович
9d5ea9697d Bump version: 1.1.8b10 → 1.1.8b11 2023-10-17 10:03:52 +03:00
Викторов Андрей Германович
3e5435059d fix sensors 2023-10-16 11:00:01 +03:00
Викторов Андрей Германович
5fc4e1a31e Bump version: 1.1.8b9 → 1.1.8b10 2023-10-15 22:37:34 +03:00
Викторов Андрей Германович
cea3731336 fix sht31 2023-10-15 22:37:30 +03:00
Викторов Андрей Германович
5ffaf2d907 Bump version: 1.1.8b8 → 1.1.8b9 2023-10-15 22:06:37 +03:00
Викторов Андрей Германович
349f0183cb fix sht31 2023-10-15 22:06:08 +03:00
Викторов Андрей Германович
9ddca7c84f Bump version: 1.1.8b7 → 1.1.8b8 2023-10-15 21:12:13 +03:00
Викторов Андрей Германович
37b29c6369 i2c 2023-10-15 21:12:07 +03:00
4 changed files with 10 additions and 12 deletions

View File

@@ -1,5 +1,5 @@
[bumpversion]
current_version = 1.1.8b7
current_version = 1.1.8b11
parse = (?P<major>\d+)(\.(?P<minor>\d+))(\.(?P<patch>\d+))(?P<release>[bf]*)(?P<build>\d*)
commit = True
tag = True

View File

@@ -502,9 +502,9 @@ class MegaD:
__params = params.copy()
__params["i2c_par"] = 9
# инициализация сенсора
await self.request(i2c_dev=i2c_dev, **__params)
await self.request(**__params)
await asyncio.sleep(0.1)
self.sht31inited |= pt
self.sht31inited.add(pt)
delay = None
idx: int = params.pop("idx", None)
pt: int = params.get("pt", None)
@@ -519,11 +519,14 @@ class MegaD:
elif idx is not None and idx > 0:
v: str = self.values.get(f"chache_{pt}")
if idx is not None:
v = safe_float(v.split("/")[idx])
ret = {_params: v}
vv = v.split("/")
if len(vv) == 3:
v = vv[idx]
else:
v: None
ret = {_params: safe_float(v)}
except Exception:
self.lg.exception(f"while getting i2c {params=}")
except asyncio.TimeoutError:
return
self.lg.debug("i2c response: %s", ret)
if delay:

View File

@@ -159,11 +159,6 @@ i2c_classes = {
"opt3001": [
DeviceType(SensorDeviceClass.ILLUMINANCE, LIGHT_LUX, None),
],
"scd4x": [
DeviceType(SensorDeviceClass.CO2, CONCENTRATION_PARTS_PER_MILLION, None),
DeviceType(SensorDeviceClass.HUMIDITY, PERCENTAGE, None),
DeviceType(SensorDeviceClass.TEMPERATURE, TEMP_CELSIUS, None),
],
"ina226": [
Skip,
DeviceType(SensorDeviceClass.CURRENT, "A", None),

View File

@@ -15,5 +15,5 @@
"@andvikt"
],
"issue_tracker": "https://github.com/andvikt/mega_hacs/issues",
"version": "v1.1.8b7"
"version": "v1.1.8b11"
}