tonesto7 / fordpass-scriptable

FordPass Widget for Scriptable
GNU General Public License v3.0
169 stars 27 forks source link

The current widget shows the door status for four doors on Broncos with two doors #12

Closed jbdacruz closed 2 years ago

jbdacruz commented 2 years ago

I figured something like this should work. FYI, I'm not a JS person so there's probably a better way.

const TWO_DOORS = 3 <<<< I'm assuming vehicleData.statusDoors.length returns 3 or 5 but I don't have a Bronco or an IPhone if(vehicleData.statusDoors.length !== TWO_DOORS) {

        let dataRow2Fld = await createRow(srcField);
        let row2RfTxt1 = await createText(dataRow2Fld, 'LR (', styles.normTxt);
        let row2RfStatTxt = await createText(dataRow2Fld, vehicleData.statusDoors['leftRear'] ? openSymbol : closedSymbol, vehicleData.statusDoors['leftRear'] ? styles.statOpen : styles.statClosed);
        let row2RfTxt2 = await createText(dataRow2Fld, ')' + ' | ', styles.normTxt);
        let row2RrTxt1 = await createText(dataRow2Fld, 'RR (', styles.normTxt);
        let row2RrStatTxt = await createText(dataRow2Fld, vehicleData.statusDoors['rightRear'] ? openSymbol : closedSymbol, vehicleData.statusDoors['rightRear'] ? styles.statOpen : styles.statClosed);
        let row2RrTxt2 = await createText(dataRow2Fld, ')', styles.normTxt);
    }
tonesto7 commented 2 years ago

I will look into this...

jbdacruz commented 2 years ago

@tonesto7 also I seem to be able to create PRs but I can't create a new branch

tonesto7 commented 2 years ago

sorry, I completely forgot about this.

Please try this version to see if the issue resolves it: https://gist.githubusercontent.com/tonesto7/942bda23e3228f16f324bf4e68fec6d2/raw/d9543252644228371054f03a4c16e44e4104f7c2/Fordpass%2520Widget.js

If you do get the menu to show from the widget please tap on widget settings > debug menu > copy vehicle data and paste it here please

jbdacruz commented 2 years ago

I actually don't have the app or an IPhone, but I'm in on Bronco6G. I saw also saw your update.