Skip to content

Commit 3cb5ecd

Browse files
chore(pre-commit.ci): auto fixes
1 parent 103f74d commit 3cb5ecd

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

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)