-
Notifications
You must be signed in to change notification settings - Fork 1
119 implement low battery notification system #125
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
DivineThreepwood
merged 28 commits into
dev
from
119-implement-low-battery-notification-system
Feb 20, 2024
Merged
Changes from all commits
Commits
Show all changes
28 commits
Select commit
Hold shift + click to select a range
eaff071
fix lock and registry typos, finish implementation of message regsitry.
DivineThreepwood c4a8d5c
introduce user message gql query
DivineThreepwood 91461f4
Implement message registry and minor bug fixes.
DivineThreepwood 7ed32dc
Merge branch 'dev' into 119-implement-low-battery-notification-system
DivineThreepwood 61a8f45
fix compile issue
DivineThreepwood 5b57814
Merge branch '119-implement-low-battery-notification-system' of https…
DivineThreepwood 18b7798
fix unit pool test
DivineThreepwood 7a6dc94
fix mock registry shutdown
DivineThreepwood 511ea42
cleanup logs
DivineThreepwood 0f55722
address some review issues by improving backend to get rid of test sl…
DivineThreepwood d7db06e
link against compatible jul version
DivineThreepwood 5f0a5d9
fix test issues
DivineThreepwood a868456
Stablize location and connection consistency handling
DivineThreepwood e67c3e9
fix flaky location type detection test.
DivineThreepwood 3c687dc
fix typos and fix canDo bug.
DivineThreepwood 2ea5054
make code compile again
DivineThreepwood 2d9daa9
link against latest jul version
DivineThreepwood a43692d
upgrade jul
DivineThreepwood 3cbc144
link against latest jul version
DivineThreepwood 7d65dcd
make docker image build tag configurable
DivineThreepwood 733aea0
make compatible with latest jul version
DivineThreepwood 3df18d8
link against latest jul version
DivineThreepwood c906ea1
link against latest jul version that hopefully fixes the registry sta…
DivineThreepwood 96b514c
implement userMessage subscription.
DivineThreepwood 37914dd
fix test issues
DivineThreepwood 993923f
integrate user message subscription in schema
DivineThreepwood 8c09442
fix exception handling in AuthorizationWithTokenHelper to handle user…
DivineThreepwood 272736c
recover notification timing
DivineThreepwood File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule jul
updated
33 files
Submodule type
updated
2 files
| +3 −3 | src/main/proto/openbase/type/domotic/communication/UserMessage.proto | |
| +6 −0 | src/main/proto/proto.lock |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
50 changes: 50 additions & 0 deletions
50
...in/java/org/openbase/bco/api/graphql/subscriptions/MessageRegistrySubscriptionObserver.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,50 @@ | ||
| package org.openbase.bco.api.graphql.subscriptions | ||
|
|
||
| import com.google.common.collect.ImmutableList | ||
| import org.openbase.bco.api.graphql.error.ServerError | ||
| import org.openbase.bco.api.graphql.schema.RegistrySchemaModule | ||
| import org.openbase.bco.registry.remote.Registries | ||
| import org.openbase.jul.pattern.provider.DataProvider | ||
| import org.openbase.type.domotic.communication.UserMessageType | ||
| import org.openbase.type.domotic.registry.MessageRegistryDataType | ||
|
|
||
| class MessageRegistrySubscriptionObserver() : | ||
| AbstractObserverMapper<DataProvider<MessageRegistryDataType.MessageRegistryData>, MessageRegistryDataType.MessageRegistryData, List<UserMessageType.UserMessage>>() { | ||
| private val userMessages: MutableList<UserMessageType.UserMessage> | ||
|
|
||
| init { | ||
| Registries.getMessageRegistry( | ||
| ServerError.BCO_TIMEOUT_SHORT, | ||
| ServerError.BCO_TIMEOUT_TIME_UNIT | ||
| ) | ||
| userMessages = ArrayList( | ||
| RegistrySchemaModule.getUserMessages() | ||
| ) | ||
| } | ||
|
|
||
| @Throws(Exception::class) | ||
| override fun update( | ||
| source: DataProvider<MessageRegistryDataType.MessageRegistryData>, | ||
| target: MessageRegistryDataType.MessageRegistryData, | ||
| ) { | ||
| val newUserMessages: ImmutableList<UserMessageType.UserMessage> = | ||
| RegistrySchemaModule.getUserMessages() | ||
| if (newUserMessages == userMessages) { | ||
| // nothing has changed | ||
| return | ||
| } | ||
|
|
||
| // store update | ||
| userMessages.clear() | ||
| userMessages.addAll(newUserMessages) | ||
| super.update(source, target) | ||
| } | ||
|
|
||
| @Throws(Exception::class) | ||
| override fun mapData( | ||
| source: DataProvider<MessageRegistryDataType.MessageRegistryData>, | ||
| data: MessageRegistryDataType.MessageRegistryData, | ||
| ): List<UserMessageType.UserMessage> { | ||
| return userMessages | ||
| } | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.