mirror of
https://github.com/house-of-abbey/GarminHomeAssistant.git
synced 2025-08-04 02:48:41 +00:00
remove transcoding, move pin to settings, remove pin from schema
This commit is contained in:
@ -28,14 +28,12 @@ class HomeAssistantTapMenuItem extends WatchUi.IconMenuItem {
|
||||
private var mService as Lang.String or Null;
|
||||
private var mConfirm as Lang.Boolean;
|
||||
private var mData as Lang.Dictionary or Null;
|
||||
private var mPin as Lang.String or Null;
|
||||
|
||||
function initialize(
|
||||
label as Lang.String or Lang.Symbol,
|
||||
template as Lang.String,
|
||||
service as Lang.String or Null,
|
||||
confirm as Lang.Boolean,
|
||||
pin as Lang.String or Null,
|
||||
data as Lang.Dictionary or Null,
|
||||
icon as Graphics.BitmapType or WatchUi.Drawable,
|
||||
options as {
|
||||
@ -56,7 +54,6 @@ class HomeAssistantTapMenuItem extends WatchUi.IconMenuItem {
|
||||
mService = service;
|
||||
mConfirm = confirm;
|
||||
mData = data;
|
||||
mPin = pin;
|
||||
}
|
||||
|
||||
function hasTemplate() as Lang.Boolean {
|
||||
@ -87,19 +84,23 @@ class HomeAssistantTapMenuItem extends WatchUi.IconMenuItem {
|
||||
}
|
||||
|
||||
function callService() as Void {
|
||||
var hasTouchScreen = System.getDeviceSettings().isTouchScreen;
|
||||
if (mPin != null && hasTouchScreen) {
|
||||
WatchUi.pushView(
|
||||
new HomeAssistantPinConfirmationView(),
|
||||
new HomeAssistantPinConfirmationDelegate(method(:onConfirm), false, mPin),
|
||||
WatchUi.SLIDE_IMMEDIATE
|
||||
);
|
||||
} else if (mConfirm || (mPin!=null && !hasTouchScreen)) {
|
||||
WatchUi.pushView(
|
||||
new HomeAssistantConfirmation(),
|
||||
new HomeAssistantConfirmationDelegate(method(:onConfirm), false),
|
||||
WatchUi.SLIDE_IMMEDIATE
|
||||
);
|
||||
if (mConfirm) {
|
||||
var hasTouchScreen = System.getDeviceSettings().isTouchScreen;
|
||||
var pin = Settings.getPin();
|
||||
System.println("HomeAsistantTemplateMenuItem callService() pin = '" + pin + "'");
|
||||
if (!hasTouchScreen || "".equals(pin)) {
|
||||
WatchUi.pushView(
|
||||
new HomeAssistantConfirmation(),
|
||||
new HomeAssistantConfirmationDelegate(method(:onConfirm), false),
|
||||
WatchUi.SLIDE_IMMEDIATE
|
||||
);
|
||||
} else {
|
||||
WatchUi.pushView(
|
||||
new HomeAssistantPinConfirmationView(),
|
||||
new HomeAssistantPinConfirmationDelegate(method(:onConfirm), false, pin),
|
||||
WatchUi.SLIDE_IMMEDIATE
|
||||
);
|
||||
}
|
||||
} else {
|
||||
onConfirm(false);
|
||||
}
|
||||
|
Reference in New Issue
Block a user