Skip to content

Commit 87ce6e1

Browse files
chore(pre-commit.ci): pre-commit autoupdate (#268)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent 4c470b2 commit 87ce6e1

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ ci:
99

1010
repos:
1111
- repo: https://github.com/commitizen-tools/commitizen
12-
rev: v4.11.2
12+
rev: v4.12.1
1313
hooks:
1414
- id: commitizen
1515
stages: [commit-msg]
@@ -41,7 +41,7 @@ repos:
4141
hooks:
4242
- id: isort
4343
- repo: https://github.com/psf/black-pre-commit-mirror
44-
rev: 25.12.0
44+
rev: 26.1.0
4545
hooks:
4646
- id: black
4747
- repo: https://github.com/codespell-project/codespell

src/xiaomi_ble/parser.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -467,7 +467,7 @@ def obj1001(
467467
if len(xobj) != 3:
468468
return {}
469469

470-
(button_type, value, press_type) = BUTTON_STRUCT(xobj)
470+
button_type, value, press_type = BUTTON_STRUCT(xobj)
471471

472472
# button_type represents the pressed button or rubiks cube rotation direction
473473
remote_command = None
@@ -920,7 +920,7 @@ def obj100d(
920920
) -> dict[str, Any]:
921921
"""Temperature and humidity"""
922922
if len(xobj) == 4:
923-
(temp, humi) = TH_STRUCT(xobj)
923+
temp, humi = TH_STRUCT(xobj)
924924
device.update_predefined_sensor(SensorLibrary.TEMPERATURE__CELSIUS, temp / 10)
925925
device.update_predefined_sensor(SensorLibrary.HUMIDITY__PERCENTAGE, humi / 10)
926926
return {}
@@ -962,7 +962,7 @@ def obj2000(
962962
) -> dict[str, Any]:
963963
"""Body temperature"""
964964
if len(xobj) == 5:
965-
(temp1, temp2, bat) = TTB_STRUCT(xobj)
965+
temp1, temp2, bat = TTB_STRUCT(xobj)
966966
# Body temperature is calculated from the two measured temperatures.
967967
# Formula is based on approximation based on values in the app in
968968
# the range 36.5 - 37.8.
@@ -1633,7 +1633,7 @@ def obj4e16(
16331633
if len(xobj) != 9:
16341634
return {}
16351635

1636-
(profile_id, data, timestamp) = struct.unpack("<BII", xobj)
1636+
profile_id, data, timestamp = struct.unpack("<BII", xobj)
16371637
if data == 0:
16381638
return {}
16391639

@@ -1654,7 +1654,7 @@ def obj6e16(
16541654
xobj: bytes, device: XiaomiBluetoothDeviceData, device_type: str
16551655
) -> dict[str, Any]:
16561656
"""Body Composition Scale S400"""
1657-
(profile_id, data, _) = struct.unpack("<BII", xobj)
1657+
profile_id, data, _ = struct.unpack("<BII", xobj)
16581658
if not data:
16591659
return {}
16601660
mass = data & 0x7FF
@@ -1866,7 +1866,7 @@ def _parse_hhcc(self, service_info: BluetoothServiceInfo, data: bytes) -> bool:
18661866
self.set_device_manufacturer("HHCC Plant Technology Co. Ltd")
18671867

18681868
xvalue_1 = data[0:3]
1869-
(moist, temp) = struct.unpack(">BH", xvalue_1)
1869+
moist, temp = struct.unpack(">BH", xvalue_1)
18701870
self.update_predefined_sensor(SensorLibrary.TEMPERATURE__CELSIUS, temp / 10)
18711871
self.update_predefined_sensor(SensorLibrary.MOISTURE__PERCENTAGE, moist)
18721872

@@ -1875,7 +1875,7 @@ def _parse_hhcc(self, service_info: BluetoothServiceInfo, data: bytes) -> bool:
18751875
self.update_predefined_sensor(SensorLibrary.LIGHT__LIGHT_LUX, illu)
18761876

18771877
xvalue_3 = data[6:9]
1878-
(batt, cond) = struct.unpack(">BH", xvalue_3)
1878+
batt, cond = struct.unpack(">BH", xvalue_3)
18791879
self.update_predefined_sensor(SensorLibrary.BATTERY__PERCENTAGE, batt)
18801880
self.update_predefined_sensor(SensorLibrary.CONDUCTIVITY__CONDUCTIVITY, cond)
18811881

0 commit comments

Comments
 (0)