Skip to content

Commit

Permalink
Add Set/Drift conversion
Browse files Browse the repository at this point in the history
Add Set/Drift conversion for PGN 129291
  • Loading branch information
democles-razor authored Feb 2, 2025
1 parent 53f067d commit 537d31d
Showing 1 changed file with 53 additions and 0 deletions.
53 changes: 53 additions & 0 deletions conversions/setdrift.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@

module.exports = (app, plugin) => {
return {
title: 'Set/Drift (129291)',
optionKey: 'SetDrift',
keys: ["environment.current.setTrue", "environment.current.drift"],
callback: (set, drift) => {
try {
return [
{
pgn: 129291,
'Set': set,
'Drift': drift,
'Set Reference': 0
}
]
} catch ( err ) {
console.error(err)
}
},

tests: [{
input: [ 2.0944, 1.2 ],
expected: [
{
pgn: 129291,
dst: 255,
prio: 2,
fields: {
'Drift': 1.2,
'Set': 2.0944,
'Set Reference': "True"
}
}
]
},{
input: [ 1.0944, 1.5 ],
expected: [
{
pgn: 129291,
dst: 255,
prio: 2,
fields: {
'Drift': 1.5,
'Set': 1.0944,
'Set Reference': "True"
}
}
]
}]
}
}

0 comments on commit 537d31d

Please sign in to comment.