From d2fbf9d79f8cb39d8cbe61af3fb9a5b942f6afb0 Mon Sep 17 00:00:00 2001 From: darken Date: Sat, 21 Jun 2025 13:54:20 +0200 Subject: [PATCH] Add variant PowerBeatsPro test case --- .../core/apple/beats/PowerBeatsProTest.kt | 32 ++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/app-common/src/test/java/eu/darken/capod/pods/core/apple/beats/PowerBeatsProTest.kt b/app-common/src/test/java/eu/darken/capod/pods/core/apple/beats/PowerBeatsProTest.kt index ac77e365..90ab127b 100644 --- a/app-common/src/test/java/eu/darken/capod/pods/core/apple/beats/PowerBeatsProTest.kt +++ b/app-common/src/test/java/eu/darken/capod/pods/core/apple/beats/PowerBeatsProTest.kt @@ -9,7 +9,6 @@ import org.junit.jupiter.api.Test class PowerBeatsProTest : BaseAirPodsTest() { - // TODO This is handcrafted data, get actual data for tests @Test fun `test PowerBeatsPro`() = runTest { create("07 19 01 0B 20 54 AA B5 31 00 00 E0 0C A7 8A 60 4B D3 7D F4 60 4F 2C 73 E9 A7 F4") { @@ -39,4 +38,35 @@ class PowerBeatsProTest : BaseAirPodsTest() { model shouldBe PodDevice.Model.POWERBEATS_PRO } } + + // Via https://github.com/d4rken-org/capod/pull/303#issuecomment-2991876052 + @Test + fun `test PowerBeatsPro - variant 2`() = runTest { + create("07 19 01 0B 20 21 AA 8F 02 44 24 6D 3E CD 38 A6 F9 6C 6A EC 95 65 AF 97 08 95 49") { + pubPrefix shouldBe 0x01.toUByte() + pubDeviceModel shouldBe 0x0B20.toUShort() + pubStatus shouldBe 0x21.toUByte() + pubPodsBattery shouldBe 0xAA.toUByte() + pubFlags shouldBe 0x8.toUShort() + pubCaseBattery shouldBe 0xF.toUShort() + pubCaseLidState shouldBe 0x02.toUByte() + pubDeviceColor shouldBe 0x44.toUByte() + pubSuffix shouldBe 0x24.toUByte() + + isLeftPodMicrophone shouldBe true + isRightPodMicrophone shouldBe false + + batteryLeftPodPercent shouldBe 1.0f + batteryRightPodPercent shouldBe 1.0f + + isCaseCharging shouldBe false + isRightPodCharging shouldBe false + isLeftPodCharging shouldBe false + batteryCasePercent shouldBe null + + podStyle.identifier shouldBe HasAppleColor.DeviceColor.UNKNOWN.name + + model shouldBe PodDevice.Model.POWERBEATS_PRO + } + } } \ No newline at end of file