Skip to content

Commit

Permalink
Apply required changes for breaking OpenRemote changes
Browse files Browse the repository at this point in the history
  • Loading branch information
pankalog committed Feb 1, 2024
1 parent ae3ab29 commit b9fbb09
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 17 deletions.
1 change: 1 addition & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
projectName = custom-project
projectVersion = 1.0-SNAPSHOT
typescriptGeneratorVersion = 3.2.1263
Original file line number Diff line number Diff line change
Expand Up @@ -164,12 +164,12 @@ private void handleAssetConfigurationChange(AttributeEvent attributeEvent) {

if(eventFilter.apply(attributeEvent) == null) return;

Asset<?> asset = assetStorageService.find(attributeEvent.getAttributeRef().getId());
Asset<?> asset = assetStorageService.find(attributeEvent.getRef().getId());
// if (asset.getType() == )

if(Objects.equals(attributeEvent.getAttributeName(), TeltonikaModelConfigurationAsset.PARAMETER_MAP.getName())) return;
if(Objects.equals(attributeEvent.getName(), TeltonikaModelConfigurationAsset.PARAMETER_MAP.getName())) return;

if (Objects.equals(attributeEvent.getAttributeName(), TeltonikaModelConfigurationAsset.PARAMETER_DATA.getName())){
if (Objects.equals(attributeEvent.getName(), TeltonikaModelConfigurationAsset.PARAMETER_DATA.getName())){
TeltonikaParameter[] newParamList = (TeltonikaParameter[]) attributeEvent.getValue().orElseThrow();
if(newParamList.length == 0) return;
getLogger().info("Model map configuration event: " + Arrays.toString(newParamList));
Expand Down Expand Up @@ -243,13 +243,13 @@ private void handleAttributeMessage(AttributeEvent event) {
TeltonikaConfiguration config = getConfig();

// If this is not an AttributeEvent that updates a config.config.getCommandAttribute().getValue().orElse("sendToDevice") field, ignore
if (!Objects.equals(event.getAttributeName(), config.getCommandAttribute().getValue().orElse("sendToDevice"))) return;
if (!Objects.equals(event.getName(), config.getCommandAttribute().getValue().orElse("sendToDevice"))) return;
//Find the asset in question
CarAsset asset = assetStorageService.find(event.getAssetId(), CarAsset.class);
CarAsset asset = assetStorageService.find(event.getId(), CarAsset.class);

// Double check, remove later, sanity checks
if(asset.hasAttribute(config.getCommandAttribute().getValue().orElse("sendToDevice"))){
if(Objects.equals(event.getAssetId(), asset.getId())){
if(Objects.equals(event.getId(), asset.getId())){

//Get the IMEI of the device
Optional<Attribute<String>> imei;
Expand Down
16 changes: 5 additions & 11 deletions settings.gradle
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
pluginManagement {
plugins {
id "com.cherryperry.gradle-file-encrypt" version "2.0.0"
id "org.jetbrains.gradle.plugin.idea-ext" version "1.1.3"
}
}

plugins {
id "com.cherryperry.gradle-file-encrypt" apply false
id "org.jetbrains.gradle.plugin.idea-ext" apply false
id "com.cherryperry.gradle-file-encrypt" version "2.0.3" apply false
id "org.jetbrains.gradle.plugin.idea-ext" version "1.1.3" apply false
id 'cz.habarta.typescript-generator' version "$typescriptGeneratorVersion" apply false
}

rootProject.name = "$projectName"
Expand All @@ -17,5 +11,5 @@ fileTree(dir: rootDir, include: "**/build.gradle", excludes: ["**/node_modules/*
.filter { it.parent != rootDir }
.filter { !file("${it.parent}/.buildignore").exists() }
.each {
include it.parent.replace(rootDir.canonicalPath, "").replace("\\", ":").replace("/", ":")
}
include it.parent.replace(rootDir.canonicalPath, "").replace("\\", ":").replace("/", ":")
}

0 comments on commit b9fbb09

Please sign in to comment.