Skip to content

Commit

Permalink
fix: identification of Genius X and 10000 (#39)
Browse files Browse the repository at this point in the history
  • Loading branch information
Lash-L authored Feb 6, 2023
1 parent b7592ef commit 93ea567
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
5 changes: 4 additions & 1 deletion src/oralb_ble/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ class Models(Enum):
SmartSeries7000 = auto()
SmartSeries8000 = auto()
SmartSeries9000 = auto()
GeniusX = auto()


@dataclass
Expand Down Expand Up @@ -140,9 +141,10 @@ class ModelDescription:
modes=SMART_SERIES_MODES,
),
Models.SmartSeries9000: ModelDescription(
device_type="Smart Series 9000",
device_type="Smart Series 9000/10000",
modes=SMART_SERIES_MODES,
),
Models.GeniusX: ModelDescription(device_type="Genius X", modes=SMART_SERIES_MODES),
}

STATES = {
Expand Down Expand Up @@ -205,6 +207,7 @@ class ModelDescription:
b"\x061\x16": Models.IOSeries89,
b"\x02\x02\x06": Models.TriumphV2,
b"\x01\x02\x05": Models.Pro6000,
b"\x04q\x04": Models.GeniusX,
}

SECTOR_MAP = {
Expand Down
12 changes: 6 additions & 6 deletions tests/test_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -1515,11 +1515,11 @@ def test_9000_series():
service_info = ORALB_9000_SERIES
result = parser.update(service_info)
assert result == SensorUpdate(
title="Smart Series 9000 48BE",
title="Smart Series 9000/10000 48BE",
devices={
None: SensorDeviceInfo(
name="Smart Series 9000 48BE",
model="Smart Series 9000",
name="Smart Series 9000/10000 48BE",
model="Smart Series 9000/10000",
manufacturer="Oral-B",
sw_version=None,
hw_version=None,
Expand Down Expand Up @@ -1630,11 +1630,11 @@ def test_9000_black_series():
service_info = ORALB_9000_BLACK_SERIES
result = parser.update(service_info)
assert result == SensorUpdate(
title="Smart Series 9000 48BE",
title="Smart Series 9000/10000 48BE",
devices={
None: SensorDeviceInfo(
name="Smart Series 9000 48BE",
model="Smart Series 9000",
name="Smart Series 9000/10000 48BE",
model="Smart Series 9000/10000",
manufacturer="Oral-B",
sw_version=None,
hw_version=None,
Expand Down

0 comments on commit 93ea567

Please sign in to comment.