From d48990875050e0c3acdc1f40bd767b8bf5c26108 Mon Sep 17 00:00:00 2001 From: Michael Pohl Date: Mon, 24 Jun 2024 11:30:38 +0200 Subject: [PATCH] Suunto Ocean, Coros Dura, SuuntoD4/D9, fixes --- src/Device/CorosDura.php | 32 ++++++++++++++++++++++++ src/Device/DeviceProfile.php | 4 +++ src/Device/GarminForerunner225SMusic.php | 5 ++++ src/Device/SuuntoD4.php | 27 ++++++++++++++++++++ src/Device/SuuntoD9.php | 27 ++++++++++++++++++++ src/Device/SuuntoOcean.php | 32 ++++++++++++++++++++++++ src/Distributor/Coros.php | 1 + src/Distributor/Suunto.php | 3 +++ src/Mapping/CorosFitSdkMapping.php | 1 + src/Mapping/SuuntoFitSdkMapping.php | 2 ++ 10 files changed, 134 insertions(+) create mode 100644 src/Device/CorosDura.php create mode 100644 src/Device/SuuntoD4.php create mode 100644 src/Device/SuuntoD9.php create mode 100644 src/Device/SuuntoOcean.php diff --git a/src/Device/CorosDura.php b/src/Device/CorosDura.php new file mode 100644 index 0000000..f79caf5 --- /dev/null +++ b/src/Device/CorosDura.php @@ -0,0 +1,32 @@ + + * + * This source file is subject to the MIT license that is bundled + * with this source code in the file LICENSE. + */ + +namespace Runalyze\Devices\Device; + +class CorosDura extends AbstractDevice +{ + use CorosDeviceTrait; + + public function getEnum(): int + { + return DeviceProfile::COROS_DURA; + } + + public function getName(): string + { + return 'Dura'; + } + + public function hasBarometer(): bool + { + return true; + } +} diff --git a/src/Device/DeviceProfile.php b/src/Device/DeviceProfile.php index c03d84c..67b9f70 100644 --- a/src/Device/DeviceProfile.php +++ b/src/Device/DeviceProfile.php @@ -698,6 +698,10 @@ class DeviceProfile extends AbstractEnum public const GARMIN_FORERUNNER_165_MUSIC = 673; public const POLAR_H_7 = 674; public const COROS_VERTIX_2_S = 675; + public const COROS_DURA = 676; + public const SUUNTO_OCEAN = 677; + public const SUUNTO_D_9 = 678; + public const SUUNTO_D_4 = 679; public static function getSlugs(): array { diff --git a/src/Device/GarminForerunner225SMusic.php b/src/Device/GarminForerunner225SMusic.php index e7dca14..64876f8 100644 --- a/src/Device/GarminForerunner225SMusic.php +++ b/src/Device/GarminForerunner225SMusic.php @@ -24,4 +24,9 @@ public function getName(): string { return 'Forerunner 225S Music'; } + + public function hasBarometer(): bool + { + return true; + } } diff --git a/src/Device/SuuntoD4.php b/src/Device/SuuntoD4.php new file mode 100644 index 0000000..9de68d3 --- /dev/null +++ b/src/Device/SuuntoD4.php @@ -0,0 +1,27 @@ + + * + * This source file is subject to the MIT license that is bundled + * with this source code in the file LICENSE. + */ + +namespace Runalyze\Devices\Device; + +class SuuntoD4 extends AbstractDevice +{ + use SuuntoDeviceTrait; + + public function getEnum(): int + { + return DeviceProfile::SUUNTO_D_4; + } + + public function getName(): string + { + return 'D4'; + } +} diff --git a/src/Device/SuuntoD9.php b/src/Device/SuuntoD9.php new file mode 100644 index 0000000..73b1deb --- /dev/null +++ b/src/Device/SuuntoD9.php @@ -0,0 +1,27 @@ + + * + * This source file is subject to the MIT license that is bundled + * with this source code in the file LICENSE. + */ + +namespace Runalyze\Devices\Device; + +class SuuntoD9 extends AbstractDevice +{ + use SuuntoDeviceTrait; + + public function getEnum(): int + { + return DeviceProfile::SUUNTO_D_9; + } + + public function getName(): string + { + return 'D9'; + } +} diff --git a/src/Device/SuuntoOcean.php b/src/Device/SuuntoOcean.php new file mode 100644 index 0000000..31146fb --- /dev/null +++ b/src/Device/SuuntoOcean.php @@ -0,0 +1,32 @@ + + * + * This source file is subject to the MIT license that is bundled + * with this source code in the file LICENSE. + */ + +namespace Runalyze\Devices\Device; + +class SuuntoOcean extends AbstractDevice +{ + use SuuntoDeviceTrait; + + public function getEnum(): int + { + return DeviceProfile::SUUNTO_OCEAN; + } + + public function getName(): string + { + return 'Ocean'; + } + + public function hasBarometer(): bool + { + return true; + } +} diff --git a/src/Distributor/Coros.php b/src/Distributor/Coros.php index 957ab56..5f519d7 100644 --- a/src/Distributor/Coros.php +++ b/src/Distributor/Coros.php @@ -40,6 +40,7 @@ public function getDeviceEnumList(): array DeviceProfile::COROS_VERTIX, DeviceProfile::COROS_VERTIX_2, DeviceProfile::COROS_VERTIX_2_S, + DeviceProfile::COROS_DURA, DeviceProfile::COROS_UNKNOWN, ]; } diff --git a/src/Distributor/Suunto.php b/src/Distributor/Suunto.php index 80950e9..658fa28 100644 --- a/src/Distributor/Suunto.php +++ b/src/Distributor/Suunto.php @@ -36,7 +36,9 @@ public function getDeviceEnumList(): array DeviceProfile::SUUNTO_X_9, DeviceProfile::SUUNTO_X_10, DeviceProfile::SUUNTO_D_4_I, + DeviceProfile::SUUNTO_D_4, DeviceProfile::SUUNTO_D_5, + DeviceProfile::SUUNTO_D_9, DeviceProfile::SUUNTO_5_PEAK, DeviceProfile::SUUNTO_7, DeviceProfile::SUUNTO_9, @@ -54,6 +56,7 @@ public function getDeviceEnumList(): array DeviceProfile::SUUNTO_T_3_D, DeviceProfile::SUUNTO_D_6_I, DeviceProfile::SUUNTO_D_4_F, + DeviceProfile::SUUNTO_OCEAN, DeviceProfile::SUUNTO_AMBIT, DeviceProfile::SUUNTO_AMBIT_2, DeviceProfile::SUUNTO_AMBIT_2_R, diff --git a/src/Mapping/CorosFitSdkMapping.php b/src/Mapping/CorosFitSdkMapping.php index c745c4c..89c02c6 100644 --- a/src/Mapping/CorosFitSdkMapping.php +++ b/src/Mapping/CorosFitSdkMapping.php @@ -36,6 +36,7 @@ protected function getMapping() 812 => DeviceProfile::COROS_APEX_2, 822 => DeviceProfile::COROS_APEX_2_PRO, 823 => DeviceProfile::KIPRUN_900, + 851 => DeviceProfile::COROS_DURA, ]; /* * Unknown: diff --git a/src/Mapping/SuuntoFitSdkMapping.php b/src/Mapping/SuuntoFitSdkMapping.php index a93db82..fcfd6d4 100644 --- a/src/Mapping/SuuntoFitSdkMapping.php +++ b/src/Mapping/SuuntoFitSdkMapping.php @@ -64,9 +64,11 @@ protected function getMapping() 40 => DeviceProfile::SUUNTO_7, 41 => DeviceProfile::SUUNTO_EON_STEEL, 42 => DeviceProfile::SUUNTO_9_PEAK, + 44 => DeviceProfile::SUUNT_D4, 45 => DeviceProfile::SUUNTO_D_4_F, 46 => DeviceProfile::SUUNTO_D_4_I, 48 => DeviceProfile::SUUNTO_D_6_I, + 49 => DeviceProfile::SUUNTO_D_9, 52 => DeviceProfile::SUUNTO_VYPER_NOVO, 53 => DeviceProfile::SUUNTO_ZOOP_NOVO, 56 => DeviceProfile::SUUNTO_5_PEAK,