From d6b3383c45ac5987dc3c88a50e078007ad4c5dd7 Mon Sep 17 00:00:00 2001 From: Galadril Date: Tue, 13 Feb 2024 14:45:00 +0100 Subject: [PATCH] Removed the old urls to just keep support for the new v2 urls --- .../nl/hnogames/domoticz/MainActivity.java | 10 +- .../domoticz/adapters/DashboardAdapter.java | 2 +- .../domoticz/adapters/EventsAdapter.java | 2 +- .../domoticz/adapters/LogAdapter.java | 6 +- .../adapters/UserVariablesAdapter.java | 2 +- .../domoticz/adapters/WidgetsAdapter.java | 4 +- .../nl/hnogames/domoticz/fragments/Graph.java | 18 +- .../hnogames/domoticz/fragments/Wizard.java | 150 ++--- .../domoticz/ui/ScoopSettingsActivity.java | 2 +- .../domoticz/widgets/WidgetProviderLarge.java | 4 +- .../domoticz/widgets/WidgetProviderSmall.java | 4 +- app/version.properties | 4 +- .../Containers/ExtendedStatusInfo.java | 2 +- .../Containers/GraphPointInfo.java | 2 +- .../domoticzapi/Containers/ServerInfo.java | 10 - .../nl/hnogames/domoticzapi/Domoticz.java | 130 ++-- .../nl/hnogames/domoticzapi/DomoticzUrls.java | 517 ++++++---------- .../hnogames/domoticzapi/DomoticzValues.java | 48 +- .../Utils/SerializableManager.java | 1 - .../domoticzapi/v2/DomoticzValues.java | 556 ------------------ domoticzapi/version.properties | 2 +- gradle.properties | 2 +- 22 files changed, 349 insertions(+), 1129 deletions(-) delete mode 100644 domoticzapi/src/main/java/nl/hnogames/domoticzapi/v2/DomoticzValues.java diff --git a/app/src/main/java/nl/hnogames/domoticz/MainActivity.java b/app/src/main/java/nl/hnogames/domoticz/MainActivity.java index a3b0a37ef..223eeb36f 100644 --- a/app/src/main/java/nl/hnogames/domoticz/MainActivity.java +++ b/app/src/main/java/nl/hnogames/domoticz/MainActivity.java @@ -896,7 +896,7 @@ public void onCancel() { if (!allUsers.contains(user.getUsername())) { ProfileDrawerItem profile = new ProfileDrawerItem().withName(user.getRightsValue(this) ).withEmail(user.getUsername()) - .withIcon(R.drawable.users) + .withIcon(nl.hnogames.domoticzapi.R.drawable.users) .withEnabled(user.isEnabled()); allUsers.add(user.getUsername()); headerResult.addProfiles(profile); @@ -1499,25 +1499,25 @@ public void onPermissionGranted(@NonNull String[] permissionName) { super.onPermissionGranted(permissionName); } - @Shortcut(id = "open_dashboard", icon = R.drawable.generic, shortLabelRes = R.string.title_dashboard, rank = 5, activity = MainActivity.class) + @Shortcut(id = "open_dashboard", icon = nl.hnogames.domoticzapi.R.drawable.generic, shortLabelRes = R.string.title_dashboard, rank = 5, activity = MainActivity.class) public void OpenDashBoard() { fromShortcut = true; changeFragment("nl.hnogames.domoticz.fragments.Dashboard", false); } - @Shortcut(id = "open_switches", icon = R.drawable.bulb, shortLabelRes = R.string.title_switches, rank = 4, activity = MainActivity.class) + @Shortcut(id = "open_switches", icon = nl.hnogames.domoticzapi.R.drawable.bulb, shortLabelRes = R.string.title_switches, rank = 4, activity = MainActivity.class) public void OpenSwitch() { fromShortcut = true; changeFragment("nl.hnogames.domoticz.fragments.Switches", false); } - @Shortcut(id = "open_utilities", icon = R.drawable.solar_panel, shortLabelRes = R.string.title_utilities, rank = 3, activity = MainActivity.class) + @Shortcut(id = "open_utilities", icon = nl.hnogames.domoticzapi.R.drawable.solar_panel, shortLabelRes = R.string.title_utilities, rank = 3, activity = MainActivity.class) public void OpenUtilities() { fromShortcut = true; changeFragment("nl.hnogames.domoticz.fragments.Utilities", false); } - @Shortcut(id = "open_temperature", icon = R.drawable.temperature, shortLabelRes = R.string.title_temperature, rank = 2, activity = MainActivity.class) + @Shortcut(id = "open_temperature", icon = nl.hnogames.domoticzapi.R.drawable.temperature, shortLabelRes = R.string.title_temperature, rank = 2, activity = MainActivity.class) public void OpenTemperature() { fromShortcut = true; changeFragment("nl.hnogames.domoticz.fragments.Temperature", false); diff --git a/app/src/main/java/nl/hnogames/domoticz/adapters/DashboardAdapter.java b/app/src/main/java/nl/hnogames/domoticz/adapters/DashboardAdapter.java index 7b238ec5e..325380db2 100644 --- a/app/src/main/java/nl/hnogames/domoticz/adapters/DashboardAdapter.java +++ b/app/src/main/java/nl/hnogames/domoticz/adapters/DashboardAdapter.java @@ -974,7 +974,7 @@ private void setTemperatureRowData(DevicesInfo mDeviceInfo, DataObjectHolder hol holder.pieView.setPercentageBackgroundColor(ContextCompat.getColor(context, R.color.material_orange_600)); if ((sign.equals("C") && temperature < 0) || (sign.equals("F") && temperature < 30)) { - holder.pieView.setPercentageBackgroundColor(R.color.md_red_600); + holder.pieView.setPercentageBackgroundColor(com.mikepenz.materialize.R.color.md_red_600); } if (!mSharedPrefs.getAutoRefresh()) { diff --git a/app/src/main/java/nl/hnogames/domoticz/adapters/EventsAdapter.java b/app/src/main/java/nl/hnogames/domoticz/adapters/EventsAdapter.java index d8c68a526..81c77b9c0 100644 --- a/app/src/main/java/nl/hnogames/domoticz/adapters/EventsAdapter.java +++ b/app/src/main/java/nl/hnogames/domoticz/adapters/EventsAdapter.java @@ -120,7 +120,7 @@ public void onClick(View v) { } } - Picasso.get().load(R.drawable.power).into(holder.iconRow); + Picasso.get().load(nl.hnogames.domoticzapi.R.drawable.power).into(holder.iconRow); } } diff --git a/app/src/main/java/nl/hnogames/domoticz/adapters/LogAdapter.java b/app/src/main/java/nl/hnogames/domoticz/adapters/LogAdapter.java index 040a23281..13d2b24cc 100644 --- a/app/src/main/java/nl/hnogames/domoticz/adapters/LogAdapter.java +++ b/app/src/main/java/nl/hnogames/domoticz/adapters/LogAdapter.java @@ -109,11 +109,11 @@ public void onBindViewHolder(final DataObjectHolder holder, int position) { holder.message.setText(message); if (mLogInfo.getLevel() == 4) - Picasso.get().load(R.drawable.power).into(holder.iconRow); + Picasso.get().load(nl.hnogames.domoticzapi.R.drawable.power).into(holder.iconRow); else if (mLogInfo.getLevel() == 2) - Picasso.get().load(R.drawable.power).into(holder.iconRow); + Picasso.get().load(nl.hnogames.domoticzapi.R.drawable.power).into(holder.iconRow); else - Picasso.get().load(R.drawable.power).into(holder.iconRow); + Picasso.get().load(nl.hnogames.domoticzapi.R.drawable.power).into(holder.iconRow); } } diff --git a/app/src/main/java/nl/hnogames/domoticz/adapters/UserVariablesAdapter.java b/app/src/main/java/nl/hnogames/domoticz/adapters/UserVariablesAdapter.java index 1c98f5a64..4320411eb 100644 --- a/app/src/main/java/nl/hnogames/domoticz/adapters/UserVariablesAdapter.java +++ b/app/src/main/java/nl/hnogames/domoticz/adapters/UserVariablesAdapter.java @@ -107,7 +107,7 @@ public void onClick(View view) { } }); - Picasso.get().load(R.drawable.power).into(holder.iconRow); + Picasso.get().load(nl.hnogames.domoticzapi.R.drawable.power).into(holder.iconRow); } } diff --git a/app/src/main/java/nl/hnogames/domoticz/adapters/WidgetsAdapter.java b/app/src/main/java/nl/hnogames/domoticz/adapters/WidgetsAdapter.java index 413d87624..0a08131f2 100644 --- a/app/src/main/java/nl/hnogames/domoticz/adapters/WidgetsAdapter.java +++ b/app/src/main/java/nl/hnogames/domoticz/adapters/WidgetsAdapter.java @@ -149,9 +149,9 @@ private void setDefaultRowData(DevicesInfo mDeviceInfo, } if (mDeviceInfo.getIdx() == iVoiceAction) { - Picasso.get().load(R.drawable.mic).into(holder.iconRow); + Picasso.get().load(nl.hnogames.domoticzapi.R.drawable.mic).into(holder.iconRow); } else if (mDeviceInfo.getIdx() == iQRCodeAction) { - Picasso.get().load(R.drawable.qrcode).into(holder.iconRow); + Picasso.get().load(nl.hnogames.domoticzapi.R.drawable.qrcode).into(holder.iconRow); } else { Picasso.get().load(DomoticzIcons.getDrawableIcon(mDeviceInfo.getTypeImg(), mDeviceInfo.getType(), diff --git a/app/src/main/java/nl/hnogames/domoticz/fragments/Graph.java b/app/src/main/java/nl/hnogames/domoticz/fragments/Graph.java index e34ce61bf..2f97ef8b7 100644 --- a/app/src/main/java/nl/hnogames/domoticz/fragments/Graph.java +++ b/app/src/main/java/nl/hnogames/domoticz/fragments/Graph.java @@ -484,16 +484,16 @@ private LineData generateData(View view) { if (addTemperatureRange) { dataSet = new LineDataSet(valuestMax, "Max"); // add entries to dataset dataSet.setLineWidth(2); - dataSet.setColor(ContextCompat.getColor(context, R.color.md_blue_50)); + dataSet.setColor(ContextCompat.getColor(context, com.mikepenz.materialize.R.color.md_blue_50)); dataSet.setDrawCircles(false); dataSet.setMode(LineDataSet.Mode.LINEAR); dataSet.setDrawFilled(true); - dataSet.setFillColor(R.color.md_blue_300); + dataSet.setFillColor(com.mikepenz.materialize.R.color.md_blue_300); entries.add(dataSet); dataSet = new LineDataSet(valuestMin, "Min"); // add entries to dataset dataSet.setLineWidth(2); - dataSet.setColor(ContextCompat.getColor(context, R.color.md_blue_50)); + dataSet.setColor(ContextCompat.getColor(context, com.mikepenz.materialize.R.color.md_blue_50)); dataSet.setDrawCircles(false); dataSet.setMode(LineDataSet.Mode.LINEAR); dataSet.setFillAlpha(255); @@ -564,16 +564,16 @@ private LineData generateData(View view) { if (addPercentageRange) { dataSet = new LineDataSet(valuesvMax, "Max"); // add entries to dataset dataSet.setLineWidth(2); - dataSet.setColor(ContextCompat.getColor(context, R.color.md_blue_50)); + dataSet.setColor(ContextCompat.getColor(context, com.mikepenz.materialize.R.color.md_blue_50)); dataSet.setDrawCircles(false); dataSet.setMode(LineDataSet.Mode.LINEAR); dataSet.setDrawFilled(true); - dataSet.setFillColor(R.color.md_blue_300); + dataSet.setFillColor(com.mikepenz.materialize.R.color.md_blue_300); entries.add(dataSet); dataSet = new LineDataSet(valuesvMin, "Min"); // add entries to dataset dataSet.setLineWidth(2); - dataSet.setColor(ContextCompat.getColor(context, R.color.md_blue_50)); + dataSet.setColor(ContextCompat.getColor(context, com.mikepenz.materialize.R.color.md_blue_50)); dataSet.setDrawCircles(false); dataSet.setMode(LineDataSet.Mode.LINEAR); dataSet.setFillAlpha(255); @@ -666,7 +666,7 @@ private LineData generateData(View view) { if ((addCO2Max && !enableFilters) || (filterLabels != null && filterLabels.contains(((TextView) view.findViewById(R.id.legend_co2max)).getText().toString()))) { LineDataSet dataSet = new LineDataSet(valuesco2max, ((TextView) view.findViewById(R.id.legend_co2max)).getText().toString()); // add entries to dataset - dataSet.setColor(ContextCompat.getColor(context, R.color.md_red_400)); + dataSet.setColor(ContextCompat.getColor(context, com.mikepenz.materialize.R.color.md_red_400)); dataSet.setLineWidth(2); dataSet.setDrawCircles(false); dataSet.setMode(LineDataSet.Mode.LINEAR); @@ -696,7 +696,7 @@ private LineData generateData(View view) { if ((addLuxMax && !enableFilters) || (filterLabels != null && filterLabels.contains(((TextView) view.findViewById(R.id.legend_Luxmax)).getText().toString()))) { LineDataSet dataSet = new LineDataSet(valuesLuxmax, ((TextView) view.findViewById(R.id.legend_Luxmax)).getText().toString()); // add entries to dataset - dataSet.setColor(ContextCompat.getColor(context, R.color.md_red_400)); + dataSet.setColor(ContextCompat.getColor(context, com.mikepenz.materialize.R.color.md_red_400)); dataSet.setLineWidth(2); dataSet.setDrawCircles(false); dataSet.setMode(LineDataSet.Mode.LINEAR); @@ -706,7 +706,7 @@ private LineData generateData(View view) { if ((addLuxAvg && !enableFilters) || (filterLabels != null && filterLabels.contains(((TextView) view.findViewById(R.id.legend_LuxAvg)).getText().toString()))) { LineDataSet dataSet = new LineDataSet(valuesLuxAvg, ((TextView) view.findViewById(R.id.legend_LuxAvg)).getText().toString()); // add entries to dataset - dataSet.setColor(ContextCompat.getColor(context, R.color.md_yellow_400)); + dataSet.setColor(ContextCompat.getColor(context, com.mikepenz.materialize.R.color.md_yellow_400)); dataSet.setLineWidth(2); dataSet.setDrawCircles(false); dataSet.setMode(LineDataSet.Mode.LINEAR); diff --git a/app/src/main/java/nl/hnogames/domoticz/fragments/Wizard.java b/app/src/main/java/nl/hnogames/domoticz/fragments/Wizard.java index 7ef229887..73bbb03ab 100644 --- a/app/src/main/java/nl/hnogames/domoticz/fragments/Wizard.java +++ b/app/src/main/java/nl/hnogames/domoticz/fragments/Wizard.java @@ -161,7 +161,7 @@ private List generateCards(List cardsToGenerate) { theme.resolveAttribute(R.attr.wizardCardColor, cardValue, true); theme.resolveAttribute(R.attr.wizardTitleColor, titleValue, true); - int blueColor = ContextCompat.getColor(context, R.color.blue_600); + int blueColor = ContextCompat.getColor(context, com.ftinc.scoop.R.color.blue_600); int otherColor = cardValue.data; int titleColor = titleValue.data; @@ -172,14 +172,14 @@ private List generateCards(List cardsToGenerate) { .setTag(WELCOME) .setDismissible() .withProvider(new CardProvider()) - .setLayout(R.layout.material_welcome_card_layout) + .setLayout(com.dexafree.materialList.R.layout.material_welcome_card_layout) .setTitle(context.getString(R.string.wizard_welcome)) .setTitleColor(Color.WHITE) .setDescription(context.getString(R.string.wizard_welcome_description)) .setDescriptionColor(Color.WHITE) .setSubtitleColor(Color.WHITE) .setBackgroundColor(blueColor) - .addAction(R.id.ok_button, new WelcomeButtonAction(context) + .addAction(com.dexafree.materialList.R.id.ok_button, new WelcomeButtonAction(context) .setText(context.getString(R.string.wizard_button_nice)) .setTextColor(Color.WHITE) .setListener(new OnActionClickListener() { @@ -195,21 +195,21 @@ public void onActionClicked(View view, Card card) { .setTag(FAVORITE) .setDismissible() .withProvider(new CardProvider()) - .setLayout(R.layout.material_basic_buttons_card) + .setLayout(com.dexafree.materialList.R.layout.material_basic_buttons_card) .setBackgroundColor(otherColor) .setTitle(context.getString(R.string.wizard_favorites)) .setTitleColor(titleColor) .setDescription(context.getString(R.string.wizard_favorites_description)) - .addAction(R.id.left_text_button, new TextViewAction(context) + .addAction(com.dexafree.materialList.R.id.left_text_button, new TextViewAction(context) .setText(context.getString(R.string.wizard_button_switches)) - .setTextColor(ContextCompat.getColor(context, R.color.blue_600)) + .setTextColor(ContextCompat.getColor(context, com.ftinc.scoop.R.color.blue_600)) .setListener(new OnActionClickListener() { @Override public void onActionClicked(View view, Card card) { ((MainActivity) getActivity()).changeFragment("nl.hnogames.domoticz.Fragments.Switches", true); } })) - .addAction(R.id.right_text_button, new TextViewAction(context) + .addAction(com.dexafree.materialList.R.id.right_text_button, new TextViewAction(context) .setText(context.getString(R.string.wizard_button_done)) .setTextColor(ContextCompat.getColor(context, R.color.material_orange_600)) .setListener(new OnActionClickListener() { @@ -226,21 +226,21 @@ public void onActionClicked(View view, Card card) { .setTag(STARTUP) .setDismissible() .withProvider(new CardProvider()) - .setLayout(R.layout.material_basic_buttons_card) + .setLayout(com.dexafree.materialList.R.layout.material_basic_buttons_card) .setTitle(context.getString(R.string.wizard_startup)) .setTitleColor(titleColor) .setBackgroundColor(otherColor) .setDescription(context.getString(R.string.wizard_startup_description)) - .addAction(R.id.left_text_button, new TextViewAction(context) + .addAction(com.dexafree.materialList.R.id.left_text_button, new TextViewAction(context) .setText(context.getString(R.string.wizard_button_settings)) - .setTextColor(ContextCompat.getColor(context, R.color.blue_600)) + .setTextColor(ContextCompat.getColor(context, com.ftinc.scoop.R.color.blue_600)) .setListener(new OnActionClickListener() { @Override public void onActionClicked(View view, Card card) { startActivityForResult(new Intent(context, SettingsActivity.class), iSettingsResultCode); } })) - .addAction(R.id.right_text_button, new TextViewAction(context) + .addAction(com.dexafree.materialList.R.id.right_text_button, new TextViewAction(context) .setText(context.getString(R.string.wizard_button_done)) .setTextColor(ContextCompat.getColor(context, R.color.material_orange_600)) .setListener(new OnActionClickListener() { @@ -257,21 +257,21 @@ public void onActionClicked(View view, Card card) { .setTag(GEOFENCE) .setDismissible() .withProvider(new CardProvider()) - .setLayout(R.layout.material_basic_buttons_card) + .setLayout(com.dexafree.materialList.R.layout.material_basic_buttons_card) .setTitle(context.getString(R.string.wizard_geo)) .setTitleColor(titleColor) .setBackgroundColor(otherColor) .setDescription(context.getString(R.string.wizard_geo_description)) - .addAction(R.id.left_text_button, new TextViewAction(context) + .addAction(com.dexafree.materialList.R.id.left_text_button, new TextViewAction(context) .setText(context.getString(R.string.wizard_button_settings)) - .setTextColor(ContextCompat.getColor(context, R.color.blue_600)) + .setTextColor(ContextCompat.getColor(context, com.ftinc.scoop.R.color.blue_600)) .setListener(new OnActionClickListener() { @Override public void onActionClicked(View view, Card card) { startActivityForResult(new Intent(context, SettingsActivity.class), iSettingsResultCode); } })) - .addAction(R.id.right_text_button, new TextViewAction(context) + .addAction(com.dexafree.materialList.R.id.right_text_button, new TextViewAction(context) .setText(context.getString(R.string.wizard_button_done)) .setTextColor(ContextCompat.getColor(context, R.color.material_orange_600)) .setListener(new OnActionClickListener() { @@ -288,21 +288,21 @@ public void onActionClicked(View view, Card card) { .setTag(NFC) .setDismissible() .withProvider(new CardProvider()) - .setLayout(R.layout.material_basic_buttons_card) + .setLayout(com.dexafree.materialList.R.layout.material_basic_buttons_card) .setTitle(context.getString(R.string.wizard_nfc)) .setTitleColor(titleColor) .setBackgroundColor(otherColor) .setDescription(context.getString(R.string.wizard_nfc_description)) - .addAction(R.id.left_text_button, new TextViewAction(context) + .addAction(com.dexafree.materialList.R.id.left_text_button, new TextViewAction(context) .setText(context.getString(R.string.wizard_button_settings)) - .setTextColor(ContextCompat.getColor(context, R.color.blue_600)) + .setTextColor(ContextCompat.getColor(context, com.ftinc.scoop.R.color.blue_600)) .setListener(new OnActionClickListener() { @Override public void onActionClicked(View view, Card card) { startActivityForResult(new Intent(context, SettingsActivity.class), iSettingsResultCode); } })) - .addAction(R.id.right_text_button, new TextViewAction(context) + .addAction(com.dexafree.materialList.R.id.right_text_button, new TextViewAction(context) .setText(context.getString(R.string.wizard_button_done)) .setTextColor(ContextCompat.getColor(context, R.color.material_orange_600)) .setListener(new OnActionClickListener() { @@ -319,20 +319,20 @@ public void onActionClicked(View view, Card card) { .setTag(QRCODE) .setDismissible() .withProvider(new CardProvider()) - .setLayout(R.layout.material_basic_buttons_card) + .setLayout(com.dexafree.materialList.R.layout.material_basic_buttons_card) .setTitle(context.getString(R.string.wizard_qrcode)) .setBackgroundColor(otherColor) .setDescription(context.getString(R.string.wizard_qrcode_description)) - .addAction(R.id.left_text_button, new TextViewAction(context) + .addAction(com.dexafree.materialList.R.id.left_text_button, new TextViewAction(context) .setText(context.getString(R.string.wizard_button_settings)) - .setTextColor(ContextCompat.getColor(context, R.color.blue_600)) + .setTextColor(ContextCompat.getColor(context, com.ftinc.scoop.R.color.blue_600)) .setListener(new OnActionClickListener() { @Override public void onActionClicked(View view, Card card) { startActivityForResult(new Intent(context, SettingsActivity.class), iSettingsResultCode); } })) - .addAction(R.id.right_text_button, new TextViewAction(context) + .addAction(com.dexafree.materialList.R.id.right_text_button, new TextViewAction(context) .setText(context.getString(R.string.wizard_button_done)) .setTextColor(ContextCompat.getColor(context, R.color.material_orange_600)) .setListener(new OnActionClickListener() { @@ -349,21 +349,21 @@ public void onActionClicked(View view, Card card) { .setTag(BLUETOOTH) .setDismissible() .withProvider(new CardProvider()) - .setLayout(R.layout.material_basic_buttons_card) + .setLayout(com.dexafree.materialList.R.layout.material_basic_buttons_card) .setTitle(context.getString(R.string.bluetooth)) .setTitleColor(titleColor) .setBackgroundColor(otherColor) .setDescription(context.getString(R.string.wizard_bluetooth_description)) - .addAction(R.id.left_text_button, new TextViewAction(context) + .addAction(com.dexafree.materialList.R.id.left_text_button, new TextViewAction(context) .setText(context.getString(R.string.wizard_button_settings)) - .setTextColor(ContextCompat.getColor(context, R.color.blue_600)) + .setTextColor(ContextCompat.getColor(context, com.ftinc.scoop.R.color.blue_600)) .setListener(new OnActionClickListener() { @Override public void onActionClicked(View view, Card card) { startActivityForResult(new Intent(context, SettingsActivity.class), iSettingsResultCode); } })) - .addAction(R.id.right_text_button, new TextViewAction(context) + .addAction(com.dexafree.materialList.R.id.right_text_button, new TextViewAction(context) .setText(context.getString(R.string.wizard_button_done)) .setTextColor(ContextCompat.getColor(context, R.color.material_orange_600)) .setListener(new OnActionClickListener() { @@ -380,20 +380,20 @@ public void onActionClicked(View view, Card card) { .setTag(SPEECH) .setDismissible() .withProvider(new CardProvider()) - .setLayout(R.layout.material_basic_buttons_card) + .setLayout(com.dexafree.materialList.R.layout.material_basic_buttons_card) .setTitle(context.getString(R.string.wizard_speech)) .setBackgroundColor(otherColor) .setDescription(context.getString(R.string.wizard_speech_description)) - .addAction(R.id.left_text_button, new TextViewAction(context) + .addAction(com.dexafree.materialList.R.id.left_text_button, new TextViewAction(context) .setText(context.getString(R.string.wizard_button_settings)) - .setTextColor(ContextCompat.getColor(context, R.color.blue_600)) + .setTextColor(ContextCompat.getColor(context, com.ftinc.scoop.R.color.blue_600)) .setListener(new OnActionClickListener() { @Override public void onActionClicked(View view, Card card) { startActivityForResult(new Intent(context, SettingsActivity.class), iSettingsResultCode); } })) - .addAction(R.id.right_text_button, new TextViewAction(context) + .addAction(com.dexafree.materialList.R.id.right_text_button, new TextViewAction(context) .setText(context.getString(R.string.wizard_button_done)) .setTextColor(ContextCompat.getColor(context, R.color.material_orange_600)) .setListener(new OnActionClickListener() { @@ -410,20 +410,20 @@ public void onActionClicked(View view, Card card) { .setTag(BEACON) .setDismissible() .withProvider(new CardProvider()) - .setLayout(R.layout.material_basic_buttons_card) + .setLayout(com.dexafree.materialList.R.layout.material_basic_buttons_card) .setTitle(context.getString(R.string.beacon)) .setBackgroundColor(otherColor) .setDescription(context.getString(R.string.wizard_beacon_description)) - .addAction(R.id.left_text_button, new TextViewAction(context) + .addAction(com.dexafree.materialList.R.id.left_text_button, new TextViewAction(context) .setText(context.getString(R.string.wizard_button_settings)) - .setTextColor(ContextCompat.getColor(context, R.color.blue_600)) + .setTextColor(ContextCompat.getColor(context, com.ftinc.scoop.R.color.blue_600)) .setListener(new OnActionClickListener() { @Override public void onActionClicked(View view, Card card) { startActivityForResult(new Intent(context, SettingsActivity.class), iSettingsResultCode); } })) - .addAction(R.id.right_text_button, new TextViewAction(context) + .addAction(com.dexafree.materialList.R.id.right_text_button, new TextViewAction(context) .setText(context.getString(R.string.wizard_button_done)) .setTextColor(ContextCompat.getColor(context, R.color.material_orange_600)) .setListener(new OnActionClickListener() { @@ -441,21 +441,21 @@ public void onActionClicked(View view, Card card) { .setDismissible() .withProvider(new CardProvider()) .setTitleColor(titleColor) - .setLayout(R.layout.material_basic_buttons_card) + .setLayout(com.dexafree.materialList.R.layout.material_basic_buttons_card) .setTitle(context.getString(R.string.wizard_wear)) .setTitleColor(titleColor) .setBackgroundColor(otherColor) .setDescription(context.getString(R.string.wizard_wear_description)) - .addAction(R.id.left_text_button, new TextViewAction(context) + .addAction(com.dexafree.materialList.R.id.left_text_button, new TextViewAction(context) .setText(context.getString(R.string.wizard_button_settings)) - .setTextColor(ContextCompat.getColor(context, R.color.blue_600)) + .setTextColor(ContextCompat.getColor(context, com.ftinc.scoop.R.color.blue_600)) .setListener(new OnActionClickListener() { @Override public void onActionClicked(View view, Card card) { startActivityForResult(new Intent(context, SettingsActivity.class), iSettingsResultCode); } })) - .addAction(R.id.right_text_button, new TextViewAction(context) + .addAction(com.dexafree.materialList.R.id.right_text_button, new TextViewAction(context) .setText(context.getString(R.string.wizard_button_done)) .setTextColor(ContextCompat.getColor(context, R.color.material_orange_600)) .setListener(new OnActionClickListener() { @@ -472,21 +472,21 @@ public void onActionClicked(View view, Card card) { .setTag(AUTO) .setDismissible() .withProvider(new CardProvider()) - .setLayout(R.layout.material_basic_buttons_card) + .setLayout(com.dexafree.materialList.R.layout.material_basic_buttons_card) .setBackgroundColor(otherColor) .setTitle(context.getString(R.string.wizard_auto)) .setTitleColor(titleColor) .setDescription(context.getString(R.string.wizard_auto_description)) - .addAction(R.id.left_text_button, new TextViewAction(context) + .addAction(com.dexafree.materialList.R.id.left_text_button, new TextViewAction(context) .setText(context.getString(R.string.wizard_button_settings)) - .setTextColor(ContextCompat.getColor(context, R.color.blue_600)) + .setTextColor(ContextCompat.getColor(context, com.ftinc.scoop.R.color.blue_600)) .setListener(new OnActionClickListener() { @Override public void onActionClicked(View view, Card card) { startActivityForResult(new Intent(context, SettingsActivity.class), iSettingsResultCode); } })) - .addAction(R.id.right_text_button, new TextViewAction(context) + .addAction(com.dexafree.materialList.R.id.right_text_button, new TextViewAction(context) .setText(context.getString(R.string.wizard_button_done)) .setTextColor(ContextCompat.getColor(context, R.color.material_orange_600)) .setListener(new OnActionClickListener() { @@ -503,14 +503,14 @@ public void onActionClicked(View view, Card card) { .setTag(LANGUAGE) .setDismissible() .withProvider(new CardProvider()) - .setLayout(R.layout.material_basic_buttons_card) + .setLayout(com.dexafree.materialList.R.layout.material_basic_buttons_card) .setBackgroundColor(otherColor) .setTitle(context.getString(R.string.category_help)) .setTitleColor(titleColor) .setDescription(context.getString(R.string.translate_description)) - .addAction(R.id.left_text_button, new TextViewAction(context) + .addAction(com.dexafree.materialList.R.id.left_text_button, new TextViewAction(context) .setText(context.getString(R.string.ok)) - .setTextColor(ContextCompat.getColor(context, R.color.blue_600)) + .setTextColor(ContextCompat.getColor(context, com.ftinc.scoop.R.color.blue_600)) .setListener(new OnActionClickListener() { @Override public void onActionClicked(View view, Card card) { @@ -519,7 +519,7 @@ public void onActionClicked(View view, Card card) { startActivity(i); } })) - .addAction(R.id.right_text_button, new TextViewAction(context) + .addAction(com.dexafree.materialList.R.id.right_text_button, new TextViewAction(context) .setText(context.getString(R.string.wizard_button_done)) .setTextColor(ContextCompat.getColor(context, R.color.material_orange_600)) .setListener(new OnActionClickListener() { @@ -536,21 +536,21 @@ public void onActionClicked(View view, Card card) { .setTag(NOTIFICATIONS) .setDismissible() .withProvider(new CardProvider()) - .setLayout(R.layout.material_basic_buttons_card) + .setLayout(com.dexafree.materialList.R.layout.material_basic_buttons_card) .setTitle(context.getString(R.string.wizard_notifications)) .setTitleColor(titleColor) .setBackgroundColor(otherColor) .setDescription(context.getString(R.string.wizard_notifications_description)) - .addAction(R.id.left_text_button, new TextViewAction(context) + .addAction(com.dexafree.materialList.R.id.left_text_button, new TextViewAction(context) .setText(context.getString(R.string.wizard_button_settings)) - .setTextColor(ContextCompat.getColor(context, R.color.blue_600)) + .setTextColor(ContextCompat.getColor(context, com.ftinc.scoop.R.color.blue_600)) .setListener(new OnActionClickListener() { @Override public void onActionClicked(View view, Card card) { startActivityForResult(new Intent(context, SettingsActivity.class), iSettingsResultCode); } })) - .addAction(R.id.right_text_button, new TextViewAction(context) + .addAction(com.dexafree.materialList.R.id.right_text_button, new TextViewAction(context) .setText(context.getString(R.string.wizard_button_done)) .setTextColor(ContextCompat.getColor(context, R.color.material_orange_600)) .setListener(new OnActionClickListener() { @@ -567,21 +567,21 @@ public void onActionClicked(View view, Card card) { .setTag(MULTISERVER) .setDismissible() .withProvider(new CardProvider()) - .setLayout(R.layout.material_basic_buttons_card) + .setLayout(com.dexafree.materialList.R.layout.material_basic_buttons_card) .setTitle(context.getString(R.string.wizard_multiserver)) .setTitleColor(titleColor) .setBackgroundColor(otherColor) .setDescription(context.getString(R.string.wizard_multiserver_description)) - .addAction(R.id.left_text_button, new TextViewAction(context) + .addAction(com.dexafree.materialList.R.id.left_text_button, new TextViewAction(context) .setText(context.getString(R.string.wizard_button_settings)) - .setTextColor(ContextCompat.getColor(context, R.color.md_material_blue_600)) + .setTextColor(ContextCompat.getColor(context, com.afollestad.materialdialogs.R.color.md_material_blue_600)) .setListener(new OnActionClickListener() { @Override public void onActionClicked(View view, Card card) { startActivityForResult(new Intent(context, SettingsActivity.class), iSettingsResultCode); } })) - .addAction(R.id.right_text_button, new TextViewAction(context) + .addAction(com.dexafree.materialList.R.id.right_text_button, new TextViewAction(context) .setText(context.getString(R.string.wizard_button_done)) .setTextColor(ContextCompat.getColor(context, R.color.material_orange_600)) .setListener(new OnActionClickListener() { @@ -598,21 +598,21 @@ public void onActionClicked(View view, Card card) { .setTag(GRAPH) .setDismissible() .withProvider(new CardProvider()) - .setLayout(R.layout.material_basic_buttons_card) + .setLayout(com.dexafree.materialList.R.layout.material_basic_buttons_card) .setTitle(context.getString(R.string.wizard_graph)) .setTitleColor(titleColor) .setBackgroundColor(otherColor) .setDescription(context.getString(R.string.wizard_graph_description)) - .addAction(R.id.left_text_button, new TextViewAction(context) + .addAction(com.dexafree.materialList.R.id.left_text_button, new TextViewAction(context) .setText(context.getString(R.string.wizard_button_utilities)) - .setTextColor(ContextCompat.getColor(context, R.color.md_material_blue_600)) + .setTextColor(ContextCompat.getColor(context, com.afollestad.materialdialogs.R.color.md_material_blue_600)) .setListener(new OnActionClickListener() { @Override public void onActionClicked(View view, Card card) { ((MainActivity) getActivity()).changeFragment("nl.hnogames.domoticz.Fragments.Utilities", true); } })) - .addAction(R.id.right_text_button, new TextViewAction(context) + .addAction(com.dexafree.materialList.R.id.right_text_button, new TextViewAction(context) .setText(context.getString(R.string.wizard_button_done)) .setTextColor(ContextCompat.getColor(context, R.color.material_orange_600)) .setListener(new OnActionClickListener() { @@ -629,21 +629,21 @@ public void onActionClicked(View view, Card card) { .setTag(FILTER) .setDismissible() .withProvider(new CardProvider()) - .setLayout(R.layout.material_basic_buttons_card) + .setLayout(com.dexafree.materialList.R.layout.material_basic_buttons_card) .setTitle(context.getString(R.string.wizard_filter)) .setTitleColor(titleColor) .setBackgroundColor(otherColor) .setDescription(context.getString(R.string.wizard_filter_description)) - .addAction(R.id.left_text_button, new TextViewAction(context) + .addAction(com.dexafree.materialList.R.id.left_text_button, new TextViewAction(context) .setText(context.getString(R.string.wizard_button_nice)) - .setTextColor(ContextCompat.getColor(context, R.color.md_material_blue_600)) + .setTextColor(ContextCompat.getColor(context, com.afollestad.materialdialogs.R.color.md_material_blue_600)) .setListener(new OnActionClickListener() { @Override public void onActionClicked(View view, Card card) { ((MainActivity) getActivity()).changeFragment("nl.hnogames.domoticz.Fragments.Switches", true); } })) - .addAction(R.id.right_text_button, new TextViewAction(context) + .addAction(com.dexafree.materialList.R.id.right_text_button, new TextViewAction(context) .setText(context.getString(R.string.wizard_button_done)) .setTextColor(ContextCompat.getColor(context, R.color.material_orange_600)) .setListener(new OnActionClickListener() { @@ -660,14 +660,14 @@ public void onActionClicked(View view, Card card) { .setTag(TASKER) .setDismissible() .withProvider(new CardProvider()) - .setLayout(R.layout.material_basic_buttons_card) + .setLayout(com.dexafree.materialList.R.layout.material_basic_buttons_card) .setTitle(context.getString(R.string.category_tasker)) .setTitleColor(titleColor) .setBackgroundColor(otherColor) .setDescription(context.getString(R.string.wizard_widgets_tasker)) - .addAction(R.id.left_text_button, new TextViewAction(context) + .addAction(com.dexafree.materialList.R.id.left_text_button, new TextViewAction(context) .setText(context.getString(R.string.ok)) - .setTextColor(ContextCompat.getColor(context, R.color.md_material_blue_600)) + .setTextColor(ContextCompat.getColor(context, com.afollestad.materialdialogs.R.color.md_material_blue_600)) .setListener(new OnActionClickListener() { @Override public void onActionClicked(View view, Card card) { @@ -680,7 +680,7 @@ public void onActionClicked(View view, Card card) { card.dismiss(); } })) - .addAction(R.id.right_text_button, new TextViewAction(context) + .addAction(com.dexafree.materialList.R.id.right_text_button, new TextViewAction(context) .setText(context.getString(R.string.cancel)) .setTextColor(ContextCompat.getColor(context, R.color.material_orange_600)) .setListener(new OnActionClickListener() { @@ -697,14 +697,14 @@ public void onActionClicked(View view, Card card) { .setTag(WIDGETS) .setDismissible() .withProvider(new CardProvider()) - .setLayout(R.layout.material_basic_buttons_card) + .setLayout(com.dexafree.materialList.R.layout.material_basic_buttons_card) .setTitle(context.getString(R.string.wizard_widgets)) .setTitleColor(titleColor) .setBackgroundColor(otherColor) .setDescription(context.getString(R.string.wizard_widgets_description)) - .addAction(R.id.left_text_button, new TextViewAction(context) + .addAction(com.dexafree.materialList.R.id.left_text_button, new TextViewAction(context) .setText("") - .setTextColor(ContextCompat.getColor(context, R.color.md_material_blue_600)) + .setTextColor(ContextCompat.getColor(context, com.afollestad.materialdialogs.R.color.md_material_blue_600)) .setListener(new OnActionClickListener() { @Override public void onActionClicked(View view, Card card) { @@ -712,7 +712,7 @@ public void onActionClicked(View view, Card card) { } })) - .addAction(R.id.right_text_button, new TextViewAction(context) + .addAction(com.dexafree.materialList.R.id.right_text_button, new TextViewAction(context) .setText(context.getString(R.string.wizard_button_done)) .setTextColor(ContextCompat.getColor(context, R.color.material_orange_600)) .setListener(new OnActionClickListener() { @@ -729,14 +729,14 @@ public void onActionClicked(View view, Card card) { .setTag(FINISH) .setDismissible() .withProvider(new CardProvider()) - .setLayout(R.layout.material_basic_buttons_card) + .setLayout(com.dexafree.materialList.R.layout.material_basic_buttons_card) .setTitle(context.getString(R.string.wizard_menuitem)) .setTitleColor(titleColor) .setBackgroundColor(otherColor) .setDescription(context.getString(R.string.wizard_menuitem_description)) - .addAction(R.id.left_text_button, new TextViewAction(context) + .addAction(com.dexafree.materialList.R.id.left_text_button, new TextViewAction(context) .setText(context.getString(R.string.wizard_button_wizard)) - .setTextColor(ContextCompat.getColor(context, R.color.md_material_blue_600)) + .setTextColor(ContextCompat.getColor(context, com.afollestad.materialdialogs.R.color.md_material_blue_600)) .setListener(new OnActionClickListener() { @Override public void onActionClicked(View view, Card card) { @@ -746,7 +746,7 @@ public void onActionClicked(View view, Card card) { ((MainActivity) getActivity()).changeFragment("nl.hnogames.domoticz.Fragments.Dashboard", true); } })) - .addAction(R.id.right_text_button, new TextViewAction(context) + .addAction(com.dexafree.materialList.R.id.right_text_button, new TextViewAction(context) .setText("") .setTextColor(ContextCompat.getColor(context, R.color.material_orange_600)) .setListener(new OnActionClickListener() { diff --git a/app/src/main/java/nl/hnogames/domoticz/ui/ScoopSettingsActivity.java b/app/src/main/java/nl/hnogames/domoticz/ui/ScoopSettingsActivity.java index bd335a5e0..52fee2c4c 100644 --- a/app/src/main/java/nl/hnogames/domoticz/ui/ScoopSettingsActivity.java +++ b/app/src/main/java/nl/hnogames/domoticz/ui/ScoopSettingsActivity.java @@ -117,7 +117,7 @@ public void onClick(View v) { } if (TextUtils.isEmpty(mTitle)) { - getSupportActionBar().setTitle(R.string.activity_settings); + getSupportActionBar().setTitle(com.ftinc.scoop.R.string.activity_settings); } else { getSupportActionBar().setTitle(mTitle); } diff --git a/app/src/main/java/nl/hnogames/domoticz/widgets/WidgetProviderLarge.java b/app/src/main/java/nl/hnogames/domoticz/widgets/WidgetProviderLarge.java index 01a734ffc..c1e70e49f 100644 --- a/app/src/main/java/nl/hnogames/domoticz/widgets/WidgetProviderLarge.java +++ b/app/src/main/java/nl/hnogames/domoticz/widgets/WidgetProviderLarge.java @@ -139,7 +139,7 @@ public void updateAppWidget(final AppWidgetManager appWidgetManager, if (idx == iVoiceAction) { views.setTextViewText(R.id.desc, getApplicationContext().getString(R.string.Speech_desc)); views.setTextViewText(R.id.title, getApplicationContext().getString(R.string.action_speech)); - views.setImageViewResource(R.id.rowIcon, R.drawable.mic); + views.setImageViewResource(R.id.rowIcon, nl.hnogames.domoticzapi.R.drawable.mic); views.setTextViewText(R.id.on_button, "GO"); views.setOnClickPendingIntent(R.id.on_button, buildButtonPendingIntent( UpdateWidgetService.this, @@ -152,7 +152,7 @@ public void updateAppWidget(final AppWidgetManager appWidgetManager, } else if (idx == iQRCodeAction) { views.setTextViewText(R.id.desc, getApplicationContext().getString(R.string.qrcode_desc)); views.setTextViewText(R.id.title, getApplicationContext().getString(R.string.action_qrcode_scan)); - views.setImageViewResource(R.id.rowIcon, R.drawable.qrcode); + views.setImageViewResource(R.id.rowIcon, nl.hnogames.domoticzapi.R.drawable.qrcode); views.setTextViewText(R.id.on_button, "GO"); views.setOnClickPendingIntent(R.id.on_button, buildButtonPendingIntent( UpdateWidgetService.this, diff --git a/app/src/main/java/nl/hnogames/domoticz/widgets/WidgetProviderSmall.java b/app/src/main/java/nl/hnogames/domoticz/widgets/WidgetProviderSmall.java index 5db69de8b..64a126bf6 100644 --- a/app/src/main/java/nl/hnogames/domoticz/widgets/WidgetProviderSmall.java +++ b/app/src/main/java/nl/hnogames/domoticz/widgets/WidgetProviderSmall.java @@ -148,7 +148,7 @@ public void updateAppWidget(final AppWidgetManager appWidgetManager, if (idx == iVoiceAction) { views.setTextViewText(R.id.desc, getApplicationContext().getString(R.string.Speech_desc)); views.setTextViewText(R.id.title, getApplicationContext().getString(R.string.action_speech)); - views.setImageViewResource(R.id.rowIcon, R.drawable.mic); + views.setImageViewResource(R.id.rowIcon, nl.hnogames.domoticzapi.R.drawable.mic); views.setOnClickPendingIntent(R.id.rowIcon, buildButtonPendingIntent( UpdateWidgetService.this, appWidgetId, @@ -159,7 +159,7 @@ public void updateAppWidget(final AppWidgetManager appWidgetManager, } else if (idx == iQRCodeAction) { views.setTextViewText(R.id.desc, getApplicationContext().getString(R.string.qrcode_desc)); views.setTextViewText(R.id.title, getApplicationContext().getString(R.string.action_qrcode_scan)); - views.setImageViewResource(R.id.rowIcon, R.drawable.qrcode); + views.setImageViewResource(R.id.rowIcon, nl.hnogames.domoticzapi.R.drawable.qrcode); views.setOnClickPendingIntent(R.id.rowIcon, buildButtonPendingIntent( UpdateWidgetService.this, appWidgetId, diff --git a/app/version.properties b/app/version.properties index 45fbcebfa..af1e97caf 100644 --- a/app/version.properties +++ b/app/version.properties @@ -1,4 +1,4 @@ -#Sun Feb 11 13:43:19 CET 2024 -VERSION_BUILD=9442 +#Tue Feb 13 14:43:51 CET 2024 +VERSION_BUILD=9453 VERSION_CODE=687 VERSION_PATCH=370 diff --git a/domoticzapi/src/main/java/nl/hnogames/domoticzapi/Containers/ExtendedStatusInfo.java b/domoticzapi/src/main/java/nl/hnogames/domoticzapi/Containers/ExtendedStatusInfo.java index 3eff7569f..0095f36d6 100644 --- a/domoticzapi/src/main/java/nl/hnogames/domoticzapi/Containers/ExtendedStatusInfo.java +++ b/domoticzapi/src/main/java/nl/hnogames/domoticzapi/Containers/ExtendedStatusInfo.java @@ -32,8 +32,8 @@ public class ExtendedStatusInfo { private final String UNKNOWN = "Unknown"; private final String TAG = ExtendedStatusInfo.class.getSimpleName(); - private boolean useCustomImage; private final JSONObject jsonObject; + private boolean useCustomImage; private String name; private String hardwareName; private boolean isProtected; diff --git a/domoticzapi/src/main/java/nl/hnogames/domoticzapi/Containers/GraphPointInfo.java b/domoticzapi/src/main/java/nl/hnogames/domoticzapi/Containers/GraphPointInfo.java index edeb766c0..8b824dade 100644 --- a/domoticzapi/src/main/java/nl/hnogames/domoticzapi/Containers/GraphPointInfo.java +++ b/domoticzapi/src/main/java/nl/hnogames/domoticzapi/Containers/GraphPointInfo.java @@ -30,9 +30,9 @@ @SuppressWarnings("unused") public class GraphPointInfo { + private final JSONObject jsonObject; boolean hasTemperatureRange = false; boolean hasPercentageRange = false; - private final JSONObject jsonObject; private String dateTime; private String hu; private String ba; diff --git a/domoticzapi/src/main/java/nl/hnogames/domoticzapi/Containers/ServerInfo.java b/domoticzapi/src/main/java/nl/hnogames/domoticzapi/Containers/ServerInfo.java index ab4380bb0..63709549c 100644 --- a/domoticzapi/src/main/java/nl/hnogames/domoticzapi/Containers/ServerInfo.java +++ b/domoticzapi/src/main/java/nl/hnogames/domoticzapi/Containers/ServerInfo.java @@ -82,8 +82,6 @@ public class ServerInfo { private boolean LOCAL_SERVER_AUTHENTICATION_METHOD = false; @Expose private Set LOCAL_SERVER_SSID; - @Expose - private boolean DETECTV2URLS = false; /* Saved in a separate file because GSON can't serialize this */ private ServerUpdateInfo serverUpdateInfo; @@ -171,14 +169,6 @@ public void setRemoteServerSecure(boolean remoteServerSecure) { REMOTE_SERVER_SECURE = remoteServerSecure; } - public boolean getIsV2ApiDetected() { - return DETECTV2URLS; - } - - public void setIsV2ApiDetected(boolean detected) { - DETECTV2URLS = detected; - } - public String getRemoteServerAuthenticationMethod() { String method; if (REMOTE_SERVER_AUTHENTICATION_METHOD) diff --git a/domoticzapi/src/main/java/nl/hnogames/domoticzapi/Domoticz.java b/domoticzapi/src/main/java/nl/hnogames/domoticzapi/Domoticz.java index af168038a..cebf2732c 100644 --- a/domoticzapi/src/main/java/nl/hnogames/domoticzapi/Domoticz.java +++ b/domoticzapi/src/main/java/nl/hnogames/domoticzapi/Domoticz.java @@ -22,7 +22,6 @@ package nl.hnogames.domoticzapi; import android.content.Context; -import android.icu.text.SimpleDateFormat; import android.os.Build; import android.util.Log; @@ -35,9 +34,7 @@ import org.json.JSONObject; import java.net.URLEncoder; -import java.text.ParseException; import java.util.ArrayList; -import java.util.Date; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -49,7 +46,6 @@ import nl.hnogames.domoticzapi.Containers.SceneInfo; import nl.hnogames.domoticzapi.Containers.ServerInfo; import nl.hnogames.domoticzapi.Containers.UserVariableInfo; -import nl.hnogames.domoticzapi.Containers.VersionInfo; import nl.hnogames.domoticzapi.Interfaces.CameraReceiver; import nl.hnogames.domoticzapi.Interfaces.ConfigReceiver; import nl.hnogames.domoticzapi.Interfaces.DevicesReceiver; @@ -126,14 +122,13 @@ public class Domoticz { public static final int DOMOTICZ_FAKE_ID = 99999; public static final String HIDDEN_CHARACTER = "$"; private static final String TAG = "DomoticzAPI"; + public static boolean BasicAuthDetected = false; private final SessionUtil mSessionUtil; private final DomoticzUrls mDomoticzUrls; private final RequestQueue queue; private ServerUtil mServerUtil; private PhoneConnectionUtil mPhoneConnectionUtil; private Context mContext; - public static boolean BasicAuthDetected = false; - public static boolean V2ApiDetected = false; public Domoticz(Context mContext, RequestQueue queue) { this.mContext = mContext; @@ -141,10 +136,10 @@ public Domoticz(Context mContext, RequestQueue queue) { this.mSessionUtil = new SessionUtil(mContext); this.mServerUtil = new ServerUtil(mContext); this.mDomoticzUrls = new DomoticzUrls(this); - V2ApiDetected = getServerUtil().getActiveServer().getIsV2ApiDetected(); if (!getServerUtil().getActiveServer().getUseOnlyLocal()) { - mPhoneConnectionUtil = new PhoneConnectionUtil(mContext, entries -> {}); + mPhoneConnectionUtil = new PhoneConnectionUtil(mContext, entries -> { + }); } } @@ -354,7 +349,7 @@ public String getUserCredentials(String credential) { */ public void getUserAuthenticationRights(LoginReceiver receiver) { LoginParser parser = new LoginParser(receiver); - String url = mDomoticzUrls.constructGetUrl(DomoticzValues.Json.Url.Request.AUTH, V2ApiDetected); + String url = mDomoticzUrls.constructGetUrl(DomoticzValues.Json.Url.Request.AUTH); GetRequest(parser, url, true); } @@ -373,20 +368,20 @@ public void setUserCredentials(String username, String password) { public void AddLog(String message, setCommandReceiver receiver) { setCommandParser parser = new setCommandParser(receiver); - String url = mDomoticzUrls.constructGetUrl(DomoticzValues.Json.Url.Set.LOG, V2ApiDetected); + String url = mDomoticzUrls.constructGetUrl(DomoticzValues.Json.Url.Set.LOG); url = url + message; GetRequest(parser, url, true); } public void GetNotificationSystems(NotificationTypesReceiver receiver) { NotificationTypesParser parser = new NotificationTypesParser(receiver); - String url = mDomoticzUrls.constructGetUrl(DomoticzValues.Json.Url.Request.NOTIFICATIONTYPES, V2ApiDetected); + String url = mDomoticzUrls.constructGetUrl(DomoticzValues.Json.Url.Request.NOTIFICATIONTYPES); GetRequest(parser, url, true); } public void SendNotification(String Subject, String Body, String SubSystem, SendNotificationReceiver receiver) { SendNotificationParser parser = new SendNotificationParser(receiver); - String url = mDomoticzUrls.constructGetUrl(DomoticzValues.Json.Url.Request.SEND_NOTIFICATION, V2ApiDetected); + String url = mDomoticzUrls.constructGetUrl(DomoticzValues.Json.Url.Request.SEND_NOTIFICATION); url += "&subject=" + Subject; url += "&body=" + Body; url += "&subsystem=" + SubSystem; @@ -402,7 +397,7 @@ public void SendNotification(String Subject, String Body, String SubSystem, Send */ public void AddMobileDevice(String DeviceId, String SenderId, MobileDeviceReceiver receiver) { MobileDeviceParser parser = new MobileDeviceParser(receiver); - String url = mDomoticzUrls.constructGetUrl(DomoticzValues.Json.Url.Request.ADD_MOBILE_DEVICE, V2ApiDetected); + String url = mDomoticzUrls.constructGetUrl(DomoticzValues.Json.Url.Request.ADD_MOBILE_DEVICE); url += "&uuid=" + DeviceId; url += "&senderid=" + SenderId; url += "&name=" + Build.MODEL.replace(" ", ""); @@ -418,7 +413,7 @@ public void AddMobileDevice(String DeviceId, String SenderId, MobileDeviceReceiv */ public void CleanMobileDevice(String DeviceId, MobileDeviceReceiver receiver) { MobileDeviceParser parser = new MobileDeviceParser(receiver); - String url = mDomoticzUrls.constructGetUrl(DomoticzValues.Json.Url.Request.CLEAN_MOBILE_DEVICE, V2ApiDetected); + String url = mDomoticzUrls.constructGetUrl(DomoticzValues.Json.Url.Request.CLEAN_MOBILE_DEVICE); url += "&uuid=" + DeviceId; GetRequest(parser, url, true); @@ -431,7 +426,7 @@ public void CleanMobileDevice(String DeviceId, MobileDeviceReceiver receiver) { */ public void getSunRise(SunRiseReceiver receiver) { SunRiseParser parser = new SunRiseParser(receiver); - String url = mDomoticzUrls.constructGetUrl(DomoticzValues.Json.Url.Request.SUNRISE, V2ApiDetected); + String url = mDomoticzUrls.constructGetUrl(DomoticzValues.Json.Url.Request.SUNRISE); GetRequest(parser, url, true); } @@ -442,7 +437,7 @@ public void getSunRise(SunRiseReceiver receiver) { */ public void getServerVersion(VersionReceiver receiver) { VersionParser parser = new VersionParser(receiver); - String url = mDomoticzUrls.constructGetUrl(DomoticzValues.Json.Url.Request.VERSION, V2ApiDetected); + String url = mDomoticzUrls.constructGetUrl(DomoticzValues.Json.Url.Request.VERSION); GetRequest(parser, url, true); } @@ -451,7 +446,7 @@ public String getSnapshotUrl(CameraInfo camera) { } public String getSnapshotUrl(int idx) { - return mDomoticzUrls.constructGetUrl(DomoticzValues.Json.Url.Request.CAMERA, V2ApiDetected) + idx; + return mDomoticzUrls.constructGetUrl(DomoticzValues.Json.Url.Request.CAMERA) + idx; } /** @@ -461,7 +456,7 @@ public String getSnapshotUrl(int idx) { */ public void getUpdate(UpdateVersionReceiver receiver) { UpdateVersionParser parser = new UpdateVersionParser(receiver); - String url = mDomoticzUrls.constructGetUrl(DomoticzValues.Json.Url.Request.UPDATE, V2ApiDetected); + String url = mDomoticzUrls.constructGetUrl(DomoticzValues.Json.Url.Request.UPDATE); GetRequest(parser, url, true); } @@ -472,7 +467,7 @@ public void getUpdate(UpdateVersionReceiver receiver) { */ public void getDownloadUpdate(DownloadUpdateServerReceiver receiver) { DownloadUpdateParser parser = new DownloadUpdateParser(receiver); - String url = mDomoticzUrls.constructGetUrl(DomoticzValues.Json.Url.Request.UPDATE_DOWNLOAD_UPDATE, V2ApiDetected); + String url = mDomoticzUrls.constructGetUrl(DomoticzValues.Json.Url.Request.UPDATE_DOWNLOAD_UPDATE); GetRequest(parser, url, true); } @@ -483,7 +478,7 @@ public void getDownloadUpdate(DownloadUpdateServerReceiver receiver) { */ public void getUpdateDownloadReady(UpdateDownloadReadyReceiver receiver) { UpdateDownloadReadyParser parser = new UpdateDownloadReadyParser(receiver); - String url = mDomoticzUrls.constructGetUrl(DomoticzValues.Json.Url.Request.UPDATE_DOWNLOAD_READY, V2ApiDetected); + String url = mDomoticzUrls.constructGetUrl(DomoticzValues.Json.Url.Request.UPDATE_DOWNLOAD_READY); GetRequest(parser, url, true); } @@ -494,7 +489,7 @@ public void getUpdateDownloadReady(UpdateDownloadReadyReceiver receiver) { */ public void updateDomoticzServer(@Nullable UpdateDomoticzServerReceiver receiver) { UpdateDomoticzServerParser parser = new UpdateDomoticzServerParser(receiver); - String url = mDomoticzUrls.constructGetUrl(DomoticzValues.Json.Url.Request.UPDATE_DOMOTICZ_SERVER, V2ApiDetected); + String url = mDomoticzUrls.constructGetUrl(DomoticzValues.Json.Url.Request.UPDATE_DOMOTICZ_SERVER); GetRequest(parser, url, true); } @@ -509,7 +504,7 @@ public void checkLogin(LoginReceiver loginReceiver) { String username = UsefulBits.encodeBase64(getUserCredentials(Authentication.USERNAME)); String password = UsefulBits.getMd5String(getUserCredentials(Authentication.PASSWORD)); LoginParser parser = new LoginParser(loginReceiver); - String url = mDomoticzUrls.constructGetUrl(DomoticzValues.Json.Url.Request.CHECKLOGIN, V2ApiDetected); + String url = mDomoticzUrls.constructGetUrl(DomoticzValues.Json.Url.Request.CHECKLOGIN); Log.v(TAG, "Url: " + url); Map params = new HashMap<>(); @@ -518,50 +513,19 @@ public void checkLogin(LoginReceiver loginReceiver) { params.put("password", URLEncoder.encode(password, "UTF-8")); LoginPostRequest(parser, url, params); } catch (Exception e) { - try { - url = mDomoticzUrls.constructGetUrl(DomoticzValues.Json.Url.Request.NEWCHECKLOGIN, V2ApiDetected); - LoginPostRequest(parser, url, params); - } catch (Exception ex) { - ex.printStackTrace(); - } + e.printStackTrace(); } - - getServerVersion(new VersionReceiver() { - @Override - public void onReceiveVersion(VersionInfo version) { - if(version == null || version.getBuildDate() == null) - return; - - SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); - - try { - String referenceDateString = "2023-07-21 17:23:44"; - Date referenceDate = dateFormat.parse(referenceDateString); - if (version.getBuildDate().before(referenceDate)) { - V2ApiDetected = false; - } else { - V2ApiDetected = true; - getServerUtil().getActiveServer().setIsV2ApiDetected(V2ApiDetected); - getServerUtil().saveDomoticzServers(true); - } - } catch (ParseException e) { - e.printStackTrace(); - } - } - @Override - public void onError(Exception error) {} - }); } public void getSwitchLogs(int idx, SwitchLogReceiver switchesReceiver) { SwitchLogParser parser = new SwitchLogParser(switchesReceiver); - String url = mDomoticzUrls.constructGetUrl(DomoticzValues.Json.Url.Request.SWITCHLOG, V2ApiDetected) + idx; + String url = mDomoticzUrls.constructGetUrl(DomoticzValues.Json.Url.Request.SWITCHLOG) + idx; GetResultRequest(parser, url, true); } public void getTextLogs(int idx, SwitchLogReceiver switchesReceiver) { SwitchLogParser parser = new SwitchLogParser(switchesReceiver); - String url = mDomoticzUrls.constructGetUrl(DomoticzValues.Json.Url.Request.TEXTLOG, V2ApiDetected) + idx; + String url = mDomoticzUrls.constructGetUrl(DomoticzValues.Json.Url.Request.TEXTLOG) + idx; GetResultRequest(parser, url, true); @@ -569,35 +533,35 @@ public void getTextLogs(int idx, SwitchLogReceiver switchesReceiver) { public void getSceneLogs(int idx, SwitchLogReceiver switchesReceiver) { SwitchLogParser parser = new SwitchLogParser(switchesReceiver); - String url = mDomoticzUrls.constructGetUrl(DomoticzValues.Json.Url.Request.SCENELOG, V2ApiDetected) + idx; + String url = mDomoticzUrls.constructGetUrl(DomoticzValues.Json.Url.Request.SCENELOG) + idx; GetResultRequest(parser, url, true); } public void getScenes(ScenesReceiver receiver) { ScenesParser parser = new ScenesParser(receiver); - String url = mDomoticzUrls.constructGetUrl(DomoticzValues.Json.Url.Request.SCENES, V2ApiDetected); + String url = mDomoticzUrls.constructGetUrl(DomoticzValues.Json.Url.Request.SCENES); GetResultRequest(parser, url, true); } public void getScene(ScenesReceiver receiver, int idx) { ScenesParser parser = new ScenesParser(receiver, idx); - String url = mDomoticzUrls.constructGetUrl(DomoticzValues.Json.Url.Request.SCENES, V2ApiDetected); + String url = mDomoticzUrls.constructGetUrl(DomoticzValues.Json.Url.Request.SCENES); GetResultRequest(parser, url, true); } public void getPlans(PlansReceiver receiver) { PlanParser parser = new PlanParser(receiver); - String url = mDomoticzUrls.constructGetUrl(DomoticzValues.Json.Url.Request.PLANS, V2ApiDetected); + String url = mDomoticzUrls.constructGetUrl(DomoticzValues.Json.Url.Request.PLANS); GetResultRequest(parser, url, true); } public void getCameras(CameraReceiver receiver) { CameraParser parser = new CameraParser(receiver, this); - String url = mDomoticzUrls.constructGetUrl(DomoticzValues.Json.Url.Request.CAMERAS, V2ApiDetected); + String url = mDomoticzUrls.constructGetUrl(DomoticzValues.Json.Url.Request.CAMERAS); GetResultRequest(parser, url, true); @@ -605,14 +569,14 @@ public void getCameras(CameraReceiver receiver) { public void getSwitchTimers(int idx, SwitchTimerReceiver switchesReceiver, boolean isScene) { SwitchTimerParser parser = new SwitchTimerParser(switchesReceiver); - String url = mDomoticzUrls.constructGetUrl(isScene ? DomoticzValues.Json.Url.Request.SCENETIMER : DomoticzValues.Json.Url.Request.SWITCHTIMER, V2ApiDetected) + idx; + String url = mDomoticzUrls.constructGetUrl(isScene ? DomoticzValues.Json.Url.Request.SCENETIMER : DomoticzValues.Json.Url.Request.SWITCHTIMER) + idx; GetResultRequest(parser, url, true); } public void getNotifications(int idx, NotificationReceiver notificationReceiver) { NotificationsParser parser = new NotificationsParser(notificationReceiver); - String url = mDomoticzUrls.constructGetUrl(DomoticzValues.Json.Url.Request.NOTIFICATIONS, V2ApiDetected) + idx; + String url = mDomoticzUrls.constructGetUrl(DomoticzValues.Json.Url.Request.NOTIFICATIONS) + idx; GetResultRequest(parser, url, true); @@ -624,7 +588,7 @@ public void setSecurityPanelAction(int secStatus, setCommandReceiver receiver) { setCommandParser parser = new setCommandParser(receiver); - String url = mDomoticzUrls.constructGetUrl(DomoticzValues.Json.Url.Request.SETSECURITY, V2ApiDetected); + String url = mDomoticzUrls.constructGetUrl(DomoticzValues.Json.Url.Request.SETSECURITY); url += "&secstatus=" + secStatus; url += "&seccode=" + seccode; @@ -637,7 +601,7 @@ public void setUserVariableValue(String newValue, UserVariableInfo var, setCommandReceiver receiver) { setCommandParser parser = new setCommandParser(receiver); - String url = mDomoticzUrls.constructGetUrl(DomoticzValues.Json.Url.Request.UPDATEVAR, V2ApiDetected); + String url = mDomoticzUrls.constructGetUrl(DomoticzValues.Json.Url.Request.UPDATEVAR); url += "&idx=" + var.getIdx(); url += "&vname=" + var.getName(); url += "&vtype=" + var.getType(); @@ -772,7 +736,7 @@ public void setDeviceUsed(int id, String extraParams, setCommandReceiver receiver) { setCommandParser parser = new setCommandParser(receiver); - String url = mDomoticzUrls.constructGetUrl(DomoticzValues.Json.Url.Request.SET_DEVICE_USED, V2ApiDetected); + String url = mDomoticzUrls.constructGetUrl(DomoticzValues.Json.Url.Request.SET_DEVICE_USED); url += id; url += "&name=" + name; url += "&description=" + description; @@ -788,7 +752,7 @@ public void setDeviceUsed(int id, public void getStatus(int idx, StatusReceiver receiver) { StatusInfoParser parser = new StatusInfoParser(receiver); - String url = mDomoticzUrls.constructGetUrl(DomoticzValues.Json.Get.STATUS, V2ApiDetected) + String.valueOf(idx); + String url = mDomoticzUrls.constructGetUrl(DomoticzValues.Json.Get.STATUS) + String.valueOf(idx); Log.v(TAG, url); GetResultRequest(parser, url, true); @@ -796,7 +760,7 @@ public void getStatus(int idx, StatusReceiver receiver) { public void getUtilities(UtilitiesReceiver receiver) { UtilitiesParser parser = new UtilitiesParser(receiver); - String url = mDomoticzUrls.constructGetUrl(DomoticzValues.Json.Url.Request.UTILITIES, V2ApiDetected); + String url = mDomoticzUrls.constructGetUrl(DomoticzValues.Json.Url.Request.UTILITIES); Log.v(TAG, url); GetResultRequest(parser, url, true); @@ -804,7 +768,7 @@ public void getUtilities(UtilitiesReceiver receiver) { public void getSettings(SettingsReceiver receiver) { SettingsParser parser = new SettingsParser(receiver); - String url = mDomoticzUrls.constructGetUrl(DomoticzValues.Json.Url.Request.SETTINGS, V2ApiDetected); + String url = mDomoticzUrls.constructGetUrl(DomoticzValues.Json.Url.Request.SETTINGS); Log.v(TAG, url); GetRequest(parser, url, true); @@ -812,14 +776,14 @@ public void getSettings(SettingsReceiver receiver) { public void getConfig(ConfigReceiver receiver) { ConfigParser parser = new ConfigParser(receiver); - String url = mDomoticzUrls.constructGetUrl(DomoticzValues.Json.Url.Request.CONFIG, V2ApiDetected); + String url = mDomoticzUrls.constructGetUrl(DomoticzValues.Json.Url.Request.CONFIG); Log.v(TAG, url); GetRequest(parser, url, true); } public void getLanguageStringsFromServer(String language, LanguageReceiver receiver) { LanguageParser parser = new LanguageParser(receiver); - String url = mDomoticzUrls.constructGetUrl(DomoticzValues.Json.Url.Request.LANGUAGE, V2ApiDetected); + String url = mDomoticzUrls.constructGetUrl(DomoticzValues.Json.Url.Request.LANGUAGE); Log.v(TAG, url); url += language + ".json"; GetRequest(parser, @@ -828,7 +792,7 @@ public void getLanguageStringsFromServer(String language, LanguageReceiver recei public void getTemperatures(TemperatureReceiver receiver) { TemperaturesParser parser = new TemperaturesParser(receiver); - String url = mDomoticzUrls.constructGetUrl(DomoticzValues.Json.Url.Request.TEMPERATURE, V2ApiDetected); + String url = mDomoticzUrls.constructGetUrl(DomoticzValues.Json.Url.Request.TEMPERATURE); Log.v(TAG, url); GetResultRequest(parser, url, true); @@ -836,7 +800,7 @@ public void getTemperatures(TemperatureReceiver receiver) { public void getWeathers(WeatherReceiver receiver) { WeatherParser parser = new WeatherParser(receiver); - String url = mDomoticzUrls.constructGetUrl(DomoticzValues.Json.Url.Request.WEATHER, V2ApiDetected); + String url = mDomoticzUrls.constructGetUrl(DomoticzValues.Json.Url.Request.WEATHER); Log.v(TAG, url); GetResultRequest(parser, url, true); @@ -844,7 +808,7 @@ public void getWeathers(WeatherReceiver receiver) { public void getFavorites(DevicesReceiver receiver, int plan, String filter) { DevicesParser parser = new DevicesParser(receiver); - String url = mDomoticzUrls.constructGetUrl(DomoticzValues.Json.Url.Request.FAVORITES, V2ApiDetected); + String url = mDomoticzUrls.constructGetUrl(DomoticzValues.Json.Url.Request.FAVORITES); if (filter != null && filter.length() > 0) url = url.replace("filter=all", "filter=" + filter); @@ -857,7 +821,7 @@ public void getFavorites(DevicesReceiver receiver, int plan, String filter) { public void getDevices(DevicesReceiver receiver, int plan, String filter) { DevicesParser parser = new DevicesParser(receiver); - String url = mDomoticzUrls.constructGetUrl(DomoticzValues.Json.Url.Request.DEVICES, V2ApiDetected); + String url = mDomoticzUrls.constructGetUrl(DomoticzValues.Json.Url.Request.DEVICES); if (filter != null && filter.length() > 0) url = url.replace("filter=all", "filter=" + filter); @@ -871,7 +835,7 @@ public void getDevices(DevicesReceiver receiver, int plan, String filter) { public void getDevice(DevicesReceiver receiver, int idx, boolean scene_or_group) { DevicesParser parser = new DevicesParser(receiver, idx, scene_or_group); - String url = mDomoticzUrls.constructGetUrl(DomoticzValues.Json.Url.Request.DEVICES, V2ApiDetected); + String url = mDomoticzUrls.constructGetUrl(DomoticzValues.Json.Url.Request.DEVICES); Log.i("DEVICE", "url: " + url); GetResultRequest(parser, @@ -880,7 +844,7 @@ public void getDevice(DevicesReceiver receiver, int idx, boolean scene_or_group) public void getLogs(LogsReceiver receiver, int logLevel) { LogsParser parser = new LogsParser(receiver); - String url = mDomoticzUrls.constructGetUrl(DomoticzValues.Json.Url.Request.LOG, V2ApiDetected) + logLevel; + String url = mDomoticzUrls.constructGetUrl(DomoticzValues.Json.Url.Request.LOG) + logLevel; Log.i("Logs", "url: " + url); GetResultRequest(parser, url, true); @@ -888,7 +852,7 @@ public void getLogs(LogsReceiver receiver, int logLevel) { public void getUserVariables(UserVariablesReceiver receiver) { UserVariablesParser parser = new UserVariablesParser(receiver); - String url = mDomoticzUrls.constructGetUrl(DomoticzValues.Json.Url.Request.USERVARIABLES, V2ApiDetected); + String url = mDomoticzUrls.constructGetUrl(DomoticzValues.Json.Url.Request.USERVARIABLES); Log.i("USERVARIABLES", "url: " + url); GetResultRequest(parser, url, true); @@ -896,14 +860,14 @@ public void getUserVariables(UserVariablesReceiver receiver) { public void getUsers(UsersReceiver receiver) { UsersParser parser = new UsersParser(receiver); - String url = mDomoticzUrls.constructGetUrl(DomoticzValues.Json.Url.Request.USERS, V2ApiDetected); + String url = mDomoticzUrls.constructGetUrl(DomoticzValues.Json.Url.Request.USERS); Log.i("USERS", "url: " + url); GetResultRequest(parser, url, true); } public void LogOff() { - String url = mDomoticzUrls.constructGetUrl(DomoticzValues.Json.Url.Request.LOGOFF, V2ApiDetected); + String url = mDomoticzUrls.constructGetUrl(DomoticzValues.Json.Url.Request.LOGOFF); mSessionUtil.clearSessionCookie(); Log.i("LOGOFF", "url: " + url); GetRequest(new LogOffParser(), url, false); @@ -911,14 +875,14 @@ public void LogOff() { public void getEvents(EventReceiver receiver) { EventsParser parser = new EventsParser(receiver); - String url = mDomoticzUrls.constructGetUrl(DomoticzValues.Json.Url.Request.EVENTS, V2ApiDetected); + String url = mDomoticzUrls.constructGetUrl(DomoticzValues.Json.Url.Request.EVENTS); Log.i("EVENTS", "url: " + url); GetResultRequest(parser, url, true); } public void getGraphData(int idx, String range, String type, GraphDataReceiver receiver) { GraphDataParser parser = new GraphDataParser(receiver); - String url = mDomoticzUrls.constructGetUrl(DomoticzValues.Json.Url.Request.GRAPH, V2ApiDetected) + idx; + String url = mDomoticzUrls.constructGetUrl(DomoticzValues.Json.Url.Request.GRAPH) + idx; url += DomoticzValues.Url.Log.GRAPH_RANGE + range; url += DomoticzValues.Url.Log.GRAPH_TYPE + type; Log.i("GRAPH", "url: " + url); @@ -930,7 +894,7 @@ public void getTempGraphData(int idx, String range, int graphType, GraphDataReceiver receiver) { GraphDataParser parser = new GraphDataParser(receiver); - String url = mDomoticzUrls.constructGetUrl(DomoticzValues.Json.Url.Request.TEMPGRAPHS, V2ApiDetected) + idx; + String url = mDomoticzUrls.constructGetUrl(DomoticzValues.Json.Url.Request.TEMPGRAPHS) + idx; url += "&range=" + range; //2020-07-29T2020-08-05 url += "&graphtype=" + graphType; //1 url += "&graphTemp=" + graphTemp; //true diff --git a/domoticzapi/src/main/java/nl/hnogames/domoticzapi/DomoticzUrls.java b/domoticzapi/src/main/java/nl/hnogames/domoticzapi/DomoticzUrls.java index 9144a3e7c..c5163b3f6 100644 --- a/domoticzapi/src/main/java/nl/hnogames/domoticzapi/DomoticzUrls.java +++ b/domoticzapi/src/main/java/nl/hnogames/domoticzapi/DomoticzUrls.java @@ -117,11 +117,11 @@ public String constructSetUrl(int jsonSetUrl, int idx, int action, double value) break; case DomoticzValues.Device.Dimmer.Action.DIM_LEVEL: - actionUrl = DomoticzValues.Url.Switch.DIM_LEVEL + String.valueOf(value); + actionUrl = DomoticzValues.Url.Switch.DIM_LEVEL + value; break; case DomoticzValues.Device.Thermostat.Action.TMODE: - actionUrl = DomoticzValues.Url.Thermostat.TMODE + String.valueOf(value); + actionUrl = DomoticzValues.Url.Thermostat.TMODE + value; break; case DomoticzValues.Device.Dimmer.Action.COLOR: @@ -129,7 +129,7 @@ public String constructSetUrl(int jsonSetUrl, int idx, int action, double value) break; case DomoticzValues.Device.Dimmer.Action.KELVIN: - actionUrl = DomoticzValues.Url.Switch.KELVIN + String.valueOf(value); + actionUrl = DomoticzValues.Url.Switch.KELVIN + value; break; case DomoticzValues.Device.Dimmer.Action.WWCOLOR: @@ -177,88 +177,88 @@ public String constructSetUrl(int jsonSetUrl, int idx, int action, double value) case DomoticzValues.Json.Url.Set.SCENES: url = DomoticzValues.Url.Scene.GET; jsonUrl = url - + String.valueOf(idx) + + idx + DomoticzValues.Url.Switch.CMD + actionUrl; break; case DomoticzValues.Json.Url.Set.THERMOSTAT: url = DomoticzValues.Url.Thermostat.SETUSED; jsonUrl = url - + String.valueOf(idx) + + idx + actionUrl; break; case DomoticzValues.Json.Url.Set.SWITCHES: url = DomoticzValues.Url.Switch.GET; jsonUrl = url - + String.valueOf(idx) + + idx + DomoticzValues.Url.Switch.CMD + actionUrl; break; case DomoticzValues.Json.Url.Set.MODAL_SWITCHES: url = DomoticzValues.Url.ModalSwitch.GET; jsonUrl = url - + String.valueOf(idx) + + idx + DomoticzValues.Url.ModalSwitch.STATUS + actionUrl; break; case DomoticzValues.Json.Url.Set.TEMP: url = DomoticzValues.Url.Temp.GET; jsonUrl = url - + String.valueOf(idx) + + idx + DomoticzValues.Url.Temp.VALUE + actionUrl; break; case DomoticzValues.Json.Url.Set.SCENEFAVORITE: url = DomoticzValues.Url.Favorite.SCENE; jsonUrl = url - + String.valueOf(idx) + + idx + DomoticzValues.Url.Favorite.VALUE + actionUrl; break; case DomoticzValues.Json.Url.Set.FAVORITE: url = DomoticzValues.Url.Favorite.GET; jsonUrl = url - + String.valueOf(idx) + + idx + DomoticzValues.Url.Favorite.VALUE + actionUrl; break; case DomoticzValues.Json.Url.Set.RGBCOLOR: url = DomoticzValues.Url.System.RGBCOLOR; jsonUrl = url - + String.valueOf(idx) + + idx + actionUrl; break; case DomoticzValues.Json.Url.Set.KELVIN: url = DomoticzValues.Url.System.KELVIN; jsonUrl = url - + String.valueOf(idx) + + idx + actionUrl; break; case DomoticzValues.Json.Url.Set.WWCOLOR: url = DomoticzValues.Url.System.RGBCOLOR; jsonUrl = url - + String.valueOf(idx) + + idx + actionUrl; break; case DomoticzValues.Json.Url.Set.NIGHTLIGHT: url = DomoticzValues.Url.System.NIGHTLIGHT; jsonUrl = url - + String.valueOf(idx); + + idx; break; case DomoticzValues.Json.Url.Set.FULLLIGHT: url = DomoticzValues.Url.System.FULLLIGHT; jsonUrl = url - + String.valueOf(idx); + + idx; break; case DomoticzValues.Json.Url.Set.EVENTS_UPDATE_STATUS: url = DomoticzValues.Url.System.EVENTS_UPDATE_STATUS; jsonUrl = url - + String.valueOf(idx) + + idx + actionUrl; break; } @@ -272,11 +272,11 @@ public String constructSetUrl(int jsonSetUrl, int idx, int action, double value) return fullString; } - public String constructGetUrl(int jsonGetUrl, boolean useV2) { - return constructGetUrl(jsonGetUrl, false, null, null, useV2); + public String constructGetUrl(int jsonGetUrl) { + return constructGetUrl(jsonGetUrl, false, null, null); } - public String constructGetUrl(int jsonGetUrl, boolean withPass, String username, String password, boolean useV2) { + public String constructGetUrl(int jsonGetUrl, boolean withPass, String username, String password) { if (domoticz == null) return null; @@ -300,7 +300,7 @@ public String constructGetUrl(int jsonGetUrl, boolean withPass, String username, port = mServerUtil.getActiveServer().getRemoteServerPort(); directory = mServerUtil.getActiveServer().getRemoteServerDirectory(); } - jsonUrl = getJsonGetUrl(jsonGetUrl, useV2); + jsonUrl = getJsonGetUrl(jsonGetUrl); if (!withPass) { return buildUrl.append(protocol) @@ -318,353 +318,178 @@ public String constructGetUrl(int jsonGetUrl, boolean withPass, String username, } } - public String getJsonGetUrl(int jsonGetUrl, boolean useV2) { + public String getJsonGetUrl(int jsonGetUrl) { String url; - if(!useV2) { - switch (jsonGetUrl) { - case DomoticzValues.Json.Url.Request.NOTIFICATIONTYPES: - url = DomoticzValues.Url.System.NOTIFICATIONTYPES; - break; - case DomoticzValues.Json.Url.Request.SEND_NOTIFICATION: - url = DomoticzValues.Url.System.SEND_NOTIFICATION; - break; - case DomoticzValues.Json.Url.Request.LANGUAGE: - url = DomoticzValues.Url.System.LANGUAGE_TRANSLATIONS; - break; - case DomoticzValues.Json.Url.Request.UPDATE_DOWNLOAD_UPDATE: - url = DomoticzValues.Url.System.UPDATE_DOWNLOAD_UPDATE; - break; - case DomoticzValues.Json.Url.Request.UPDATE_DOMOTICZ_SERVER: - url = DomoticzValues.Url.System.UPDATE_DOMOTICZ_SERVER; - break; - case DomoticzValues.Json.Url.Request.UPDATE_DOWNLOAD_READY: - url = DomoticzValues.Url.System.UPDATE_DOWNLOAD_READY; - break; - case DomoticzValues.Json.Url.Request.VERSION: - url = DomoticzValues.Url.Category.VERSION; - break; - case DomoticzValues.Json.Url.Request.LOG: - url = DomoticzValues.Url.Log.GET_LOG; - break; - case DomoticzValues.Json.Url.Set.LOG: - url = DomoticzValues.Url.System.LOG; - break; - case DomoticzValues.Json.Url.Request.DASHBOARD: - url = DomoticzValues.Url.Category.DASHBOARD; - break; - - case DomoticzValues.Json.Url.Request.SCENES: - url = DomoticzValues.Url.Category.SCENES; - break; - - case DomoticzValues.Json.Url.Request.SWITCHES: - url = DomoticzValues.Url.Category.SWITCHES; - break; - - case DomoticzValues.Json.Url.Request.UTILITIES: - url = DomoticzValues.Url.Category.UTILITIES; - break; - - case DomoticzValues.Json.Url.Request.TEMPERATURE: - url = DomoticzValues.Url.Category.TEMPERATURE; - break; - - case DomoticzValues.Json.Url.Request.WEATHER: - url = DomoticzValues.Url.Category.WEATHER; - break; - - case DomoticzValues.Json.Url.Request.CAMERAS: - url = DomoticzValues.Url.Category.CAMERAS; - break; - - case DomoticzValues.Json.Url.Request.CAMERA: - url = DomoticzValues.Url.Category.CAMERA; - break; - - case DomoticzValues.Json.Url.Request.DEVICES: - url = DomoticzValues.Url.Category.DEVICES; - break; - - case DomoticzValues.Json.Get.STATUS: - url = DomoticzValues.Url.Device.STATUS; - break; - - case DomoticzValues.Json.Url.Request.PLANS: - url = DomoticzValues.Url.Category.PLANS; - break; - - case DomoticzValues.Json.Url.Request.SWITCHLOG: - url = DomoticzValues.Url.Category.SWITCHLOG; - break; - - case DomoticzValues.Json.Url.Request.TEXTLOG: - url = DomoticzValues.Url.Category.TEXTLOG; - break; - - case DomoticzValues.Json.Url.Request.SCENELOG: - url = DomoticzValues.Url.Category.SCENELOG; - break; - - case DomoticzValues.Json.Url.Request.SWITCHTIMER: - url = DomoticzValues.Url.Category.SWITCHTIMER; - break; - - case DomoticzValues.Json.Url.Request.SCENETIMER: - url = DomoticzValues.Url.Category.SCENETIMER; - break; - - case DomoticzValues.Json.Url.Request.SETSECURITY: - url = DomoticzValues.Url.System.SETSECURITY; - break; - - case DomoticzValues.Json.Url.Request.SUNRISE: - url = DomoticzValues.Url.System.SUNRISE; - break; - - case DomoticzValues.Json.Url.Request.UPDATE: - url = DomoticzValues.Url.System.UPDATE; - break; - - case DomoticzValues.Json.Url.Request.USERVARIABLES: - url = DomoticzValues.Url.System.USERVARIABLES; - break; - - case DomoticzValues.Json.Url.Request.EVENTS: - url = DomoticzValues.Url.System.EVENTS; - break; - - case DomoticzValues.Json.Url.Request.USERS: - url = DomoticzValues.Url.System.USERS; - break; - - case DomoticzValues.Json.Url.Request.AUTH: - url = DomoticzValues.Url.System.AUTH; - break; - - case DomoticzValues.Json.Url.Request.LOGOFF: - url = DomoticzValues.Url.System.LOGOFF; - break; - - case DomoticzValues.Json.Url.Request.SETTINGS: - url = DomoticzValues.Url.System.SETTINGS; - break; - - case DomoticzValues.Json.Url.Request.CONFIG: - url = DomoticzValues.Url.System.CONFIG; - break; + switch (jsonGetUrl) { + case DomoticzValues.Json.Url.Request.NOTIFICATIONTYPES: + url = DomoticzValues.Url.System.NOTIFICATIONTYPES; + break; + case DomoticzValues.Json.Url.Request.SEND_NOTIFICATION: + url = DomoticzValues.Url.System.SEND_NOTIFICATION; + break; + case DomoticzValues.Json.Url.Request.LANGUAGE: + url = DomoticzValues.Url.System.LANGUAGE_TRANSLATIONS; + break; + case DomoticzValues.Json.Url.Request.UPDATE_DOWNLOAD_UPDATE: + url = DomoticzValues.Url.System.UPDATE_DOWNLOAD_UPDATE; + break; + case DomoticzValues.Json.Url.Request.UPDATE_DOMOTICZ_SERVER: + url = DomoticzValues.Url.System.UPDATE_DOMOTICZ_SERVER; + break; + case DomoticzValues.Json.Url.Request.UPDATE_DOWNLOAD_READY: + url = DomoticzValues.Url.System.UPDATE_DOWNLOAD_READY; + break; + case DomoticzValues.Json.Url.Request.VERSION: + url = DomoticzValues.Url.Category.VERSION; + break; + case DomoticzValues.Json.Url.Request.LOG: + url = DomoticzValues.Url.Log.GET_LOG; + break; + case DomoticzValues.Json.Url.Set.LOG: + url = DomoticzValues.Url.System.LOG; + break; + case DomoticzValues.Json.Url.Request.DASHBOARD: + url = DomoticzValues.Url.Category.DASHBOARD; + break; - case DomoticzValues.Json.Url.Request.GRAPH: - url = DomoticzValues.Url.Log.GRAPH; - break; + case DomoticzValues.Json.Url.Request.SCENES: + url = DomoticzValues.Url.Category.SCENES; + break; - case DomoticzValues.Json.Url.Request.TEMPGRAPHS: - url = DomoticzValues.Url.Temp.GRAPH; - break; + case DomoticzValues.Json.Url.Request.SWITCHES: + url = DomoticzValues.Url.Category.SWITCHES; + break; - case DomoticzValues.Json.Url.Request.ADD_MOBILE_DEVICE: - url = DomoticzValues.Url.System.ADD_MOBILE_DEVICE; - break; + case DomoticzValues.Json.Url.Request.UTILITIES: + url = DomoticzValues.Url.Category.UTILITIES; + break; - case DomoticzValues.Json.Url.Request.CLEAN_MOBILE_DEVICE: - url = DomoticzValues.Url.System.CLEAN_MOBILE_DEVICE; - break; + case DomoticzValues.Json.Url.Request.TEMPERATURE: + url = DomoticzValues.Url.Category.TEMPERATURE; + break; - case DomoticzValues.Json.Url.Request.SET_DEVICE_USED: - url = DomoticzValues.Url.Device.SET_USED; - break; + case DomoticzValues.Json.Url.Request.WEATHER: + url = DomoticzValues.Url.Category.WEATHER; + break; - case DomoticzValues.Json.Url.Request.NOTIFICATIONS: - url = DomoticzValues.Url.Notification.NOTIFICATION; - break; + case DomoticzValues.Json.Url.Request.CAMERAS: + url = DomoticzValues.Url.Category.CAMERAS; + break; - case DomoticzValues.Json.Url.Request.FAVORITES: - url = DomoticzValues.Url.Category.FAVORITES; - break; + case DomoticzValues.Json.Url.Request.CAMERA: + url = DomoticzValues.Url.Category.CAMERA; + break; - case DomoticzValues.Json.Url.Request.UPDATEVAR: - url = DomoticzValues.Url.UserVariable.UPDATE; - break; + case DomoticzValues.Json.Url.Request.DEVICES: + url = DomoticzValues.Url.Category.DEVICES; + break; - case DomoticzValues.Json.Url.Request.CHECKLOGIN: - url = DomoticzValues.Url.Security.CHECKLOGIN; - break; + case DomoticzValues.Json.Get.STATUS: + url = DomoticzValues.Url.Device.STATUS; + break; - default: - throw new NullPointerException("getJsonGetUrl: No known JSON URL specified"); - } - } - else{ - switch (jsonGetUrl) { - case nl.hnogames.domoticzapi.v2.DomoticzValues.Json.Url.Request.NOTIFICATIONTYPES: - url = nl.hnogames.domoticzapi.v2.DomoticzValues.Url.System.NOTIFICATIONTYPES; - break; - case nl.hnogames.domoticzapi.v2.DomoticzValues.Json.Url.Request.SEND_NOTIFICATION: - url = nl.hnogames.domoticzapi.v2.DomoticzValues.Url.System.SEND_NOTIFICATION; - break; - case nl.hnogames.domoticzapi.v2.DomoticzValues.Json.Url.Request.LANGUAGE: - url = nl.hnogames.domoticzapi.v2.DomoticzValues.Url.System.LANGUAGE_TRANSLATIONS; - break; - case nl.hnogames.domoticzapi.v2.DomoticzValues.Json.Url.Request.UPDATE_DOWNLOAD_UPDATE: - url = nl.hnogames.domoticzapi.v2.DomoticzValues.Url.System.UPDATE_DOWNLOAD_UPDATE; - break; - case nl.hnogames.domoticzapi.v2.DomoticzValues.Json.Url.Request.UPDATE_DOMOTICZ_SERVER: - url = nl.hnogames.domoticzapi.v2.DomoticzValues.Url.System.UPDATE_DOMOTICZ_SERVER; - break; - case nl.hnogames.domoticzapi.v2.DomoticzValues.Json.Url.Request.UPDATE_DOWNLOAD_READY: - url = nl.hnogames.domoticzapi.v2.DomoticzValues.Url.System.UPDATE_DOWNLOAD_READY; - break; - case nl.hnogames.domoticzapi.v2.DomoticzValues.Json.Url.Request.VERSION: - url = nl.hnogames.domoticzapi.v2.DomoticzValues.Url.Category.VERSION; - break; - case nl.hnogames.domoticzapi.v2.DomoticzValues.Json.Url.Request.LOG: - url = nl.hnogames.domoticzapi.v2.DomoticzValues.Url.Log.GET_LOG; - break; - case nl.hnogames.domoticzapi.v2.DomoticzValues.Json.Url.Set.LOG: - url = nl.hnogames.domoticzapi.v2.DomoticzValues.Url.System.LOG; - break; - case nl.hnogames.domoticzapi.v2.DomoticzValues.Json.Url.Request.DASHBOARD: - url = nl.hnogames.domoticzapi.v2.DomoticzValues.Url.Category.DASHBOARD; - break; - - case nl.hnogames.domoticzapi.v2.DomoticzValues.Json.Url.Request.SCENES: - url = nl.hnogames.domoticzapi.v2.DomoticzValues.Url.Category.SCENES; - break; - - case nl.hnogames.domoticzapi.v2.DomoticzValues.Json.Url.Request.SWITCHES: - url = nl.hnogames.domoticzapi.v2.DomoticzValues.Url.Category.SWITCHES; - break; - - case nl.hnogames.domoticzapi.v2.DomoticzValues.Json.Url.Request.UTILITIES: - url = nl.hnogames.domoticzapi.v2.DomoticzValues.Url.Category.UTILITIES; - break; - - case nl.hnogames.domoticzapi.v2.DomoticzValues.Json.Url.Request.TEMPERATURE: - url = nl.hnogames.domoticzapi.v2.DomoticzValues.Url.Category.TEMPERATURE; - break; - - case nl.hnogames.domoticzapi.v2.DomoticzValues.Json.Url.Request.WEATHER: - url = nl.hnogames.domoticzapi.v2.DomoticzValues.Url.Category.WEATHER; - break; - - case nl.hnogames.domoticzapi.v2.DomoticzValues.Json.Url.Request.CAMERAS: - url = nl.hnogames.domoticzapi.v2.DomoticzValues.Url.Category.CAMERAS; - break; - - case nl.hnogames.domoticzapi.v2.DomoticzValues.Json.Url.Request.CAMERA: - url = nl.hnogames.domoticzapi.v2.DomoticzValues.Url.Category.CAMERA; - break; - - case nl.hnogames.domoticzapi.v2.DomoticzValues.Json.Url.Request.DEVICES: - url = nl.hnogames.domoticzapi.v2.DomoticzValues.Url.Category.DEVICES; - break; - - case nl.hnogames.domoticzapi.v2.DomoticzValues.Json.Get.STATUS: - url = nl.hnogames.domoticzapi.v2.DomoticzValues.Url.Device.STATUS; - break; - - case nl.hnogames.domoticzapi.v2.DomoticzValues.Json.Url.Request.PLANS: - url = nl.hnogames.domoticzapi.v2.DomoticzValues.Url.Category.PLANS; - break; - - case nl.hnogames.domoticzapi.v2.DomoticzValues.Json.Url.Request.SWITCHLOG: - url = nl.hnogames.domoticzapi.v2.DomoticzValues.Url.Category.SWITCHLOG; - break; - - case nl.hnogames.domoticzapi.v2.DomoticzValues.Json.Url.Request.TEXTLOG: - url = nl.hnogames.domoticzapi.v2.DomoticzValues.Url.Category.TEXTLOG; - break; - - case nl.hnogames.domoticzapi.v2.DomoticzValues.Json.Url.Request.SCENELOG: - url = nl.hnogames.domoticzapi.v2.DomoticzValues.Url.Category.SCENELOG; - break; - - case nl.hnogames.domoticzapi.v2.DomoticzValues.Json.Url.Request.SWITCHTIMER: - url = nl.hnogames.domoticzapi.v2.DomoticzValues.Url.Category.SWITCHTIMER; - break; - - case nl.hnogames.domoticzapi.v2.DomoticzValues.Json.Url.Request.SCENETIMER: - url = nl.hnogames.domoticzapi.v2.DomoticzValues.Url.Category.SCENETIMER; - break; - - case nl.hnogames.domoticzapi.v2.DomoticzValues.Json.Url.Request.SETSECURITY: - url = nl.hnogames.domoticzapi.v2.DomoticzValues.Url.System.SETSECURITY; - break; - - case nl.hnogames.domoticzapi.v2.DomoticzValues.Json.Url.Request.SUNRISE: - url = nl.hnogames.domoticzapi.v2.DomoticzValues.Url.System.SUNRISE; - break; - - case nl.hnogames.domoticzapi.v2.DomoticzValues.Json.Url.Request.UPDATE: - url = nl.hnogames.domoticzapi.v2.DomoticzValues.Url.System.UPDATE; - break; - - case nl.hnogames.domoticzapi.v2.DomoticzValues.Json.Url.Request.USERVARIABLES: - url = nl.hnogames.domoticzapi.v2.DomoticzValues.Url.System.USERVARIABLES; - break; - - case nl.hnogames.domoticzapi.v2.DomoticzValues.Json.Url.Request.EVENTS: - url = nl.hnogames.domoticzapi.v2.DomoticzValues.Url.System.EVENTS; - break; - - case nl.hnogames.domoticzapi.v2.DomoticzValues.Json.Url.Request.USERS: - url = nl.hnogames.domoticzapi.v2.DomoticzValues.Url.System.USERS; - break; - - case nl.hnogames.domoticzapi.v2.DomoticzValues.Json.Url.Request.AUTH: - url = nl.hnogames.domoticzapi.v2.DomoticzValues.Url.System.AUTH; - break; - - case nl.hnogames.domoticzapi.v2.DomoticzValues.Json.Url.Request.LOGOFF: - url = nl.hnogames.domoticzapi.v2.DomoticzValues.Url.System.LOGOFF; - break; - - case nl.hnogames.domoticzapi.v2.DomoticzValues.Json.Url.Request.SETTINGS: - url = nl.hnogames.domoticzapi.v2.DomoticzValues.Url.System.SETTINGS; - break; - - case nl.hnogames.domoticzapi.v2.DomoticzValues.Json.Url.Request.CONFIG: - url = nl.hnogames.domoticzapi.v2.DomoticzValues.Url.System.CONFIG; - break; + case DomoticzValues.Json.Url.Request.PLANS: + url = DomoticzValues.Url.Category.PLANS; + break; - case nl.hnogames.domoticzapi.v2.DomoticzValues.Json.Url.Request.GRAPH: - url = nl.hnogames.domoticzapi.v2.DomoticzValues.Url.Log.GRAPH; - break; + case DomoticzValues.Json.Url.Request.SWITCHLOG: + url = DomoticzValues.Url.Category.SWITCHLOG; + break; - case nl.hnogames.domoticzapi.v2.DomoticzValues.Json.Url.Request.TEMPGRAPHS: - url = nl.hnogames.domoticzapi.v2.DomoticzValues.Url.Temp.GRAPH; - break; + case DomoticzValues.Json.Url.Request.TEXTLOG: + url = DomoticzValues.Url.Category.TEXTLOG; + break; - case nl.hnogames.domoticzapi.v2.DomoticzValues.Json.Url.Request.ADD_MOBILE_DEVICE: - url = nl.hnogames.domoticzapi.v2.DomoticzValues.Url.System.ADD_MOBILE_DEVICE; - break; + case DomoticzValues.Json.Url.Request.SCENELOG: + url = DomoticzValues.Url.Category.SCENELOG; + break; - case nl.hnogames.domoticzapi.v2.DomoticzValues.Json.Url.Request.CLEAN_MOBILE_DEVICE: - url = nl.hnogames.domoticzapi.v2.DomoticzValues.Url.System.CLEAN_MOBILE_DEVICE; - break; + case DomoticzValues.Json.Url.Request.SWITCHTIMER: + url = DomoticzValues.Url.Category.SWITCHTIMER; + break; - case nl.hnogames.domoticzapi.v2.DomoticzValues.Json.Url.Request.SET_DEVICE_USED: - url = nl.hnogames.domoticzapi.v2.DomoticzValues.Url.Device.SET_USED; - break; + case DomoticzValues.Json.Url.Request.SCENETIMER: + url = DomoticzValues.Url.Category.SCENETIMER; + break; - case nl.hnogames.domoticzapi.v2.DomoticzValues.Json.Url.Request.NOTIFICATIONS: - url = nl.hnogames.domoticzapi.v2.DomoticzValues.Url.Notification.NOTIFICATION; - break; + case DomoticzValues.Json.Url.Request.SETSECURITY: + url = DomoticzValues.Url.System.SETSECURITY; + break; - case nl.hnogames.domoticzapi.v2.DomoticzValues.Json.Url.Request.FAVORITES: - url = nl.hnogames.domoticzapi.v2.DomoticzValues.Url.Category.FAVORITES; - break; + case DomoticzValues.Json.Url.Request.SUNRISE: + url = DomoticzValues.Url.System.SUNRISE; + break; - case nl.hnogames.domoticzapi.v2.DomoticzValues.Json.Url.Request.UPDATEVAR: - url = nl.hnogames.domoticzapi.v2.DomoticzValues.Url.UserVariable.UPDATE; - break; + case DomoticzValues.Json.Url.Request.UPDATE: + url = DomoticzValues.Url.System.UPDATE; + break; - case nl.hnogames.domoticzapi.v2.DomoticzValues.Json.Url.Request.CHECKLOGIN: - url = nl.hnogames.domoticzapi.v2.DomoticzValues.Url.Security.CHECKLOGIN; - break; + case DomoticzValues.Json.Url.Request.USERVARIABLES: + url = DomoticzValues.Url.System.USERVARIABLES; + break; - default: - throw new NullPointerException("getJsonGetUrl: No known JSON URL specified"); - } + case DomoticzValues.Json.Url.Request.EVENTS: + url = DomoticzValues.Url.System.EVENTS; + break; + + case DomoticzValues.Json.Url.Request.USERS: + url = DomoticzValues.Url.System.USERS; + break; + + case DomoticzValues.Json.Url.Request.AUTH: + url = DomoticzValues.Url.System.AUTH; + break; + + case DomoticzValues.Json.Url.Request.LOGOFF: + url = DomoticzValues.Url.System.LOGOFF; + break; + + case DomoticzValues.Json.Url.Request.SETTINGS: + url = DomoticzValues.Url.System.SETTINGS; + break; + + case DomoticzValues.Json.Url.Request.CONFIG: + url = DomoticzValues.Url.System.CONFIG; + break; + + case DomoticzValues.Json.Url.Request.GRAPH: + url = DomoticzValues.Url.Log.GRAPH; + break; + + case DomoticzValues.Json.Url.Request.TEMPGRAPHS: + url = DomoticzValues.Url.Temp.GRAPH; + break; + + case DomoticzValues.Json.Url.Request.ADD_MOBILE_DEVICE: + url = DomoticzValues.Url.System.ADD_MOBILE_DEVICE; + break; + + case DomoticzValues.Json.Url.Request.CLEAN_MOBILE_DEVICE: + url = DomoticzValues.Url.System.CLEAN_MOBILE_DEVICE; + break; + + case DomoticzValues.Json.Url.Request.SET_DEVICE_USED: + url = DomoticzValues.Url.Device.SET_USED; + break; + + case DomoticzValues.Json.Url.Request.NOTIFICATIONS: + url = DomoticzValues.Url.Notification.NOTIFICATION; + break; + + case DomoticzValues.Json.Url.Request.FAVORITES: + url = DomoticzValues.Url.Category.FAVORITES; + break; + + case DomoticzValues.Json.Url.Request.UPDATEVAR: + url = DomoticzValues.Url.UserVariable.UPDATE; + break; + + case DomoticzValues.Json.Url.Request.CHECKLOGIN: + url = DomoticzValues.Url.Security.CHECKLOGIN; + break; + + default: + throw new NullPointerException("getJsonGetUrl: No known JSON URL specified"); } return url; } diff --git a/domoticzapi/src/main/java/nl/hnogames/domoticzapi/DomoticzValues.java b/domoticzapi/src/main/java/nl/hnogames/domoticzapi/DomoticzValues.java index fea954da3..27ad9da7f 100644 --- a/domoticzapi/src/main/java/nl/hnogames/domoticzapi/DomoticzValues.java +++ b/domoticzapi/src/main/java/nl/hnogames/domoticzapi/DomoticzValues.java @@ -297,7 +297,6 @@ interface Request { int UPDATEVAR = 40; int IMAGE = 41; int CHECKLOGIN = 42; - int NEWCHECKLOGIN = 45; int UPDATE_DOWNLOAD_UPDATE = 43; int SUNRISE = 44; int SEND_NOTIFICATION = 50; @@ -406,24 +405,24 @@ interface ModalAction { @SuppressWarnings("SpellCheckingInspection") interface Category { - String ALLDEVICES = "/json.htm?type=devices"; - String DEVICES = "/json.htm?type=devices&filter=all&used=true"; - String FAVORITES = "/json.htm?type=devices&filter=all&used=true&favorite=1"; + String ALLDEVICES = "/json.htm?type=command¶m=getdevices"; + String DEVICES = "/json.htm?type=command¶m=getdevices&filter=all&used=true"; + String FAVORITES = "/json.htm?typecommand¶m=get=devices&filter=all&used=true&favorite=1"; String VERSION = "/json.htm?type=command¶m=getversion"; String DASHBOARD = ALLDEVICES + "&filter=all"; - String SCENES = "/json.htm?type=scenes"; + String SCENES = "/json.htm?type=command¶m=getscenes"; String SWITCHES = "/json.htm?type=command¶m=getlightswitches"; String WEATHER = ALLDEVICES + "&filter=weather&used=true"; - String CAMERAS = "/json.htm?type=cameras"; + String CAMERAS = "/json.htm?type=command¶m=getcameras"; String CAMERA = "/camsnapshot.jpg?idx="; String UTILITIES = ALLDEVICES + "&filter=utility&used=true"; - String PLANS = "/json.htm?type=plans"; + String PLANS = "/json.htm?type=command¶m=getplans"; String TEMPERATURE = ALLDEVICES + "&filter=temp&used=true"; - String SWITCHLOG = "/json.htm?type=lightlog&idx="; - String TEXTLOG = "/json.htm?type=textlog&idx="; - String SCENELOG = "/json.htm?type=scenelog&idx="; - String SWITCHTIMER = "/json.htm?type=timers&idx="; - String SCENETIMER = "/json.htm?type=scenetimers&idx="; + String SWITCHLOG = "/json.htm?type=command¶m=getlightlog&idx="; + String TEXTLOG = "/json.htm?type=command¶m=gettextlog&idx="; + String SCENELOG = "/json.htm?type=command¶m=getscenelog&idx="; + String SWITCHTIMER = "/json.htm?type=command¶m=gettimers&idx="; + String SCENETIMER = "/json.htm?type=command¶m=getscenetimers&idx="; } @SuppressWarnings("SpellCheckingInspection") @@ -458,7 +457,7 @@ interface Scene { interface Temp { String GET = "/json.htm?type=command¶m=udevice&idx="; String VALUE = "&nvalue=0&svalue="; - String GRAPH = "/json.htm?type=graph&sensor=temp&idx="; + String GRAPH = "/json.htm?type=command¶m=graph&sensor=temp&idx="; } @SuppressWarnings("SpellCheckingInspection") @@ -475,8 +474,8 @@ interface Protocol { @SuppressWarnings("SpellCheckingInspection") interface Device { - String STATUS = "/json.htm?type=devices&rid="; - String SET_USED = "/json.htm?type=setused&idx="; + String STATUS = "/json.htm?type=command¶m=getdevices&rid="; + String SET_USED = "/json.htm?type=command¶m=getsetused&idx="; } @SuppressWarnings("unused") @@ -486,13 +485,13 @@ interface Sunrise { @SuppressWarnings({"unused", "SpellCheckingInspection"}) interface Plan { - String GET = "/json.htm?type=plans"; + String GET = "/json.htm?type=command¶m=getplans"; String DEVICES = "/json.htm?type=command¶m=getplandevices&idx="; } @SuppressWarnings({"unused", "SpellCheckingInspection"}) interface Log { - String GRAPH = "/json.htm?type=graph&idx="; + String GRAPH = "/json.htm?type=command¶m=graph&idx="; String GRAPH_RANGE = "&range="; String GRAPH_TYPE = "&sensor="; @@ -502,14 +501,13 @@ interface Log { @SuppressWarnings({"unused", "SpellCheckingInspection"}) interface Notification { - String NOTIFICATION = "/json.htm?type=notifications&idx="; + String NOTIFICATION = "/json.htm?type=command¶m=getnotifications&idx="; } @SuppressWarnings({"unused", "SpellCheckingInspection"}) interface Security { String GET = "/json.htm?type=command¶m=getsecstatus"; String CHECKLOGIN = "/json.htm?type=command¶m=logincheck"; - String NEWCHECKLOGIN = "/logincheck"; } @SuppressWarnings({"unused", "SpellCheckingInspection"}) @@ -522,13 +520,13 @@ interface System { String SUNRISE = "/json.htm?type=command¶m=getSunRiseSet"; String UPDATE = "/json.htm?type=command¶m=checkforupdate&forced=true"; String USERVARIABLES = "/json.htm?type=command¶m=getuservariables"; - String EVENTS = "/json.htm?type=events¶m=list"; - String EVENTS_UPDATE_STATUS = "/json.htm?type=events¶m=updatestatus&eventid="; + String EVENTS = "/json.htm?evparam=list¶m=events&type=command"; + String EVENTS_UPDATE_STATUS = "/json.htm?type=command¶m=getevents&evparam=updatestatus&eventid="; String RGBCOLOR = "/json.htm?type=command¶m=setcolbrightnessvalue&idx="; String KELVIN = "/json.htm?type=command¶m=setkelvinlevel&idx="; String FULLLIGHT = "/json.htm?param=fulllight&type=command&idx="; String NIGHTLIGHT = "/json.htm?param=nightlight&type=command&idx="; - String SETTINGS = "/json.htm?type=settings"; + String SETTINGS = "/json.htm?type=command¶m=getsettings"; String CONFIG = "/json.htm?type=command¶m=getconfig"; String SETSECURITY = "/json.htm?type=command¶m=setsecstatus"; String UPDATE_DOWNLOAD_UPDATE = "/json.htm?type=command¶m=downloadupdate"; @@ -538,8 +536,8 @@ interface System { String CLEAN_MOBILE_DEVICE = "/json.htm?type=command¶m=deletemobiledevice"; String LANGUAGE_TRANSLATIONS = "/i18n/domoticz-"; String SEND_NOTIFICATION = "/json.htm?type=command¶m=sendnotification"; - String NOTIFICATIONTYPES = "/json.htm?type=notifications"; - String USERS = "/json.htm?type=users"; + String NOTIFICATIONTYPES = "/json.htm?type=command¶m=getnotifications"; + String USERS = "/json.htm?type=command¶m=getusers"; String AUTH = "/json.htm?type=command¶m=getauth"; String LOGOFF = "/json.htm?type=command¶m=dologout"; String LOG = "/json.htm?type=command¶m=addlogmessage&message="; @@ -555,4 +553,4 @@ public interface FavoriteAction { String ON = "1"; String OFF = "0"; } -} +} \ No newline at end of file diff --git a/domoticzapi/src/main/java/nl/hnogames/domoticzapi/Utils/SerializableManager.java b/domoticzapi/src/main/java/nl/hnogames/domoticzapi/Utils/SerializableManager.java index 357ebb0ad..3be8f4b3a 100644 --- a/domoticzapi/src/main/java/nl/hnogames/domoticzapi/Utils/SerializableManager.java +++ b/domoticzapi/src/main/java/nl/hnogames/domoticzapi/Utils/SerializableManager.java @@ -22,7 +22,6 @@ package nl.hnogames.domoticzapi.Utils; import android.content.Context; -import android.os.Environment; import java.io.File; import java.io.FileInputStream; diff --git a/domoticzapi/src/main/java/nl/hnogames/domoticzapi/v2/DomoticzValues.java b/domoticzapi/src/main/java/nl/hnogames/domoticzapi/v2/DomoticzValues.java deleted file mode 100644 index 2bf4b689c..000000000 --- a/domoticzapi/src/main/java/nl/hnogames/domoticzapi/v2/DomoticzValues.java +++ /dev/null @@ -1,556 +0,0 @@ -/* - * Copyright (C) 2015 Domoticz - Mark Heinis - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package nl.hnogames.domoticzapi.v2; - -import nl.hnogames.domoticzapi.Containers.DevicesInfo; - -/** - * Created by m.heinis on 8/5/2016. - */ -public class DomoticzValues { - /** - * Checks if the device has a stop button - * - * @param mDeviceInfo Device to check - * @return Returns true if the device has a stop button - */ - public static boolean canHandleStopButton(DevicesInfo mDeviceInfo) { - return (mDeviceInfo.getSubType().contains("RAEX")) || - (mDeviceInfo.getSubType().contains("A-OK")) || - (mDeviceInfo.getSubType().contains("Harrison")) || - (mDeviceInfo.getSubType().contains("RFY")) || - (mDeviceInfo.getSubType().contains("ASA")) || - (mDeviceInfo.getSubType().contains("Hasta")) || - (mDeviceInfo.getSubType().contains("Media Mount")) || - (mDeviceInfo.getSubType().contains("Forest")) || - (mDeviceInfo.getSubType().contains("Chamberlain")) || - (mDeviceInfo.getSubType().contains("Sunpery")) || - (mDeviceInfo.getSubType().contains("Dolat")) || - (mDeviceInfo.getSubType().contains("DC106")) || - (mDeviceInfo.getSubType().contains("Confexx")) || - (mDeviceInfo.getSubType().contains("ASP")); - } - - public interface Authentication { - String USERNAME = "username"; - String PASSWORD = "password"; - } - - public interface Result { - String ERROR = "ERR"; - String OK = "OK"; - } - - public interface Protocol { - String SECURE = "HTTPS"; - String INSECURE = "HTTP"; - } - - public interface Device { - interface Switch { - interface Action { - int ON = 10; - int OFF = 11; - } - } - - interface Hardware { - String EVOHOME = "evohome"; - } - - interface Dimmer { - interface Action { - int DIM_LEVEL = 20; - int COLOR = 21; - int WWCOLOR = 22; - int KELVIN = 23; - } - } - - interface Utility { - interface Type { - String HEATING = "Heating"; - String THERMOSTAT = "Thermostat"; - String GENERAL = "General"; - } - - interface SubType { - String TEXT = "Text"; - String ALERT = "Alert"; - String PERCENTAGE = "Percentage"; - String ENERGY = "Energy"; - String KWH = "kWh"; - String GAS = "Gas"; - String ELECTRIC = "Electric"; - String VOLTCRAFT = "Voltcraft"; - String SETPOINT = "SetPoint"; - String YOULESS = "YouLess"; - String SMARTWARES = "Smartwares"; - String THERMOSTAT_MODE = "Thermostat Mode"; - } - } - - interface Door { - interface State { - String UNLOCKED = "Unlocked"; - String LOCKED = "Locked"; - String OPEN = "Open"; - String CLOSED = "Closed"; - } - } - - interface Blind { - interface State { - String CLOSED = "Closed"; - String OPEN = "Open"; - String STOPPED = "Stopped"; - String ON = "On"; - String OFF = "Off"; - } - - interface Action { - int UP = 30; - int STOP = 31; - int ON = 33; - int OFF = 34; - int DOWN = 32; - int OPEN = 35; - int CLOSE = 36; - } - } - - interface Thermostat { - interface Action { - int MIN = 50; - int PLUS = 51; - int TMODE = 52; - } - } - - interface ModalSwitch { - interface Action { - int AUTO = 60; - int ECONOMY = 61; - int AWAY = 62; - int DAY_OFF = 63; - int CUSTOM = 64; - int HEATING_OFF = 65; - } - } - - interface Type { - @SuppressWarnings({"unused", "SpellCheckingInspection"}) - interface Value { - int DOORBELL = 1; - int CONTACT = 2; - int BLINDS = 3; - int SMOKE_DETECTOR = 5; - int DIMMER = 7; - int MOTION = 8; - int PUSH_ON_BUTTON = 9; - int PUSH_OFF_BUTTON = 10; - int ON_OFF = 0; - int SECURITY = 0; - int X10SIREN = 4; - int MEDIAPLAYER = 17; - int DUSKSENSOR = 12; - int DOORCONTACT = 11; - int BLINDPERCENTAGE = 13; - int BLINDVENETIAN = 15; - int BLINDVENETIANUS = 14; - int BLINDPERCENTAGESTOP = 21; - int SELECTOR = 18; - int DOORLOCK = 19; - int DOORLOCKINVERTED = 20; - int TEMP = 21; - } - - @SuppressWarnings({"unused", "SpellCheckingInspection"}) - interface Name { - String DOORBELL = "Doorbell"; - String CONTACT = "Contact"; - String BLINDS = "Blinds"; - String SMOKE_DETECTOR = "Smoke Detector"; - String DIMMER = "Dimmer"; - String MOTION = "Motion Sensor"; - String PUSH_ON_BUTTON = "Push On Button"; - String PUSH_OFF_BUTTON = "Push Off Button"; - String ON_OFF = "On/Off"; - String SECURITY = "Security"; - String X10SIREN = "X10 Siren"; - String MEDIAPLAYER = "Media Player"; - String DUSKSENSOR = "Dusk Sensor"; - String DOORLOCK = "Door Lock"; - String DOORLOCKINVERTED = "Door Lock Inverted"; - String DOORCONTACT = "Door Contact"; - String BLINDVENETIAN = "Venetian Blinds EU"; - String BLINDVENETIANUS = "Venetian Blinds US"; - String BLINDPERCENTAGE = "Blinds Percentage"; - String BLINDPERCENTAGESTOP = "Blinds + Stop"; - String TEMPHUMIDITYBARO = "Temp + Humidity + Baro"; - String WIND = "Wind"; - String SELECTOR = "Selector"; - String EVOHOME = "evohome"; - String TEMP = "21"; - } - } - - interface SubType { - @SuppressWarnings({"unused", "SpellCheckingInspection"}) - interface Value { - int RGB = 1; - int SECURITYPANEL = 2; - int EVOHOME = 3; - } - - @SuppressWarnings({"unused", "SpellCheckingInspection"}) - interface Name { - String RGB = "RGB"; - String WW = "WW"; - String SECURITYPANEL = "Security Panel"; - String EVOHOME = "Evohome"; - } - } - - interface Favorite { - int ON = 208; - int OFF = 209; - } - } - - public interface Log { - interface LOGLEVEL { - int ALL = 268435455; - int NORMAL = 1; - int STATUS = 2; - int ERROR = 4; - } - } - - public interface Json { - interface Field { - String RESULT = "result"; - String STATUS = "status"; - String VERSION = "version"; - String MESSAGE = "message"; - String ERROR = "ERROR"; - } - - interface Url { - @SuppressWarnings({"unused", "SpellCheckingInspection"}) - interface Request { - int DASHBOARD = 1; - int SCENES = 2; - int SWITCHES = 3; - int UTILITIES = 4; - int TEMPERATURE = 5; - int WEATHER = 6; - int CAMERAS = 7; - int CAMERA = 21; - int SUNRISE_SUNSET = 8; - int VERSION = 9; - int DEVICES = 10; - int PLANS = 11; - int PLAN_DEVICES = 12; - int LOG = 13; - int SWITCHLOG = 14; - int SWITCHTIMER = 15; - int UPDATE = 16; - int USERVARIABLES = 17; - int EVENTS = 18; - int GRAPH = 20; - int SETTINGS = 22; - int SETSECURITY = 23; - int TEXTLOG = 24; - int CONFIG = 25; - int SET_DEVICE_USED = 26; - int UPDATE_DOWNLOAD_READY = 27; - int UPDATE_DOMOTICZ_SERVER = 28; - int ADD_MOBILE_DEVICE = 29; - int CLEAN_MOBILE_DEVICE = 30; - int NOTIFICATIONS = 31; - int LANGUAGE = 32; - int SCENELOG = 33; - int USERS = 34; - int LOGOFF = 35; - int AUTH = 36; - int FAVORITES = 37; - int UPDATEVAR = 40; - int IMAGE = 41; - int CHECKLOGIN = 42; - int UPDATE_DOWNLOAD_UPDATE = 43; - int SUNRISE = 44; - int SEND_NOTIFICATION = 50; - int NOTIFICATIONTYPES = 51; - int TEMPGRAPHS = 52; - int SCENETIMER = 53; - } - - @SuppressWarnings("SpellCheckingInspection") - interface Set { - int SCENES = 101; - int SWITCHES = 102; - int TEMP = 103; - int FAVORITE = 104; - int SCENEFAVORITE = 106; - int EVENT = 105; - int RGBCOLOR = 107; - int MODAL_SWITCHES = 108; - int EVENTS_UPDATE_STATUS = 109; - int FULLLIGHT = 110; - int NIGHTLIGHT = 111; - int WWCOLOR = 112; - int KELVIN = 113; - int LOG = 114; - int THERMOSTAT = 115; - } - } - - interface Get { - int STATUS = 301; - } - } - - public interface Scene { - interface Type { - String GROUP = "Group"; - String SCENE = "Scene"; - } - - interface Action { - int ON = 40; - int OFF = 41; - } - } - - public interface Graph { - interface Range { - String DAY = "day"; - String MONTH = "month"; - String YEAR = "year"; - String WEEK = "week"; - } - } - - public interface Temperature { - @SuppressWarnings("unused") - interface Sign { - String CELSIUS = "C"; - String FAHRENHEIT = "F"; - } - } - - public interface Event { - @SuppressWarnings("unused") - interface Type { - String EVENT = "Event"; - } - - interface Action { - int ON = 55; - int OFF = 56; - } - } - - public interface Security { - @SuppressWarnings("SpellCheckingInspection") - interface Status { - int ARMHOME = 1; - int ARMAWAY = 2; - int DISARM = 0; - } - } - - public interface Url { - @SuppressWarnings("unused") - interface Action { - String ON = "On"; - String OFF = "Off"; - String UP = "Up"; - String STOP = "Stop"; - String DOWN = "Down"; - String PLUS = "Plus"; - String MIN = "Min"; - String CLOSE = "Close"; - String OPEN = "Open"; - } - - interface ModalAction { - String AUTO = "Auto"; - String ECONOMY = "AutoWithEco"; - String AWAY = "Away"; - String DAY_OFF = "DayOff"; - String CUSTOM = "Custom"; - String HEATING_OFF = "HeatingOff"; - } - - @SuppressWarnings("SpellCheckingInspection") - interface Category { - String ALLDEVICES = "/json.htm?type=command¶m=getdevices"; - String DEVICES = "/json.htm?type=command¶m=getdevices&filter=all&used=true"; - String FAVORITES = "/json.htm?typecommand¶m=get=devices&filter=all&used=true&favorite=1"; - String VERSION = "/json.htm?type=command¶m=getversion"; - String DASHBOARD = ALLDEVICES + "&filter=all"; - String SCENES = "/json.htm?type=command¶m=getscenes"; - String SWITCHES = "/json.htm?type=command¶m=getlightswitches"; - String WEATHER = ALLDEVICES + "&filter=weather&used=true"; - String CAMERAS = "/json.htm?type=command¶m=getcameras"; - String CAMERA = "/camsnapshot.jpg?idx="; - String UTILITIES = ALLDEVICES + "&filter=utility&used=true"; - String PLANS = "/json.htm?type=command¶m=getplans"; - String TEMPERATURE = ALLDEVICES + "&filter=temp&used=true"; - String SWITCHLOG = "/json.htm?type=command¶m=getlightlog&idx="; - String TEXTLOG = "/json.htm?type=command¶m=gettextlog&idx="; - String SCENELOG = "/json.htm?type=command¶m=getscenelog&idx="; - String SWITCHTIMER = "/json.htm?type=command¶m=gettimers&idx="; - String SCENETIMER = "/json.htm?type=command¶m=getscenetimers&idx="; - } - - @SuppressWarnings("SpellCheckingInspection") - interface Thermostat { - String SETUSED = "/json.htm?type=setused&used=true&idx="; - String TMODE = "&tmode="; - } - - @SuppressWarnings({"SpellCheckingInspection", "unused"}) - interface Switch { - String DIM_LEVEL = "Set%20Level&level="; - String COLOR = "&hue=%hue%&brightness=%bright%&iswhite=false"; - String KELVIN = "&kelvin="; - String WWCOLOR = "&brightness=%bright%&color={\"m\":2,\"t\":%ww%,\"r\":0,\"g\":0,\"b\":0,\"cw\":%cw%,\"ww\":%ww%}"; - String GET = "/json.htm?type=command¶m=switchlight&idx="; - String CMD = "&switchcmd="; - String LEVEL = "&level="; - } - - @SuppressWarnings("SpellCheckingInspection") - interface ModalSwitch { - String GET = "/json.htm?type=command¶m=switchmodal&idx="; - String STATUS = "&status="; - } - - @SuppressWarnings("SpellCheckingInspection") - interface Scene { - String GET = "/json.htm?type=command¶m=switchscene&idx="; - } - - @SuppressWarnings("SpellCheckingInspection") - interface Temp { - String GET = "/json.htm?type=command¶m=udevice&idx="; - String VALUE = "&nvalue=0&svalue="; - String GRAPH = "/json.htm?type=command¶m=graph&sensor=temp&idx="; - } - - @SuppressWarnings("SpellCheckingInspection") - interface Favorite { - String GET = "/json.htm?type=command¶m=makefavorite&idx="; - String SCENE = "/json.htm?type=command¶m=makescenefavorite&idx="; - String VALUE = "&isfavorite="; - } - - interface Protocol { - String HTTP = "http://"; - String HTTPS = "https://"; - } - - @SuppressWarnings("SpellCheckingInspection") - interface Device { - String STATUS = "/json.htm?type=command¶m=getdevices&rid="; - String SET_USED = "/json.htm?type=command¶m=getsetused&idx="; - } - - @SuppressWarnings("unused") - interface Sunrise { - String GET = "/json.htm?type=command¶m=getSunRiseSet"; - } - - @SuppressWarnings({"unused", "SpellCheckingInspection"}) - interface Plan { - String GET = "/json.htm?type=command¶m=getplans"; - String DEVICES = "/json.htm?type=command¶m=getplandevices&idx="; - } - - @SuppressWarnings({"unused", "SpellCheckingInspection"}) - interface Log { - String GRAPH = "/json.htm?type=command¶m=graph&idx="; - String GRAPH_RANGE = "&range="; - String GRAPH_TYPE = "&sensor="; - - String GET_LOG = "/json.htm?type=command¶m=getlog&loglevel="; - String GET_FROMLASTLOGTIME = "/json.htm?type=command¶m=getlog&lastlogtime="; - } - - @SuppressWarnings({"unused", "SpellCheckingInspection"}) - interface Notification { - String NOTIFICATION = "/json.htm?type=command¶m=getnotifications&idx="; - } - - @SuppressWarnings({"unused", "SpellCheckingInspection"}) - interface Security { - String GET = "/json.htm?type=command¶m=getsecstatus"; - String CHECKLOGIN = "/json.htm?type=command¶m=logincheck"; - } - - @SuppressWarnings({"unused", "SpellCheckingInspection"}) - interface UserVariable { - String UPDATE = "/json.htm?type=command¶m=updateuservariable"; - } - - @SuppressWarnings("SpellCheckingInspection") - interface System { - String SUNRISE = "/json.htm?type=command¶m=getSunRiseSet"; - String UPDATE = "/json.htm?type=command¶m=checkforupdate&forced=true"; - String USERVARIABLES = "/json.htm?type=command¶m=getuservariables"; - String EVENTS = "/json.htm?evparam=list¶m=events&type=command"; - String EVENTS_UPDATE_STATUS = "/json.htm?type=command¶m=getevents&evparam=updatestatus&eventid="; - String RGBCOLOR = "/json.htm?type=command¶m=setcolbrightnessvalue&idx="; - String KELVIN = "/json.htm?type=command¶m=setkelvinlevel&idx="; - String FULLLIGHT = "/json.htm?param=fulllight&type=command&idx="; - String NIGHTLIGHT = "/json.htm?param=nightlight&type=command&idx="; - String SETTINGS = "/json.htm?type=command¶m=getsettings"; - String CONFIG = "/json.htm?type=command¶m=getconfig"; - String SETSECURITY = "/json.htm?type=command¶m=setsecstatus"; - String UPDATE_DOWNLOAD_UPDATE = "/json.htm?type=command¶m=downloadupdate"; - String UPDATE_DOWNLOAD_READY = "/json.htm?type=command¶m=downloadready"; - String UPDATE_DOMOTICZ_SERVER = "/json.htm?type=command¶m=execute_script&scriptname=update_domoticz&direct=true"; - String ADD_MOBILE_DEVICE = "/json.htm?type=command¶m=addmobiledevice"; - String CLEAN_MOBILE_DEVICE = "/json.htm?type=command¶m=deletemobiledevice"; - String LANGUAGE_TRANSLATIONS = "/i18n/domoticz-"; - String SEND_NOTIFICATION = "/json.htm?type=command¶m=sendnotification"; - String NOTIFICATIONTYPES = "/json.htm?type=command¶m=getnotifications"; - String USERS = "/json.htm?type=command¶m=getusers"; - String AUTH = "/json.htm?type=command¶m=getauth"; - String LOGOFF = "/json.htm?type=command¶m=dologout"; - String LOG = "/json.htm?type=command¶m=addlogmessage&message="; - } - - interface Event { - String ON = "&eventstatus=1"; - String OFF = "&eventstatus=0"; - } - } - - public interface FavoriteAction { - String ON = "1"; - String OFF = "0"; - } -} \ No newline at end of file diff --git a/domoticzapi/version.properties b/domoticzapi/version.properties index 1adf1d32e..f092630e0 100644 --- a/domoticzapi/version.properties +++ b/domoticzapi/version.properties @@ -1,4 +1,4 @@ -#Sun Feb 11 13:43:19 CET 2024 +#Tue Feb 13 14:43:51 CET 2024 VERSION_BUILD=3675 VERSION_CODE=254 VERSION_PATCH=254 diff --git a/gradle.properties b/gradle.properties index a60fce84e..8470d6261 100644 --- a/gradle.properties +++ b/gradle.properties @@ -19,5 +19,5 @@ org.gradle.parallel=true org.gradle.configureondemand=true org.gradle.jvmargs=-Xmx3072m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 android.defaults.buildfeatures.buildconfig=true -android.nonTransitiveRClass=false +android.nonTransitiveRClass=true android.nonFinalResIds=false \ No newline at end of file