Skip to content

Commit 5aaee29

Browse files
author
Ernst
committed
Fix typing of mac
1 parent 4c6acba commit 5aaee29

36 files changed

+36
-36
lines changed

custom_components/ble_monitor/ble_parser/acconeer.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
}
1414

1515

16-
def parse_acconeer(self, data: bytes, mac: str):
16+
def parse_acconeer(self, data: bytes, mac: bytes):
1717
"""Acconeer parser"""
1818
msg_length = len(data)
1919
firmware = "Acconeer"

custom_components/ble_monitor/ble_parser/airmentor.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ def parse_2s(msg_type, xvalue):
104104
return None
105105

106106

107-
def parse_airmentor(self, data: bytes, mac: str):
107+
def parse_airmentor(self, data: bytes, mac: bytes):
108108
"""Parser for Air Mentor"""
109109
data_length = len(data)
110110

custom_components/ble_monitor/ble_parser/almendo.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
_LOGGER = logging.getLogger(__name__)
88

99

10-
def parse_almendo(self, data: bytes, mac: str):
10+
def parse_almendo(self, data: bytes, mac: bytes):
1111
"""Almendo parser"""
1212
result = {
1313
"mac": to_unformatted_mac(mac),

custom_components/ble_monitor/ble_parser/altbeacon.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
DEVICE_TYPE: Final = "AltBeacon"
1515

1616

17-
def parse_altbeacon(self, data: str, comp_id: int, mac: str):
17+
def parse_altbeacon(self, data: bytes, comp_id: int, mac: bytes):
1818
"""parser for Alt Beacon"""
1919
if len(data) >= 27:
2020
uuid = data[6:22]

custom_components/ble_monitor/ble_parser/amazfit.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
_LOGGER = logging.getLogger(__name__)
88

99

10-
def parse_amazfit(self, service_data: str, man_spec_data: str, mac: str):
10+
def parse_amazfit(self, service_data: str | None, man_spec_data: str, mac: bytes):
1111
"""parser for Amazfit scale and Miband 4 and 5"""
1212
if service_data:
1313
service_data_length = len(service_data)

custom_components/ble_monitor/ble_parser/atc.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
_LOGGER = logging.getLogger(__name__)
1010

1111

12-
def parse_atc(self, data: bytes, mac: str):
12+
def parse_atc(self, data: bytes, mac: bytes):
1313
"""Parse ATC BLE advertisements"""
1414
device_type = "ATC"
1515
msg_length = len(data)

custom_components/ble_monitor/ble_parser/bluemaestro.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
_LOGGER = logging.getLogger(__name__)
88

99

10-
def parse_bluemaestro(self, data: bytes, mac: str):
10+
def parse_bluemaestro(self, data: bytes, mac: bytes):
1111
"""Parse BlueMaestro advertisement."""
1212
msg_length = len(data)
1313
firmware = "BlueMaestro"

custom_components/ble_monitor/ble_parser/blustream.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
_LOGGER = logging.getLogger(__name__)
88

99

10-
def parse_blustream(self, data: bytes, mac: str):
10+
def parse_blustream(self, data: bytes, mac: bytes):
1111
"""Parse Blustream advertisement."""
1212
msg_length = len(data)
1313
firmware = "Blustream"

custom_components/ble_monitor/ble_parser/bparasite.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
_LOGGER = logging.getLogger(__name__)
88

99

10-
def parse_bparasite(self, data: bytes, mac: str):
10+
def parse_bparasite(self, data: bytes, mac: bytes):
1111
"""Check for adstruc length"""
1212
msg_length = len(data)
1313
if msg_length == 22: # TODO: Use protocol bits?

custom_components/ble_monitor/ble_parser/helpers.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
from uuid import UUID
33

44

5-
def to_uuid(uuid: str) -> str:
5+
def to_uuid(uuid: bytes) -> str:
66
"""Return formatted UUID"""
77
return str(UUID(''.join(f'{i:02X}' for i in uuid)))
88

custom_components/ble_monitor/ble_parser/ibeacon.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
DEVICE_TYPE: Final = "iBeacon"
1515

1616

17-
def parse_ibeacon(self, data: str, mac: str):
17+
def parse_ibeacon(self, data: bytes, mac: bytes):
1818
"""Parse iBeacon advertisements"""
1919
if data[5] == 0x15 and len(data) >= 27:
2020
uuid = data[6:22]

custom_components/ble_monitor/ble_parser/inkbird.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ def convert_temperature(temp):
1616
return temperature
1717

1818

19-
def parse_inkbird(self, data: bytes, complete_local_name: str, mac: str):
19+
def parse_inkbird(self, data: bytes, complete_local_name: str, mac: bytes):
2020
"""Inkbird parser"""
2121
msg_length = len(data)
2222
firmware = "Inkbird"

custom_components/ble_monitor/ble_parser/inode.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ def adj_acc(acc):
4141
return acc
4242

4343

44-
def parse_inode(self, data: bytes, mac: str):
44+
def parse_inode(self, data: bytes, mac: bytes):
4545
"""iNode parser"""
4646
msg_length = len(data)
4747
firmware = "iNode"

custom_components/ble_monitor/ble_parser/jaalee.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
_LOGGER = logging.getLogger(__name__)
88

99

10-
def parse_jaalee(self, data: bytes, mac: str):
10+
def parse_jaalee(self, data: bytes, mac: bytes):
1111
"""Jaalee parser"""
1212
msg_length = len(data)
1313
firmware = "Jaalee"

custom_components/ble_monitor/ble_parser/jinou.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
_LOGGER = logging.getLogger(__name__)
77

88

9-
def parse_jinou(self, data: bytes, mac: str):
9+
def parse_jinou(self, data: bytes, mac: bytes):
1010
"""Jinou parser"""
1111
msg_length = len(data)
1212
firmware = "Jinou"

custom_components/ble_monitor/ble_parser/kegtron.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
}
2222

2323

24-
def parse_kegtron(self, data: bytes, mac: str):
24+
def parse_kegtron(self, data: bytes, mac: bytes):
2525
"""Parser for Kegtron sensors"""
2626
msg_length = len(data)
2727
if msg_length == 31:

custom_components/ble_monitor/ble_parser/kkm.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
_LOGGER = logging.getLogger(__name__)
99

1010

11-
def parse_kkm(self, data: bytes, mac: str):
11+
def parse_kkm(self, data: bytes, mac: bytes):
1212
"""Parser for KKM sensors."""
1313
device_type = "K6 Sensor Beacon"
1414
result = {

custom_components/ble_monitor/ble_parser/laica.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ def read_impedance(data):
3030
return impedance
3131

3232

33-
def parse_laica(self, data: bytes, mac: str):
33+
def parse_laica(self, data: bytes, mac: bytes):
3434
"""Parser for Laica sensors"""
3535
xvalue = data[4:]
3636

custom_components/ble_monitor/ble_parser/mikrotik.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ def convert_8_8_to_float(val_1, val_2):
1313
return val_1 + (val_2 / 256)
1414

1515

16-
def parse_mikrotik(self, data: bytes, mac: str):
16+
def parse_mikrotik(self, data: bytes, mac: bytes):
1717
"""Inkbird parser"""
1818
msg_length = len(data)
1919
firmware = "Mikrotik"

custom_components/ble_monitor/ble_parser/miscale.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
_LOGGER = logging.getLogger(__name__)
88

99

10-
def parse_miscale(self, data: bytes, mac: str):
10+
def parse_miscale(self, data: bytes, mac: bytes):
1111
"""Parser for Xiaomi Mi Scales."""
1212
msg_length = len(data)
1313
uuid16 = (data[3] << 8) | data[2]

custom_components/ble_monitor/ble_parser/moat.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
_LOGGER = logging.getLogger(__name__)
88

99

10-
def parse_moat(self, data: bytes, mac: str):
10+
def parse_moat(self, data: bytes, mac: bytes):
1111
"""Parser for Moat sensors"""
1212
msg_length = len(data)
1313
firmware = "Moat"

custom_components/ble_monitor/ble_parser/oral_b.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
}
2929

3030

31-
def parse_oral_b(self, data: bytes, mac: str):
31+
def parse_oral_b(self, data: bytes, mac: bytes):
3232
"""Parser for Oral-B toothbrush."""
3333
msg_length = len(data)
3434
firmware = "Oral-B"

custom_components/ble_monitor/ble_parser/oras.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
}
2424

2525

26-
def parse_oras(self, data: bytes, mac: str):
26+
def parse_oras(self, data: bytes, mac: bytes):
2727
"""Parser for Oras toothbrush or Garnet tank."""
2828
msg_length = len(data)
2929
result = {"mac": to_unformatted_mac(mac)}

custom_components/ble_monitor/ble_parser/qingping.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
_LOGGER = logging.getLogger(__name__)
88

99

10-
def parse_qingping(self, data: bytes, mac: str):
10+
def parse_qingping(self, data: bytes, mac: bytes):
1111
"""Qingping parser"""
1212
msg_length = len(data)
1313
if msg_length > 12:

custom_components/ble_monitor/ble_parser/ruuvitag.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
_LOGGER = logging.getLogger(__name__)
1010

1111

12-
def parse_ruuvitag(self, data: bytes, mac: str):
12+
def parse_ruuvitag(self, data: bytes, mac: bytes):
1313
"""Ruuvitag parser"""
1414
device_type = "Ruuvitag"
1515
result = {

custom_components/ble_monitor/ble_parser/sensirion.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
]
1414

1515

16-
def parse_sensirion(self, data: bytes, complete_local_name: str, mac: str):
16+
def parse_sensirion(self, data: bytes, complete_local_name: str, mac: bytes):
1717
"""Sensirion parser"""
1818
result = {"firmware": "Sensirion"}
1919
device_type = complete_local_name

custom_components/ble_monitor/ble_parser/sensorpush.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ def decode_values(mfg_data: bytes, device_type_id: int) -> dict:
6767
return values
6868

6969

70-
def parse_sensorpush(self, data: bytes, mac: str):
70+
def parse_sensorpush(self, data: bytes, mac: bytes):
7171
"""Sensorpush parser"""
7272
result = {"firmware": "SensorPush"}
7373
device_type = None

custom_components/ble_monitor/ble_parser/senssun.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ def read_stable(ctr1):
1212
"""Parse Stable"""
1313
return int((ctr1 & 0xA0) == 0xA0)
1414

15-
def parse_senssun(self, data: bytes, mac: str):
15+
def parse_senssun(self, data: bytes, mac: bytes):
1616
"""Parser for Senssun Scales."""
1717
xvalue = data[13:19]
1818

custom_components/ble_monitor/ble_parser/smartdry.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
_LOGGER = logging.getLogger(__name__)
88

99

10-
def parse_smartdry(self, data: bytes, mac: str):
10+
def parse_smartdry(self, data: bytes, mac: bytes):
1111
"""Parser for SmartDry cloth dryer"""
1212
msg_length = len(data)
1313
if msg_length == 16:

custom_components/ble_monitor/ble_parser/switchbot.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
_LOGGER = logging.getLogger(__name__)
88

99

10-
def parse_switchbot(self, data: bytes, mac: str):
10+
def parse_switchbot(self, data: bytes, mac: bytes):
1111
"""Switchbot parser"""
1212
msg_length = len(data)
1313
device_id = data[4]

custom_components/ble_monitor/ble_parser/teltonika.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
_LOGGER = logging.getLogger(__name__)
88

99

10-
def parse_teltonika(self, data: bytes, complete_local_name: str, mac: str):
10+
def parse_teltonika(self, data: bytes, complete_local_name: str, mac: bytes):
1111
"""Teltonika parser"""
1212
result = {"firmware": "Teltonika"}
1313
device_id = (data[3] << 8) | data[2]

custom_components/ble_monitor/ble_parser/thermobeacon.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
_LOGGER = logging.getLogger(__name__)
88

99

10-
def parse_thermobeacon(self, data: bytes, mac: str):
10+
def parse_thermobeacon(self, data: bytes, mac: bytes):
1111
"""Thermobeacon parser"""
1212
msg_length = len(data)
1313
device_id = data[2]

custom_components/ble_monitor/ble_parser/thermopro.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
_LOGGER = logging.getLogger(__name__)
88

99

10-
def parse_thermopro(self, data: bytes, device_type, mac: str):
10+
def parse_thermopro(self, data: bytes, device_type, mac: bytes):
1111
"""Thermopro parser"""
1212
if device_type in ["TP357", "TP359"]:
1313
firmware = "Thermopro"

custom_components/ble_monitor/ble_parser/tilt.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
_LOGGER = logging.getLogger(__name__)
1212

1313

14-
def parse_tilt(self, data: bytes, mac: str, ):
14+
def parse_tilt(self, data: bytes, mac: bytes):
1515
"""Tilt parser"""
1616
if data[5] == 0x15 and len(data) == 27:
1717
uuid = data[6:22]

custom_components/ble_monitor/ble_parser/xiaogui.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
_LOGGER = logging.getLogger(__name__)
88

99

10-
def parse_xiaogui(self, data: bytes, mac: str):
10+
def parse_xiaogui(self, data: bytes, mac: bytes):
1111
"""Xiaogui Scales parser"""
1212
msg_length = len(data)
1313

custom_components/ble_monitor/ble_parser/xiaomi.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1293,7 +1293,7 @@ def obj5a16(xobj):
12931293
}
12941294

12951295

1296-
def parse_xiaomi(self, data: bytes, mac: str):
1296+
def parse_xiaomi(self, data: bytes, mac: bytes):
12971297
"""Parser for Xiaomi sensors"""
12981298
# check for adstruc length
12991299
i = 9 # till Frame Counter

0 commit comments

Comments
 (0)