Repository: Bluetooth-Devices/oralb-ble (language: python)

Issue:
IO 8 reports as Smart Series 7000
We have an IO 8 but it reports in HA as Smart Series 7000. Most attributes work with some success but I think its not quite right. 

Output from brushing this morning: 

`2022-11-09 06:26:14.716 DEBUG (MainThread) [homeassistant.components.bluetooth.manager] esp32-bluetooth-proxy-c814ac: F8:8A:5E:E1:DB:58 AdvertisementData(local_name='Oral-B Toothbrush', manufacturer_data={220: b'\x061\x19\x08r\x00\x00\x00\x07\x00\x00'}, service_uuids=['0000fe0d-0000-1000-8000-00805f9b34fb'], tx_power=-127, rssi=-96) connectable: True match: set() rssi: -96
2022-11-09 06:26:44.648 DEBUG (MainThread) [homeassistant.components.bluetooth.manager] esp32-bluetooth-proxy-c814ac: F8:8A:5E:E1:DB:58 AdvertisementData(local_name='Oral-B Toothbrush', manufacturer_data={220: b'\x061\x19\x03r\x00\x0f\x00\x01\x00\x00'}, service_uuids=['0000fe0d-0000-1000-8000-00805f9b34fb'], tx_power=-127, rssi=-95) connectable: True match: set() rssi: -95
2022-11-09 06:27:03.151 DEBUG (MainThread) [homeassistant.components.bluetooth.manager] esp32-bluetooth-proxy-c814ac: F8:8A:5E:E1:DB:58 AdvertisementData(local_name='Oral-B Toothbrush', manufacturer_data={220: b'\x061\x19\x03r\x00"\x00\x02\x00\x00'}, service_uuids=['0000fe0d-0000-1000-8000-00805f9b34fb'], tx_power=-127, rssi=-97) connectable: True match: set() rssi: -97
2022-11-09 06:27:03.998 DEBUG (MainThread) [homeassistant.components.bluetooth.manager] esp32-bluetooth-proxy-c814ac: F8:8A:5E:E1:DB:58 AdvertisementData(local_name='Oral-B Toothbrush', manufacturer_data={220: b'\x061\x19\x03r\x00#\x00\x02\x00\x00'}, service_uuids=['0000fe0d-0000-1000-8000-00805f9b34fb'], tx_power=-127, rssi=-97) connectable: True match: set() rssi: -97
2022-11-09 06:27:06.224 DEBUG (MainThread) [homeassistant.components.bluetooth.manager] esp32-bluetooth-proxy-c814ac: F8:8A:5E:E1:DB:58 AdvertisementData(local_name='Oral-B Toothbrush', manufacturer_data={220: b'\x061\x19\x03r\x00%\x00\x02\x00\x00'}, service_uuids=['0000fe0d-0000-1000-8000-00805f9b34fb'], tx_power=-127, rssi=-94) connectable: True match: set() rssi: -94
2022-11-09 06:27:17.698 DEBUG (MainThread) [homeassistant.components.bluetooth.manager] esp32-bluetooth-proxy-c814ac: F8:8A:5E:E1:DB:58 AdvertisementData(local_name='Oral-B Toothbrush', manufacturer_data={220: b'\x061\x19\x03r\x000\x00\x02\x00\x00'}, service_uuids=['0000fe0d-0000-1000-8000-00805f9b34fb'], tx_power=-127, rssi=-93) connectable: True match: set() rssi: -93
2022-11-09 06:27:19.332 DEBUG (MainThread) [homeassistant.components.bluetooth.manager] esp32-bluetooth-proxy-c814ac: F8:8A:5E:E1:DB:58 AdvertisementData(local_name='Oral-B Toothbrush', manufacturer_data={220: b'\x061\x19\x03r\x002\x00\x02\x00\x00'}, service_uuids=['0000fe0d-0000-1000-8000-00805f9b34fb'], tx_power=-127, rssi=-98) connectable: True match: set() rssi: -98
2022-11-09 06:27:24.362 DEBUG (MainThread) [homeassistant.components.bluetooth.manager] esp32-bluetooth-proxy-c814ac: F8:8A:5E:E1:DB:58 AdvertisementData(local_name='Oral-B Toothbrush', manufacturer_data={220: b'\x061\x19\x03r\x007\x00\x02\x00\x00'}, service_uuids=['0000fe0d-0000-1000-8000-00805f9b34fb'], tx_power=-127, rssi=-97) connectable: True match: set() rssi: -97
2022-11-09 06:27:43.190 DEBUG (MainThread) [homeassistant.components.bluetooth.manager] esp32-bluetooth-proxy-c814ac: F8:8A:5E:E1:DB:58 AdvertisementData(local_name='Oral-B Toothbrush', manufacturer_data={220: b'\x061\x19\x03r\x01\x0e\x00\x03\x00\x00'}, service_uuids=['0000fe0d-0000-1000-8000-00805f9b34fb'], tx_power=-127, rssi=-95) connectable: True match: set() rssi: -95
2022-11-09 06:27:44.013 DEBUG (MainThread) [homeassistant.components.bluetooth.manager] esp32-bluetooth-proxy-c814ac: F8:8A:5E:E1:DB:58 AdvertisementData(local_name='Oral-B Toothbrush', manufacturer_data={220: b'\x061\x19\x03r\x01\x0f\x00\x03\x00\x00'}, service_uuids=['0000fe0d-0000-1000-8000-00805f9b34fb'], tx_power=-127, rssi=-93) connectable: True match: set() rssi: -93
2022-11-09 06:27:46.067 DEBUG (MainThread) [homeassistant.components.bluetooth.manager] esp32-bluetooth-proxy-c814ac: F8:8A:5E:E1:DB:58 AdvertisementData(local_name='Oral-B Toothbrush', manufacturer_data={220: b'\x061\x19\x03r\x01\x11\x00\x03\x00\x00'}, service_uuids=['0000fe0d-0000-1000-8000-00805f9b34fb'], tx_power=-127, rssi=-99) connectable: True match: set() rssi: -99
2022-11-09 06:27:48.328 DEBUG (MainThread) [homeassistant.components.bluetooth.manager] esp32-bluetooth-proxy-c814ac: F8:8A:5E:E1:DB:58 AdvertisementData(local_name='Oral-B Toothbrush', manufacturer_data={220: b'\x061\x19\x03r\x01\x13\x00\x03\x00\x00'}, service_uuids=['0000fe0d-0000-1000-8000-00805f9b34fb'], tx_power=-127, rssi=-99) connectable: True match: set() rssi: -99
2022-11-09 06:27:49.127 DEBUG (MainThread) [homeassistant.components.bluetooth.manager] esp32-bluetooth-proxy-c814ac: F8:8A:5E:E1:DB:58 AdvertisementData(local_name='Oral-B Toothbrush', manufacturer_data={220: b'\x061\x19\x03r\x01\x14\x00\x03\x00\x00'}, service_uuids=['0000fe0d-0000-1000-8000-00805f9b34fb'], tx_power=-127, rssi=-96) connectable: True match: set() rssi: -96
2022-11-09 06:28:15.864 DEBUG (MainThread) [homeassistant.components.bluetooth.manager] Oral-B Toothbrush (F8:8A:5E:E1:DB:58): Switching from esp32-bluetooth-proxy-c814ac[True] to esp32-bluetooth-proxy-cb54fc[True] (time elapsed:26.735744516015984 > stale seconds:25.111759460996836)
2022-11-09 06:28:15.865 DEBUG (MainThread) [homeassistant.components.bluetooth.manager] esp32-bluetooth-proxy-cb54fc: F8:8A:5E:E1:DB:58 AdvertisementData(local_name='Oral-B Toothbrush', manufacturer_data={220: b'\x061\x19\x03r\x01/\x00\x04\x00\x00'}, service_uuids=['0000fe0d-0000-1000-8000-00805f9b34fb'], tx_power=-127, rssi=-94) connectable: True match: set() rssi: -94
2022-11-09 06:28:18.624 DEBUG (MainThread) [homeassistant.components.bluetooth.manager] esp32-bluetooth-proxy-cb54fc: F8:8A:5E:E1:DB:58 AdvertisementData(local_name='Oral-B Toothbrush', manufacturer_data={220: b'\x061\x19\x03r\x011\x00\x04\x00\x00'}, service_uuids=['0000fe0d-0000-1000-8000-00805f9b34fb'], tx_power=-127, rssi=-96) connectable: True match: set() rssi: -96
2022-11-09 06:28:18.827 DEBUG (MainThread) [homeassistant.components.bluetooth.manager] esp32-bluetooth-proxy-cb54fc: F8:8A:5E:E1:DB:58 AdvertisementData(local_name='Oral-B Toothbrush', manufacturer_data={220: b'\x061\x19\x03r\x012\x00\x04\x00\x00'}, service_uuids=['0000fe0d-0000-1000-8000-00805f9b34fb'], tx_power=-127, rssi=-98) connectable: True match: set() rssi: -98
2022-11-09 06:28:40.537 DEBUG (MainThread) [homeassistant.components.bluetooth.manager] esp32-bluetooth-proxy-cb54fc: F8:8A:5E:E1:DB:58 AdvertisementData(local_name='Oral-B Toothbrush', manufacturer_data={220: b'\x061\x19\x03r\x02\x0b\x00\x07\x00\x00'}, service_uuids=['0000fe0d-0000-1000-8000-00805f9b34fb'], tx_power=-127, rssi=-98) connectable: True match: set() rssi: -98
2022-11-09 06:29:02.244 DEBUG (MainThread) [homeassistant.components.bluetooth.manager] esp32-bluetooth-proxy-cb54fc: F8:8A:5E:E1:DB:58 AdvertisementData(local_name='Oral-B Toothbrush', manufacturer_data={220: b'\x061\x19\x03r\x02\x1e\x00*\x00\x00'}, service_uuids=['0000fe0d-0000-1000-8000-00805f9b34fb'], tx_power=-127, rssi=-98) connectable: True match: set() rssi: -98
2022-11-09 06:29:40.784 DEBUG (MainThread) [homeassistant.components.bluetooth.manager] esp32-bluetooth-proxy-cb54fc: F8:8A:5E:E1:DB:58 AdvertisementData(local_name='Oral-B Toothbrush', manufacturer_data={220: b'\x061\x19\x02r\x025\x002\x00\x00'}, service_uuids=['0000fe0d-0000-1000-8000-00805f9b34fb'], tx_power=-127, rssi=-99) connectable: True match: set() rssi: -99
2022-11-09 06:29:48.841 DEBUG (MainThread) [homeassistant.components.bluetooth.manager] Oral-B Toothbrush (F8:8A:5E:E1:DB:58): Switching from esp32-bluetooth-proxy-cb54fc[True] to esp32-bluetooth-proxy-c814ac[True] (new rssi:-93 - threshold:5 > old rssi:-99)
2022-11-09 06:29:59.283 DEBUG (MainThread) [homeassistant.components.bluetooth.manager] Oral-B Toothbrush (F8:8A:5E:E1:DB:58): Switching from esp32-bluetooth-proxy-c814ac[True] to esp32-bluetooth-proxy-cb54fc[True] (time elapsed:1.2080062919994816 > stale seconds:1.1120059869717807)`


Discussion / hints:

Fix patch:
diff --git a/src/oralb_ble/parser.py b/src/oralb_ble/parser.py
index b4781f1..eade1ec 100644
--- a/src/oralb_ble/parser.py
+++ b/src/oralb_ble/parser.py
@@ -39,6 +39,7 @@ class Models(Enum):
 
     Pro6000 = auto()
     TriumphV2 = auto()
+    IOSeries8 = auto()
     IOSeries9 = auto()
     IOSeries78 = auto()
     IOSeries4 = auto()
@@ -90,6 +91,10 @@ class ModelDescription:
         device_type="IO Series 7/8",
         modes=IO_SERIES_MODES,
     ),
+    Models.IOSeries8: ModelDescription(
+        device_type="IO Series 8",
+        modes=IO_SERIES_MODES,
+    ),
     Models.IOSeries9: ModelDescription(
         device_type="IO Series 9",
         modes=IO_SERIES_MODES,
@@ -166,6 +171,7 @@ class ModelDescription:
     b"\x04'\r": Models.SmartSeries6000,
     b'\x03"\x0c': Models.SmartSeries8000,
     b"\x03!\x0c": Models.SmartSeries9000,
+    b"\x061\x19": Models.IOSeries8,
     b"\x061\x16": Models.IOSeries9,
     b"\x02\x02\x06": Models.TriumphV2,
     b"\x01\x02\x05": Models.Pro6000,


Test patch:
diff --git a/tests/test_parser.py b/tests/test_parser.py
index 73b4d2f..eed4ee2 100644
--- a/tests/test_parser.py
+++ b/tests/test_parser.py
@@ -62,6 +62,15 @@
     service_data={},
     source="local",
 )
+ORALB_IO_SERIES_8 = BluetoothServiceInfo(
+    name="78:DB:2F:C2:48:BE",
+    address="78:DB:2F:C2:48:BE",
+    rssi=-63,
+    manufacturer_data={220: b"\x061\x19\x08r\x00\x00\x00\x07\x00\x00"},
+    service_uuids=[],
+    service_data={},
+    source="local",
+)
 ORALB_IO_SERIES_4 = BluetoothServiceInfo(
     address="78:DB:2F:C2:48:BE",
     rssi=-63,
@@ -2109,3 +2118,118 @@ def test_genius_8000_high_pressure():
         },
         events={},
     )
+
+
+def test_io_series_8():
+    parser = OralBBluetoothDeviceData()
+    service_info = ORALB_IO_SERIES_8
+    result = parser.update(service_info)
+    assert result == SensorUpdate(
+        title="IO Series 8 48BE",
+        devices={
+            None: SensorDeviceInfo(
+                name="IO Series 8 48BE",
+                model="IO Series 8",
+                manufacturer="Oral-B",
+                sw_version=None,
+                hw_version=None,
+            )
+        },
+        entity_descriptions={
+            DeviceKey(key="sector_timer", device_id=None): SensorDescription(
+                device_key=DeviceKey(key="sector_timer", device_id=None),
+                device_class=None,
+                native_unit_of_measurement=None,
+            ),
+            DeviceKey(key="mode", device_id=None): SensorDescription(
+                device_key=DeviceKey(key="mode", device_id=None),
+                device_class=None,
+                native_unit_of_measurement=None,
+            ),
+            DeviceKey(key="signal_strength", device_id=None): SensorDescription(
+                device_key=DeviceKey(key="signal_strength", device_id=None),
+                device_class=SensorDeviceClass.SIGNAL_STRENGTH,
+                native_unit_of_measurement=Units.SIGNAL_STRENGTH_DECIBELS_MILLIWATT,
+            ),
+            DeviceKey(key="pressure", device_id=None): SensorDescription(
+                device_key=DeviceKey(key="pressure", device_id=None),
+                device_class=None,
+                native_unit_of_measurement=None,
+            ),
+            DeviceKey(key="sector", device_id=None): SensorDescription(
+                device_key=DeviceKey(key="sector", device_id=None),
+                device_class=None,
+                native_unit_of_measurement=None,
+            ),
+            DeviceKey(key="time", device_id=None): SensorDescription(
+                device_key=DeviceKey(key="time", device_id=None),
+                device_class=None,
+                native_unit_of_measurement=None,
+            ),
+            DeviceKey(key="number_of_sectors", device_id=None): SensorDescription(
+                device_key=DeviceKey(key="number_of_sectors", device_id=None),
+                device_class=None,
+                native_unit_of_measurement=None,
+            ),
+            DeviceKey(key="toothbrush_state", device_id=None): SensorDescription(
+                device_key=DeviceKey(key="toothbrush_state", device_id=None),
+                device_class=None,
+                native_unit_of_measurement=None,
+            ),
+        },
+        entity_values={
+            DeviceKey(key="sector_timer", device_id=None): SensorValue(
+                device_key=DeviceKey(key="sector_timer", device_id=None),
+                name="Sector " "Timer",
+                native_value=0,
+            ),
+            DeviceKey(key="mode", device_id=None): SensorValue(
+                device_key=DeviceKey(key="mode", device_id=None),
+                name="Mode",
+                native_value="daily " "clean",
+            ),
+            DeviceKey(key="signal_strength", device_id=None): SensorValue(
+                device_key=DeviceKey(key="signal_strength", device_id=None),
+                name="Signal " "Strength",
+                native_value=-63,
+            ),
+            DeviceKey(key="pressure", device_id=None): SensorValue(
+                device_key=DeviceKey(key="pressure", device_id=None),
+                name="Pressure",
+                native_value="normal",
+            ),
+            DeviceKey(key="sector", device_id=None): SensorValue(
+                device_key=DeviceKey(key="sector", device_id=None),
+                name="Sector",
+                native_value="sector " "7",
+            ),
+            DeviceKey(key="time", device_id=None): SensorValue(
+                device_key=DeviceKey(key="time", device_id=None),
+                name="Time",
+                native_value=0,
+            ),
+            DeviceKey(key="number_of_sectors", device_id=None): SensorValue(
+                device_key=DeviceKey(key="number_of_sectors", device_id=None),
+                name="Number " "of " "sectors",
+                native_value=0,
+            ),
+            DeviceKey(key="toothbrush_state", device_id=None): SensorValue(
+                device_key=DeviceKey(key="toothbrush_state", device_id=None),
+                name="Toothbrush " "State",
+                native_value="selection " "menu",
+            ),
+        },
+        binary_entity_descriptions={
+            DeviceKey(key="brushing", device_id=None): BinarySensorDescription(
+                device_key=DeviceKey(key="brushing", device_id=None), device_class=None
+            )
+        },
+        binary_entity_values={
+            DeviceKey(key="brushing", device_id=None): BinarySensorValue(
+                device_key=DeviceKey(key="brushing", device_id=None),
+                name="Brushing",
+                native_value=False,
+            )
+        },
+        events={},
+    )