-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add polar fit mapping, garmin devices update
- Loading branch information
Michael Pohl
committed
Jun 3, 2022
1 parent
45cc7dc
commit 16fbb6e
Showing
11 changed files
with
306 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the Runalyze Device List. | ||
* | ||
* (c) RUNALYZE <mail@runalyze.com> | ||
* | ||
* 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 GarminDescentG1 extends AbstractDevice | ||
{ | ||
use GarminDeviceTrait; | ||
|
||
public function getEnum() | ||
{ | ||
return DeviceProfile::GARMIN_DESCENT_G_1; | ||
} | ||
|
||
public function getName() | ||
{ | ||
return 'Descent G1'; | ||
} | ||
|
||
public function hasBarometer() | ||
{ | ||
return true; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the Runalyze Device List. | ||
* | ||
* (c) RUNALYZE <mail@runalyze.com> | ||
* | ||
* 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 GarminForerunner225Music extends AbstractDevice | ||
{ | ||
use GarminDeviceTrait; | ||
|
||
public function getEnum() | ||
{ | ||
return DeviceProfile::GARMIN_FORERUNNER_225_MUSIC; | ||
} | ||
|
||
public function getName() | ||
{ | ||
return 'Forerunner 225 Music'; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the Runalyze Device List. | ||
* | ||
* (c) RUNALYZE <mail@runalyze.com> | ||
* | ||
* 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 GarminForerunner225SMusic extends AbstractDevice | ||
{ | ||
use GarminDeviceTrait; | ||
|
||
public function getEnum() | ||
{ | ||
return DeviceProfile::GARMIN_FORERUNNER_225_S_MUSIC; | ||
} | ||
|
||
public function getName() | ||
{ | ||
return 'Forerunner 225S Music'; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the Runalyze Device List. | ||
* | ||
* (c) RUNALYZE <mail@runalyze.com> | ||
* | ||
* 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 GarminForerunner955 extends AbstractDevice | ||
{ | ||
use GarminDeviceTrait; | ||
|
||
public function getEnum() | ||
{ | ||
return DeviceProfile::GARMIN_FORERUNNER_955; | ||
} | ||
|
||
public function getName() | ||
{ | ||
return 'Forerunner 955'; | ||
} | ||
|
||
public function hasBarometer() | ||
{ | ||
return true; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the Runalyze Device List. | ||
* | ||
* (c) RUNALYZE <mail@runalyze.com> | ||
* | ||
* 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 GarminForerunner955Solar extends AbstractDevice | ||
{ | ||
use GarminDeviceTrait; | ||
|
||
public function getEnum() | ||
{ | ||
return DeviceProfile::GARMIN_FORERUNNER_955_SOLAR; | ||
} | ||
|
||
public function getName() | ||
{ | ||
return 'Forerunner 955 Solar'; | ||
} | ||
|
||
public function hasBarometer() | ||
{ | ||
return true; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the Runalyze Device List. | ||
* | ||
* (c) RUNALYZE <mail@runalyze.com> | ||
* | ||
* 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 GarminInstinct2S extends AbstractDevice | ||
{ | ||
use GarminDeviceTrait; | ||
|
||
public function getEnum() | ||
{ | ||
return DeviceProfile::GARMIN_INSTINCT_2_S; | ||
} | ||
|
||
public function getName() | ||
{ | ||
return 'Instinct 2S'; | ||
} | ||
|
||
public function hasBarometer() | ||
{ | ||
return false; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the Runalyze Device List. | ||
* | ||
* (c) RUNALYZE <mail@runalyze.com> | ||
* | ||
* 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 GarminVivoMoveSport extends AbstractDevice | ||
{ | ||
use GarminDeviceTrait; | ||
|
||
public function getEnum() | ||
{ | ||
return DeviceProfile::GARMIN_VIVO_MOVE_SPORT; | ||
} | ||
|
||
public function getName() | ||
{ | ||
return 'vívomove Sport'; | ||
} | ||
|
||
public function hasBarometer() | ||
{ | ||
return true; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the Runalyze Device List. | ||
* | ||
* (c) RUNALYZE <mail@runalyze.com> | ||
* | ||
* This source file is subject to the MIT license that is bundled | ||
* with this source code in the file LICENSE. | ||
*/ | ||
|
||
namespace Runalyze\Devices\Mapping; | ||
|
||
use Runalyze\Devices\Device\DeviceProfile; | ||
|
||
class PolarFitSdkMapping | ||
{ | ||
/** @var int[]|string[] */ | ||
protected $Mapping = []; | ||
|
||
protected function getMapping() | ||
{ | ||
return [ | ||
13 => DeviceProfile::POLAR_V_800, | ||
22 => DeviceProfile::POLAR_M_400, | ||
151 => DeviceProfile::POLAR_O_H_1, | ||
163 => DeviceProfile::POLAR_M_430, | ||
172 => DeviceProfile::POLAR_M_460, | ||
203 => DeviceProfile::POLAR_VANTAGE_V, | ||
209 => DeviceProfile::POLAR_VANTAGE_M, | ||
217 => DeviceProfile::POLAR_GRIT_X, | ||
225 => DeviceProfile::POLAR_UNITE, | ||
230 => DeviceProfile::POLAR_VANTAGE_V_2, | ||
235 => DeviceProfile::POLAR_VERITY_SENSE, | ||
236 => DeviceProfile::POLAR_VANTAGE_M_2, | ||
241 => DeviceProfile::POLAR_IGNITE_2, | ||
251 => DeviceProfile::POLAR_GRIT_X_PRO, | ||
261 => DeviceProfile::POLAR_PACER_PRO, | ||
]; | ||
} | ||
|
||
public function __construct() | ||
{ | ||
$this->Mapping = $this->getMapping(); | ||
} | ||
|
||
/** | ||
* @param int|string $value | ||
* @return int|string | ||
*/ | ||
public function toInternal($value) | ||
{ | ||
if (isset($this->Mapping[$value])) { | ||
return $this->Mapping[$value]; | ||
} | ||
|
||
return; | ||
} | ||
} |