Skip to content

Commit

Permalink
update irdb (#9)
Browse files Browse the repository at this point in the history
* update irdb

* fix identify by name

* add merge group
  • Loading branch information
makeevrserg authored Sep 16, 2024
1 parent b4a344c commit 79558f4
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 4 deletions.
1 change: 1 addition & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: Pull Request CI

on:
merge_group:
pull_request:
branches:
- 'dev'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,15 @@ object SignalTable : LongIdTable("SIGNAL_TABLE") {

init {
uniqueIndex(
name,
brandId,
type,
frequency,
dutyCycle,
data
)
uniqueIndex(
name,
brandId,
type,
protocol,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,9 @@ object ParserPathResolver {
brand = brand,
ifrFolderName = ifrFolderName
)
return Json.decodeFromString(file.readText())
return kotlin.runCatching { Json.decodeFromString<DeviceConfiguration>(file.readText()) }
.onFailure { println("Could not parse file ${file.absoluteFile}") }
.getOrThrow()
}

fun irFileConfigurationFile(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,10 @@ internal class FillerController(private val database: Database) : CoroutineScope
this[SignalKeyTable.type] = IfrKeyIdentifier.Empty.TYPE
}

is IfrKeyIdentifier.Name -> error("Identifying by name is not possible!")
is IfrKeyIdentifier.Name -> {
this[SignalKeyTable.remoteKeyName] = keyIdentifier.name
this[SignalKeyTable.type] = IfrKeyIdentifier.Name.TYPE
}

is IfrKeyIdentifier.Sha256 -> {
this[SignalKeyTable.remoteKeyName] = keyIdentifier.name
Expand All @@ -191,7 +194,9 @@ internal class FillerController(private val database: Database) : CoroutineScope
andWhere { SignalTable.hash eq keyIdentifier.hash }
}

is IfrKeyIdentifier.Name -> error("Identifying by name is not possible!")
is IfrKeyIdentifier.Name -> {
andWhere { SignalTable.name eq keyIdentifier.name }
}
}
}
.map { it[SignalTable.id] }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,11 @@ internal class SignalRouteRegistry(
.or { SignalKeyTable.hash.eq(identifier.hash) }
}
}
is IfrKeyIdentifier.Name -> {
andWhere {
SignalKeyTable.remoteKeyName.eq(identifier.name)
}
}

else -> andWhere { SignalKeyTable.deviceKey.eq(order.key) }
}
Expand Down

0 comments on commit 79558f4

Please sign in to comment.