mirror of
https://github.com/d4rken-org/capod.git
synced 2026-09-15 10:46:12 -04:00
Extract Model to PodModel.kt
This commit is contained in:
@@ -5,7 +5,7 @@ import eu.darken.capod.common.theming.ThemeColor
|
||||
import eu.darken.capod.common.theming.ThemeMode
|
||||
import eu.darken.capod.common.theming.ThemeStyle
|
||||
import eu.darken.capod.main.core.MonitorMode
|
||||
import eu.darken.capod.pods.core.PodDevice
|
||||
import eu.darken.capod.pods.core.PodModel
|
||||
import eu.darken.capod.profiles.core.AppleDeviceProfile
|
||||
import eu.darken.capod.profiles.core.DeviceProfilesContainer
|
||||
import eu.darken.capod.reaction.core.autoconnect.AutoConnectCondition
|
||||
@@ -145,21 +145,21 @@ class DataStoreMigrationCompatTest : BaseTest() {
|
||||
|
||||
@Test
|
||||
fun `PodDevice Model encodes to canonical string`() {
|
||||
json.encodeToString(serializer<PodDevice.Model>(), PodDevice.Model.AIRPODS_PRO) shouldBe "\"airpods.pro\""
|
||||
json.encodeToString(serializer<PodModel>(), PodModel.AIRPODS_PRO) shouldBe "\"airpods.pro\""
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `all PodDevice Model values round-trip`() {
|
||||
for (model in PodDevice.Model.entries) {
|
||||
val encoded = json.encodeToString(serializer<PodDevice.Model>(), model)
|
||||
json.decodeFromString(serializer<PodDevice.Model>(), encoded) shouldBe model
|
||||
for (model in PodModel.entries) {
|
||||
val encoded = json.encodeToString(serializer<PodModel>(), model)
|
||||
json.decodeFromString(serializer<PodModel>(), encoded) shouldBe model
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `PodDevice Model legacy string decodes correctly`() {
|
||||
val legacyOutput = "\"airpods.pro\""
|
||||
json.decodeFromString(serializer<PodDevice.Model>(), legacyOutput) shouldBe PodDevice.Model.AIRPODS_PRO
|
||||
json.decodeFromString(serializer<PodModel>(), legacyOutput) shouldBe PodModel.AIRPODS_PRO
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -186,7 +186,7 @@ class DataStoreMigrationCompatTest : BaseTest() {
|
||||
val profile = result.profiles[0] as AppleDeviceProfile
|
||||
profile.id shouldBe "test-uuid"
|
||||
profile.label shouldBe "My AirPods Pro"
|
||||
profile.model shouldBe PodDevice.Model.AIRPODS_PRO
|
||||
profile.model shouldBe PodModel.AIRPODS_PRO
|
||||
profile.minimumSignalQuality shouldBe 0.15f
|
||||
profile.address shouldBe "AA:BB:CC:DD:EE:FF"
|
||||
profile.identityKey shouldBe null
|
||||
@@ -200,7 +200,7 @@ class DataStoreMigrationCompatTest : BaseTest() {
|
||||
AppleDeviceProfile(
|
||||
id = "round-trip-id",
|
||||
label = "Test Profile",
|
||||
model = PodDevice.Model.AIRPODS_GEN2,
|
||||
model = PodModel.AIRPODS_GEN2,
|
||||
address = "11:22:33:44:55:66",
|
||||
)
|
||||
)
|
||||
@@ -212,7 +212,7 @@ class DataStoreMigrationCompatTest : BaseTest() {
|
||||
val profile = decoded.profiles[0] as AppleDeviceProfile
|
||||
profile.id shouldBe "round-trip-id"
|
||||
profile.label shouldBe "Test Profile"
|
||||
profile.model shouldBe PodDevice.Model.AIRPODS_GEN2
|
||||
profile.model shouldBe PodModel.AIRPODS_GEN2
|
||||
profile.address shouldBe "11:22:33:44:55:66"
|
||||
}
|
||||
|
||||
|
||||
+8
-9
@@ -8,14 +8,14 @@ import eu.darken.capod.common.theming.ThemeColor
|
||||
import eu.darken.capod.common.theming.ThemeMode
|
||||
import eu.darken.capod.common.theming.ThemeStyle
|
||||
import eu.darken.capod.main.core.MonitorMode
|
||||
import kotlinx.serialization.builtins.nullable
|
||||
import eu.darken.capod.pods.core.PodDevice
|
||||
import eu.darken.capod.pods.core.PodModel
|
||||
import eu.darken.capod.profiles.core.AppleDeviceProfile
|
||||
import eu.darken.capod.profiles.core.DeviceProfile
|
||||
import eu.darken.capod.profiles.core.DeviceProfilesContainer
|
||||
import eu.darken.capod.reaction.core.autoconnect.AutoConnectCondition
|
||||
import io.kotest.assertions.throwables.shouldThrow
|
||||
import io.kotest.matchers.shouldBe
|
||||
import kotlinx.serialization.builtins.nullable
|
||||
import kotlinx.serialization.json.Json
|
||||
import org.junit.jupiter.api.Test
|
||||
import org.junit.jupiter.api.io.TempDir
|
||||
@@ -23,7 +23,6 @@ import testhelpers.BaseTest
|
||||
import testhelpers.coroutine.runTest2
|
||||
import java.io.File
|
||||
import java.time.Instant
|
||||
import eu.darken.capod.common.datastore.value
|
||||
|
||||
class DataStoreValueSerializationTest : BaseTest() {
|
||||
|
||||
@@ -59,9 +58,9 @@ class DataStoreValueSerializationTest : BaseTest() {
|
||||
@Test
|
||||
fun `enum round-trip - PodDevice Model`() = runTest2 {
|
||||
val ds = createDataStore()
|
||||
val pref = ds.createValue("model", PodDevice.Model.UNKNOWN, json)
|
||||
val pref = ds.createValue("model", PodModel.UNKNOWN, json)
|
||||
|
||||
PodDevice.Model.entries.forEach { model ->
|
||||
PodModel.entries.forEach { model ->
|
||||
pref.value(model)
|
||||
pref.value() shouldBe model
|
||||
}
|
||||
@@ -75,7 +74,7 @@ class DataStoreValueSerializationTest : BaseTest() {
|
||||
AppleDeviceProfile(
|
||||
id = "test-id-1",
|
||||
label = "My AirPods",
|
||||
model = PodDevice.Model.AIRPODS_PRO,
|
||||
model = PodModel.AIRPODS_PRO,
|
||||
address = "AA:BB:CC:DD:EE:FF",
|
||||
)
|
||||
)
|
||||
@@ -89,7 +88,7 @@ class DataStoreValueSerializationTest : BaseTest() {
|
||||
val profile = result.profiles[0] as AppleDeviceProfile
|
||||
profile.id shouldBe "test-id-1"
|
||||
profile.label shouldBe "My AirPods"
|
||||
profile.model shouldBe PodDevice.Model.AIRPODS_PRO
|
||||
profile.model shouldBe PodModel.AIRPODS_PRO
|
||||
profile.address shouldBe "AA:BB:CC:DD:EE:FF"
|
||||
}
|
||||
|
||||
@@ -229,7 +228,7 @@ class DataStoreValueSerializationTest : BaseTest() {
|
||||
val profile: DeviceProfile = AppleDeviceProfile(
|
||||
id = "poly-test",
|
||||
label = "Test Profile",
|
||||
model = PodDevice.Model.AIRPODS_GEN2,
|
||||
model = PodModel.AIRPODS_GEN2,
|
||||
identityKey = byteArrayOf(0x01, 0x02),
|
||||
encryptionKey = byteArrayOf(0x03, 0x04),
|
||||
)
|
||||
@@ -243,7 +242,7 @@ class DataStoreValueSerializationTest : BaseTest() {
|
||||
val restored = result.profiles[0] as AppleDeviceProfile
|
||||
restored.id shouldBe "poly-test"
|
||||
restored.label shouldBe "Test Profile"
|
||||
restored.model shouldBe PodDevice.Model.AIRPODS_GEN2
|
||||
restored.model shouldBe PodModel.AIRPODS_GEN2
|
||||
restored.identityKey!!.toList() shouldBe listOf<Byte>(0x01, 0x02)
|
||||
restored.encryptionKey!!.toList() shouldBe listOf<Byte>(0x03, 0x04)
|
||||
}
|
||||
|
||||
@@ -2,10 +2,10 @@ package eu.darken.capod.monitor.core
|
||||
|
||||
import eu.darken.capod.pods.core.HasCase
|
||||
import eu.darken.capod.pods.core.HasChargeDetectionDual
|
||||
import eu.darken.capod.pods.core.HasDualMicrophone
|
||||
import eu.darken.capod.pods.core.HasEarDetection
|
||||
import eu.darken.capod.pods.core.HasEarDetectionDual
|
||||
import eu.darken.capod.pods.core.PodDevice
|
||||
import eu.darken.capod.pods.core.PodModel
|
||||
import eu.darken.capod.pods.core.apple.DualApplePods
|
||||
import eu.darken.capod.pods.core.apple.protocol.aap.AapConnectionState
|
||||
import eu.darken.capod.pods.core.apple.protocol.aap.AapPodState
|
||||
@@ -23,7 +23,7 @@ import java.time.Instant
|
||||
class MonitoredDeviceTest : BaseTest() {
|
||||
|
||||
private fun mockDualPod(
|
||||
model: PodDevice.Model = PodDevice.Model.AIRPODS_PRO3,
|
||||
model: PodModel = PodModel.AIRPODS_PRO3,
|
||||
leftBattery: Float? = 0.8f,
|
||||
rightBattery: Float? = 0.9f,
|
||||
caseBattery: Float? = 0.5f,
|
||||
@@ -47,7 +47,7 @@ class MonitoredDeviceTest : BaseTest() {
|
||||
@Test
|
||||
fun `capabilities come from model features`() {
|
||||
val device = MonitoredDevice(
|
||||
ble = mockDualPod(model = PodDevice.Model.AIRPODS_PRO3),
|
||||
ble = mockDualPod(model = PodModel.AIRPODS_PRO3),
|
||||
aap = null,
|
||||
)
|
||||
device.hasDualPods shouldBe true
|
||||
@@ -59,7 +59,7 @@ class MonitoredDeviceTest : BaseTest() {
|
||||
@Test
|
||||
fun `Beats Solo 3 has no dual pods or case`() {
|
||||
val device = MonitoredDevice(
|
||||
ble = mockk(relaxed = true) { every { model } returns PodDevice.Model.BEATS_SOLO_3 },
|
||||
ble = mockk(relaxed = true) { every { model } returns PodModel.BEATS_SOLO_3 },
|
||||
aap = null,
|
||||
)
|
||||
device.hasDualPods shouldBe false
|
||||
@@ -92,7 +92,7 @@ class MonitoredDeviceTest : BaseTest() {
|
||||
@Test
|
||||
fun `null BLE gives UNKNOWN model`() {
|
||||
val device = MonitoredDevice(ble = null, aap = null)
|
||||
device.model shouldBe PodDevice.Model.UNKNOWN
|
||||
device.model shouldBe PodModel.UNKNOWN
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -148,7 +148,7 @@ class MonitoredDeviceTest : BaseTest() {
|
||||
@Test
|
||||
fun `charging properties delegate to BLE interfaces`() {
|
||||
val mock = mockk<DualApplePods>(relaxed = true) {
|
||||
every { model } returns PodDevice.Model.AIRPODS_PRO3
|
||||
every { model } returns PodModel.AIRPODS_PRO3
|
||||
every { (this@mockk as HasChargeDetectionDual).isLeftPodCharging } returns true
|
||||
every { (this@mockk as HasChargeDetectionDual).isRightPodCharging } returns false
|
||||
every { (this@mockk as HasCase).isCaseCharging } returns true
|
||||
@@ -162,7 +162,7 @@ class MonitoredDeviceTest : BaseTest() {
|
||||
@Test
|
||||
fun `ear detection properties delegate to BLE interfaces`() {
|
||||
val mock = mockk<DualApplePods>(relaxed = true) {
|
||||
every { model } returns PodDevice.Model.AIRPODS_PRO3
|
||||
every { model } returns PodModel.AIRPODS_PRO3
|
||||
every { (this@mockk as HasEarDetectionDual).isLeftPodInEar } returns true
|
||||
every { (this@mockk as HasEarDetectionDual).isRightPodInEar } returns false
|
||||
every { (this@mockk as HasEarDetection).isBeingWorn } returns false
|
||||
@@ -179,7 +179,7 @@ class MonitoredDeviceTest : BaseTest() {
|
||||
fun `icon and label properties delegate to BLE`() {
|
||||
val device = MonitoredDevice(
|
||||
ble = mockk(relaxed = true) {
|
||||
every { model } returns PodDevice.Model.AIRPODS_PRO3
|
||||
every { model } returns PodModel.AIRPODS_PRO3
|
||||
every { iconRes } returns 42
|
||||
},
|
||||
aap = null,
|
||||
|
||||
@@ -8,7 +8,7 @@ class ModelFeaturesTest : BaseTest() {
|
||||
|
||||
@Test
|
||||
fun `AirPods Pro 3 has all features`() {
|
||||
val f = PodDevice.Model.AIRPODS_PRO3.features
|
||||
val f = PodModel.AIRPODS_PRO3.features
|
||||
f.hasDualPods shouldBe true
|
||||
f.hasCase shouldBe true
|
||||
f.hasEarDetection shouldBe true
|
||||
@@ -17,7 +17,7 @@ class ModelFeaturesTest : BaseTest() {
|
||||
|
||||
@Test
|
||||
fun `AirPods Gen 1 has dual pods and case but no ear detection or ANC`() {
|
||||
val f = PodDevice.Model.AIRPODS_GEN1.features
|
||||
val f = PodModel.AIRPODS_GEN1.features
|
||||
f.hasDualPods shouldBe true
|
||||
f.hasCase shouldBe true
|
||||
f.hasEarDetection shouldBe false
|
||||
@@ -26,7 +26,7 @@ class ModelFeaturesTest : BaseTest() {
|
||||
|
||||
@Test
|
||||
fun `AirPods Max is single device with ANC but no dual pods or case`() {
|
||||
val f = PodDevice.Model.AIRPODS_MAX.features
|
||||
val f = PodModel.AIRPODS_MAX.features
|
||||
f.hasDualPods shouldBe false
|
||||
f.hasCase shouldBe false
|
||||
f.hasEarDetection shouldBe false
|
||||
@@ -35,7 +35,7 @@ class ModelFeaturesTest : BaseTest() {
|
||||
|
||||
@Test
|
||||
fun `Beats Solo 3 has no features`() {
|
||||
val f = PodDevice.Model.BEATS_SOLO_3.features
|
||||
val f = PodModel.BEATS_SOLO_3.features
|
||||
f.hasDualPods shouldBe false
|
||||
f.hasCase shouldBe false
|
||||
f.hasEarDetection shouldBe false
|
||||
@@ -44,7 +44,7 @@ class ModelFeaturesTest : BaseTest() {
|
||||
|
||||
@Test
|
||||
fun `PowerBeats Pro has dual pods, case, ear detection but no ANC`() {
|
||||
val f = PodDevice.Model.POWERBEATS_PRO.features
|
||||
val f = PodModel.POWERBEATS_PRO.features
|
||||
f.hasDualPods shouldBe true
|
||||
f.hasCase shouldBe true
|
||||
f.hasEarDetection shouldBe true
|
||||
@@ -53,7 +53,7 @@ class ModelFeaturesTest : BaseTest() {
|
||||
|
||||
@Test
|
||||
fun `UNKNOWN model has no features`() {
|
||||
val f = PodDevice.Model.UNKNOWN.features
|
||||
val f = PodModel.UNKNOWN.features
|
||||
f.hasDualPods shouldBe false
|
||||
f.hasCase shouldBe false
|
||||
f.hasEarDetection shouldBe false
|
||||
@@ -62,7 +62,7 @@ class ModelFeaturesTest : BaseTest() {
|
||||
|
||||
@Test
|
||||
fun `all ANC-capable models also have ear detection or are headphones`() {
|
||||
PodDevice.Model.entries
|
||||
PodModel.entries
|
||||
.filter { it.features.hasAncControl && it.features.hasDualPods }
|
||||
.forEach { model ->
|
||||
model.features.hasEarDetection shouldBe true
|
||||
@@ -71,7 +71,7 @@ class ModelFeaturesTest : BaseTest() {
|
||||
|
||||
@Test
|
||||
fun `all models with case also have dual pods`() {
|
||||
PodDevice.Model.entries
|
||||
PodModel.entries
|
||||
.filter { it.features.hasCase }
|
||||
.forEach { model ->
|
||||
model.features.hasDualPods shouldBe true
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package eu.darken.capod.pods.core.apple.airpods
|
||||
|
||||
import eu.darken.capod.pods.core.PodDevice
|
||||
import eu.darken.capod.pods.core.PodModel
|
||||
import eu.darken.capod.pods.core.apple.BaseAirPodsTest
|
||||
import eu.darken.capod.pods.core.apple.DualApplePods
|
||||
import eu.darken.capod.pods.core.apple.HasAppleColor
|
||||
@@ -39,7 +39,7 @@ class AirPodsGen1Test : BaseAirPodsTest() {
|
||||
|
||||
podStyle.identifier shouldBe HasAppleColor.DeviceColor.WHITE.name
|
||||
|
||||
model shouldBe PodDevice.Model.AIRPODS_GEN1
|
||||
model shouldBe PodModel.AIRPODS_GEN1
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
package eu.darken.capod.pods.core.apple.airpods
|
||||
|
||||
import eu.darken.capod.pods.core.PodDevice
|
||||
import eu.darken.capod.pods.core.PodModel
|
||||
import eu.darken.capod.pods.core.apple.BaseAirPodsTest
|
||||
import eu.darken.capod.pods.core.apple.DualApplePods
|
||||
import eu.darken.capod.pods.core.apple.HasAppleColor
|
||||
@@ -40,7 +40,7 @@ class AirPodsGen2Test : BaseAirPodsTest() {
|
||||
|
||||
podStyle.identifier shouldBe HasAppleColor.DeviceColor.WHITE.name
|
||||
|
||||
model shouldBe PodDevice.Model.AIRPODS_GEN2
|
||||
model shouldBe PodModel.AIRPODS_GEN2
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
package eu.darken.capod.pods.core.apple.airpods
|
||||
|
||||
import eu.darken.capod.pods.core.PodDevice
|
||||
import eu.darken.capod.pods.core.PodModel
|
||||
import eu.darken.capod.pods.core.apple.BaseAirPodsTest
|
||||
import eu.darken.capod.pods.core.apple.DualApplePods
|
||||
import eu.darken.capod.pods.core.apple.HasAppleColor
|
||||
@@ -40,7 +40,7 @@ class AirPodsGen3Test : BaseAirPodsTest() {
|
||||
|
||||
podStyle.identifier shouldBe HasAppleColor.DeviceColor.WHITE.name
|
||||
|
||||
model shouldBe PodDevice.Model.AIRPODS_GEN3
|
||||
model shouldBe PodModel.AIRPODS_GEN3
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package eu.darken.capod.pods.core.apple.airpods
|
||||
|
||||
import eu.darken.capod.pods.core.PodDevice
|
||||
import eu.darken.capod.pods.core.PodModel
|
||||
import eu.darken.capod.pods.core.apple.BaseAirPodsTest
|
||||
import eu.darken.capod.pods.core.apple.DualApplePods
|
||||
import eu.darken.capod.pods.core.apple.HasAppleColor
|
||||
@@ -40,7 +40,7 @@ class AirPodsGen4AncTest : BaseAirPodsTest() {
|
||||
|
||||
podStyle.identifier shouldBe HasAppleColor.DeviceColor.WHITE.name
|
||||
|
||||
model shouldBe PodDevice.Model.AIRPODS_GEN4_ANC
|
||||
model shouldBe PodModel.AIRPODS_GEN4_ANC
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
package eu.darken.capod.pods.core.apple.airpods
|
||||
|
||||
import eu.darken.capod.pods.core.PodDevice
|
||||
import eu.darken.capod.pods.core.PodModel
|
||||
import eu.darken.capod.pods.core.apple.BaseAirPodsTest
|
||||
import eu.darken.capod.pods.core.apple.DualApplePods
|
||||
import eu.darken.capod.pods.core.apple.HasAppleColor
|
||||
@@ -40,7 +40,7 @@ class AirPodsGen4Test : BaseAirPodsTest() {
|
||||
|
||||
podStyle.identifier shouldBe HasAppleColor.DeviceColor.WHITE.name
|
||||
|
||||
model shouldBe PodDevice.Model.AIRPODS_GEN4
|
||||
model shouldBe PodModel.AIRPODS_GEN4
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
package eu.darken.capod.pods.core.apple.airpods
|
||||
|
||||
import eu.darken.capod.common.isBitSet
|
||||
import eu.darken.capod.pods.core.PodDevice
|
||||
import eu.darken.capod.pods.core.PodModel
|
||||
import eu.darken.capod.pods.core.apple.BaseAirPodsTest
|
||||
import eu.darken.capod.pods.core.apple.HasAppleColor
|
||||
import io.kotest.matchers.shouldBe
|
||||
@@ -28,7 +28,7 @@ class AirPodsMaxTest : BaseAirPodsTest() {
|
||||
|
||||
isHeadsetBeingCharged shouldBe false
|
||||
|
||||
model shouldBe PodDevice.Model.AIRPODS_MAX
|
||||
model shouldBe PodModel.AIRPODS_MAX
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package eu.darken.capod.pods.core.apple.airpods
|
||||
|
||||
import eu.darken.capod.pods.core.PodDevice
|
||||
import eu.darken.capod.pods.core.PodModel
|
||||
import eu.darken.capod.pods.core.apple.BaseAirPodsTest
|
||||
import io.kotest.matchers.shouldBe
|
||||
import kotlinx.coroutines.test.runTest
|
||||
@@ -26,7 +26,7 @@ class AirPodsMaxUsbcTest : BaseAirPodsTest() {
|
||||
|
||||
isHeadsetBeingCharged shouldBe false
|
||||
|
||||
model shouldBe PodDevice.Model.AIRPODS_MAX_USBC
|
||||
model shouldBe PodModel.AIRPODS_MAX_USBC
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
package eu.darken.capod.pods.core.apple.airpods
|
||||
|
||||
import eu.darken.capod.pods.core.PodDevice
|
||||
import eu.darken.capod.pods.core.PodModel
|
||||
import eu.darken.capod.pods.core.apple.BaseAirPodsTest
|
||||
import eu.darken.capod.pods.core.apple.HasAppleColor
|
||||
import io.kotest.matchers.shouldBe
|
||||
@@ -42,7 +42,7 @@ class AirPodsPro2Test : BaseAirPodsTest() {
|
||||
|
||||
podStyle.identifier shouldBe HasAppleColor.DeviceColor.WHITE.name
|
||||
|
||||
model shouldBe PodDevice.Model.AIRPODS_PRO2
|
||||
model shouldBe PodModel.AIRPODS_PRO2
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package eu.darken.capod.pods.core.apple.airpods
|
||||
|
||||
import eu.darken.capod.pods.core.PodDevice
|
||||
import eu.darken.capod.pods.core.PodModel
|
||||
import eu.darken.capod.pods.core.apple.BaseAirPodsTest
|
||||
import eu.darken.capod.pods.core.apple.HasAppleColor
|
||||
import io.kotest.matchers.shouldBe
|
||||
@@ -42,7 +42,7 @@ class AirPodsPro2UsbcTest : BaseAirPodsTest() {
|
||||
|
||||
podStyle.identifier shouldBe HasAppleColor.DeviceColor.WHITE.name
|
||||
|
||||
model shouldBe PodDevice.Model.AIRPODS_PRO2_USBC
|
||||
model shouldBe PodModel.AIRPODS_PRO2_USBC
|
||||
}
|
||||
}
|
||||
|
||||
@@ -66,7 +66,7 @@ class AirPodsPro2UsbcTest : BaseAirPodsTest() {
|
||||
|
||||
podStyle.identifier shouldBe HasAppleColor.DeviceColor.WHITE.name
|
||||
|
||||
model shouldBe PodDevice.Model.AIRPODS_PRO2_USBC
|
||||
model shouldBe PodModel.AIRPODS_PRO2_USBC
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
package eu.darken.capod.pods.core.apple.airpods
|
||||
|
||||
import eu.darken.capod.pods.core.PodDevice
|
||||
import eu.darken.capod.pods.core.PodModel
|
||||
import eu.darken.capod.pods.core.apple.BaseAirPodsTest
|
||||
import eu.darken.capod.pods.core.apple.HasAppleColor
|
||||
import io.kotest.matchers.shouldBe
|
||||
@@ -45,7 +45,7 @@ class AirPodsPro3Test : BaseAirPodsTest() {
|
||||
|
||||
podStyle.identifier shouldBe HasAppleColor.DeviceColor.WHITE.name
|
||||
|
||||
model shouldBe PodDevice.Model.AIRPODS_PRO3
|
||||
model shouldBe PodModel.AIRPODS_PRO3
|
||||
}
|
||||
}
|
||||
|
||||
@@ -71,7 +71,7 @@ class AirPodsPro3Test : BaseAirPodsTest() {
|
||||
|
||||
podStyle.identifier shouldBe HasAppleColor.DeviceColor.WHITE.name
|
||||
|
||||
model shouldBe PodDevice.Model.AIRPODS_PRO3
|
||||
model shouldBe PodModel.AIRPODS_PRO3
|
||||
}
|
||||
}
|
||||
|
||||
@@ -88,7 +88,7 @@ class AirPodsPro3Test : BaseAirPodsTest() {
|
||||
|
||||
podStyle.identifier shouldBe HasAppleColor.DeviceColor.WHITE.name
|
||||
|
||||
model shouldBe PodDevice.Model.AIRPODS_PRO3
|
||||
model shouldBe PodModel.AIRPODS_PRO3
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package eu.darken.capod.pods.core.apple.airpods
|
||||
|
||||
import eu.darken.capod.common.toHex
|
||||
import eu.darken.capod.pods.core.PodDevice
|
||||
import eu.darken.capod.pods.core.PodModel
|
||||
import eu.darken.capod.pods.core.apple.BaseAirPodsTest
|
||||
import eu.darken.capod.pods.core.apple.HasAppleColor
|
||||
import eu.darken.capod.profiles.core.AppleDeviceProfile
|
||||
@@ -38,7 +38,7 @@ class AirPodsProTest : BaseAirPodsTest() {
|
||||
|
||||
podStyle.identifier shouldBe HasAppleColor.DeviceColor.WHITE.name
|
||||
|
||||
model shouldBe PodDevice.Model.AIRPODS_PRO
|
||||
model shouldBe PodModel.AIRPODS_PRO
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package eu.darken.capod.pods.core.apple.beats
|
||||
|
||||
import eu.darken.capod.pods.core.PodDevice
|
||||
import eu.darken.capod.pods.core.PodModel
|
||||
import eu.darken.capod.pods.core.apple.BaseAirPodsTest
|
||||
import eu.darken.capod.pods.core.apple.HasAppleColor
|
||||
import io.kotest.matchers.shouldBe
|
||||
@@ -37,7 +37,7 @@ class BeatsFitProTest : BaseAirPodsTest() {
|
||||
batteryCasePercent shouldBe null
|
||||
podStyle.identifier shouldBe HasAppleColor.DeviceColor.UNKNOWN.name
|
||||
|
||||
model shouldBe PodDevice.Model.BEATS_FIT_PRO
|
||||
model shouldBe PodModel.BEATS_FIT_PRO
|
||||
}
|
||||
}
|
||||
|
||||
@@ -66,7 +66,7 @@ class BeatsFitProTest : BaseAirPodsTest() {
|
||||
batteryCasePercent shouldBe 0.2f
|
||||
podStyle.identifier shouldBe HasAppleColor.DeviceColor.UNKNOWN.name
|
||||
|
||||
model shouldBe PodDevice.Model.BEATS_FIT_PRO
|
||||
model shouldBe PodModel.BEATS_FIT_PRO
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
package eu.darken.capod.pods.core.apple.beats
|
||||
|
||||
import eu.darken.capod.pods.core.PodDevice
|
||||
import eu.darken.capod.pods.core.PodModel
|
||||
import eu.darken.capod.pods.core.apple.BaseAirPodsTest
|
||||
import io.kotest.matchers.shouldBe
|
||||
import kotlinx.coroutines.test.runTest
|
||||
@@ -24,7 +24,7 @@ class BeatsFlexText : BaseAirPodsTest() {
|
||||
|
||||
batteryHeadsetPercent shouldBe 0.4f
|
||||
|
||||
model shouldBe PodDevice.Model.BEATS_FLEX
|
||||
model shouldBe PodModel.BEATS_FLEX
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package eu.darken.capod.pods.core.apple.beats
|
||||
|
||||
import eu.darken.capod.pods.core.PodDevice
|
||||
import eu.darken.capod.pods.core.PodModel
|
||||
import eu.darken.capod.pods.core.apple.BaseAirPodsTest
|
||||
import io.kotest.matchers.shouldBe
|
||||
import kotlinx.coroutines.test.runTest
|
||||
@@ -24,7 +24,7 @@ class BeatsSolo3Test : BaseAirPodsTest() {
|
||||
|
||||
batteryHeadsetPercent shouldBe 0.4f
|
||||
|
||||
model shouldBe PodDevice.Model.BEATS_SOLO_3
|
||||
model shouldBe PodModel.BEATS_SOLO_3
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
package eu.darken.capod.pods.core.apple.beats
|
||||
|
||||
import eu.darken.capod.pods.core.PodDevice
|
||||
import eu.darken.capod.pods.core.PodModel
|
||||
import eu.darken.capod.pods.core.apple.BaseAirPodsTest
|
||||
import io.kotest.matchers.shouldBe
|
||||
import kotlinx.coroutines.test.runTest
|
||||
@@ -24,7 +24,7 @@ class BeatsStudio3Test : BaseAirPodsTest() {
|
||||
|
||||
batteryHeadsetPercent shouldBe 0.4f
|
||||
|
||||
model shouldBe PodDevice.Model.BEATS_STUDIO_3
|
||||
model shouldBe PodModel.BEATS_STUDIO_3
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
package eu.darken.capod.pods.core.apple.beats
|
||||
|
||||
import eu.darken.capod.pods.core.PodDevice
|
||||
import eu.darken.capod.pods.core.PodModel
|
||||
import eu.darken.capod.pods.core.apple.BaseAirPodsTest
|
||||
import io.kotest.matchers.shouldBe
|
||||
import kotlinx.coroutines.test.runTest
|
||||
@@ -24,7 +24,7 @@ class BeatsXTest : BaseAirPodsTest() {
|
||||
|
||||
batteryHeadsetPercent shouldBe 0.5f
|
||||
|
||||
model shouldBe PodDevice.Model.BEATS_X
|
||||
model shouldBe PodModel.BEATS_X
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
package eu.darken.capod.pods.core.apple.beats
|
||||
|
||||
import eu.darken.capod.pods.core.PodDevice
|
||||
import eu.darken.capod.pods.core.PodModel
|
||||
import eu.darken.capod.pods.core.apple.BaseAirPodsTest
|
||||
import io.kotest.matchers.shouldBe
|
||||
import kotlinx.coroutines.test.runTest
|
||||
@@ -24,7 +24,7 @@ class PowerBeats3Test : BaseAirPodsTest() {
|
||||
|
||||
batteryHeadsetPercent shouldBe 0.4f
|
||||
|
||||
model shouldBe PodDevice.Model.POWERBEATS_3
|
||||
model shouldBe PodModel.POWERBEATS_3
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
package eu.darken.capod.pods.core.apple.beats
|
||||
|
||||
import eu.darken.capod.pods.core.PodDevice
|
||||
import eu.darken.capod.pods.core.PodModel
|
||||
import eu.darken.capod.pods.core.apple.BaseAirPodsTest
|
||||
import eu.darken.capod.pods.core.apple.airpods.HasStateDetectionAirPods
|
||||
import io.kotest.matchers.shouldBe
|
||||
@@ -24,7 +24,7 @@ class PowerBeats4Test : BaseAirPodsTest() {
|
||||
|
||||
batteryHeadsetPercent shouldBe 0.2f
|
||||
|
||||
model shouldBe PodDevice.Model.POWERBEATS_4
|
||||
model shouldBe PodModel.POWERBEATS_4
|
||||
|
||||
state shouldBe HasStateDetectionAirPods.ConnectionState.MUSIC
|
||||
}
|
||||
@@ -45,7 +45,7 @@ class PowerBeats4Test : BaseAirPodsTest() {
|
||||
|
||||
batteryHeadsetPercent shouldBe 0.2f
|
||||
|
||||
model shouldBe PodDevice.Model.POWERBEATS_4
|
||||
model shouldBe PodModel.POWERBEATS_4
|
||||
|
||||
state shouldBe HasStateDetectionAirPods.ConnectionState.IDLE
|
||||
}
|
||||
@@ -67,7 +67,7 @@ class PowerBeats4Test : BaseAirPodsTest() {
|
||||
|
||||
batteryHeadsetPercent shouldBe 0.2f
|
||||
|
||||
model shouldBe PodDevice.Model.POWERBEATS_4
|
||||
model shouldBe PodModel.POWERBEATS_4
|
||||
|
||||
state shouldBe HasStateDetectionAirPods.ConnectionState.DISCONNECTED
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package eu.darken.capod.pods.core.apple.beats
|
||||
|
||||
import eu.darken.capod.pods.core.PodDevice
|
||||
import eu.darken.capod.pods.core.PodModel
|
||||
import eu.darken.capod.pods.core.apple.BaseAirPodsTest
|
||||
import eu.darken.capod.pods.core.apple.HasAppleColor
|
||||
import io.kotest.matchers.shouldBe
|
||||
@@ -35,7 +35,7 @@ class PowerBeatsPro2Test : BaseAirPodsTest() {
|
||||
|
||||
podStyle.identifier shouldBe HasAppleColor.DeviceColor.RED.name
|
||||
|
||||
model shouldBe PodDevice.Model.POWERBEATS_PRO2
|
||||
model shouldBe PodModel.POWERBEATS_PRO2
|
||||
}
|
||||
}
|
||||
|
||||
@@ -55,7 +55,7 @@ class PowerBeatsPro2Test : BaseAirPodsTest() {
|
||||
|
||||
podStyle.identifier shouldBe HasAppleColor.DeviceColor.RED.name
|
||||
|
||||
model shouldBe PodDevice.Model.POWERBEATS_PRO2
|
||||
model shouldBe PodModel.POWERBEATS_PRO2
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
package eu.darken.capod.pods.core.apple.beats
|
||||
|
||||
import eu.darken.capod.pods.core.PodDevice
|
||||
import eu.darken.capod.pods.core.PodModel
|
||||
import eu.darken.capod.pods.core.apple.BaseAirPodsTest
|
||||
import eu.darken.capod.pods.core.apple.HasAppleColor
|
||||
import io.kotest.matchers.shouldBe
|
||||
@@ -35,7 +35,7 @@ class PowerBeatsProTest : BaseAirPodsTest() {
|
||||
|
||||
podStyle.identifier shouldBe HasAppleColor.DeviceColor.WHITE.name
|
||||
|
||||
model shouldBe PodDevice.Model.POWERBEATS_PRO
|
||||
model shouldBe PodModel.POWERBEATS_PRO
|
||||
}
|
||||
}
|
||||
|
||||
@@ -66,7 +66,7 @@ class PowerBeatsProTest : BaseAirPodsTest() {
|
||||
|
||||
podStyle.identifier shouldBe HasAppleColor.DeviceColor.UNKNOWN.name
|
||||
|
||||
model shouldBe PodDevice.Model.POWERBEATS_PRO
|
||||
model shouldBe PodModel.POWERBEATS_PRO
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
package eu.darken.capod.pods.core.apple.misc
|
||||
|
||||
import eu.darken.capod.pods.core.PodDevice
|
||||
import eu.darken.capod.pods.core.PodModel
|
||||
import eu.darken.capod.pods.core.apple.BaseAirPodsTest
|
||||
import io.kotest.matchers.shouldBe
|
||||
import kotlinx.coroutines.test.runTest
|
||||
@@ -34,7 +34,7 @@ class FakeAirPodsGen1Test : BaseAirPodsTest() {
|
||||
|
||||
batteryCasePercent shouldBe 0.7f
|
||||
|
||||
model shouldBe PodDevice.Model.FAKE_AIRPODS_GEN2
|
||||
model shouldBe PodModel.FAKE_AIRPODS_GEN2
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
package eu.darken.capod.pods.core.apple.misc
|
||||
|
||||
import eu.darken.capod.pods.core.PodDevice
|
||||
import eu.darken.capod.pods.core.PodModel
|
||||
import eu.darken.capod.pods.core.apple.BaseAirPodsTest
|
||||
import io.kotest.matchers.shouldBe
|
||||
import kotlinx.coroutines.test.runTest
|
||||
@@ -34,7 +34,7 @@ class FakeAirPodsGen2Test : BaseAirPodsTest() {
|
||||
|
||||
batteryCasePercent shouldBe 0.7f
|
||||
|
||||
model shouldBe PodDevice.Model.FAKE_AIRPODS_GEN1
|
||||
model shouldBe PodModel.FAKE_AIRPODS_GEN1
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
package eu.darken.capod.pods.core.apple.misc
|
||||
|
||||
import eu.darken.capod.pods.core.PodDevice
|
||||
import eu.darken.capod.pods.core.PodModel
|
||||
import eu.darken.capod.pods.core.apple.BaseAirPodsTest
|
||||
import io.kotest.matchers.shouldBe
|
||||
import kotlinx.coroutines.test.runTest
|
||||
@@ -33,7 +33,7 @@ class FakeAirPodsGen3Test : BaseAirPodsTest() {
|
||||
|
||||
batteryCasePercent shouldBe 0.7f
|
||||
|
||||
model shouldBe PodDevice.Model.FAKE_AIRPODS_GEN3
|
||||
model shouldBe PodModel.FAKE_AIRPODS_GEN3
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
package eu.darken.capod.pods.core.apple.misc
|
||||
|
||||
import eu.darken.capod.pods.core.PodDevice
|
||||
import eu.darken.capod.pods.core.PodModel
|
||||
import eu.darken.capod.pods.core.apple.BaseAirPodsTest
|
||||
import io.kotest.matchers.shouldBe
|
||||
import kotlinx.coroutines.test.runTest
|
||||
@@ -28,7 +28,7 @@ class FakeAirPodsPro2Test : BaseAirPodsTest() {
|
||||
|
||||
batteryCasePercent shouldBe 0.8f
|
||||
|
||||
model shouldBe PodDevice.Model.FAKE_AIRPODS_PRO2
|
||||
model shouldBe PodModel.FAKE_AIRPODS_PRO2
|
||||
}
|
||||
}
|
||||
|
||||
@@ -55,7 +55,7 @@ class FakeAirPodsPro2Test : BaseAirPodsTest() {
|
||||
|
||||
batteryCasePercent shouldBe 0.2f
|
||||
|
||||
model shouldBe PodDevice.Model.FAKE_AIRPODS_PRO2
|
||||
model shouldBe PodModel.FAKE_AIRPODS_PRO2
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
package eu.darken.capod.pods.core.apple.misc
|
||||
|
||||
import eu.darken.capod.pods.core.PodDevice
|
||||
import eu.darken.capod.pods.core.PodModel
|
||||
import eu.darken.capod.pods.core.apple.BaseAirPodsTest
|
||||
import io.kotest.matchers.shouldBe
|
||||
import kotlinx.coroutines.test.runTest
|
||||
@@ -34,7 +34,7 @@ class FakeAirPodsProTest : BaseAirPodsTest() {
|
||||
|
||||
batteryCasePercent shouldBe 0.7f
|
||||
|
||||
model shouldBe PodDevice.Model.FAKE_AIRPODS_PRO
|
||||
model shouldBe PodModel.FAKE_AIRPODS_PRO
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user