Thermostat setpoint configuration

Hello all,

I was attempting to create a simple thermostat widget:

There are many great widget examples and used them for reference. However, I ran into some difficulty since my thermostat requires a distinct Cool or Heat Setpoint command. The examples I encountered on line only have a single Setpoint item.

String  T1_CoolSetpoint  "T1 Cool Temp [%s]" <temperature>   { channel="serial:serialDevice:Aprilaire:Therm_1:T1_CoolSetpoint"}
String  T1_HeatSetpoint  "T1 Heat Temp [%s]" <temperature>   { channel="serial:serialDevice:Aprilaire:Therm_1:T1_HeatSetpoint"}
String  T1_ModeSet  "T1 Mode Set"  { channel="serial:serialDevice:Aprilaire:Therm_1:T1_ModeSet"}

I would like to be able to incrementally increase / decrease the Setpoint by 1 , and have the widget distinguish between the HVAC mode while assigning the respective Cool or Heat Setpoint. Have tried the configuration bellow and I could get it to work individually for either Cool or Heat, but no success when related to the HVAC mode.

- component: oh-button
                          action: command
                          actionCommand: =Number(items['.....?......'].state.split(' ')[0]) + 1
                          actionItem: "= (items.T10_ModeSet.state === 'COOL') ? 'T10_CoolSetpoint' : 'T10_HeatSetpoint'"
                          color: blue
                          icon-f7: plus
                          iconSize: 30

Any suggestions would be appreciated.

I believe this to be one solution:

actionCommand: "=(items.T10_ModeSet.state === 'HEAT') ? Number(items['T10_HeatSetpoint'].state.split(' ')[0]) - 1 : (items.T10_ModeSet.state === 'COOL')  ? Number(items['T10_CoolSetpoint'].state.split(' ')[0]) - 1 : ''"

For the sake of flexibility, I would appreciate any other options. Thank you much!