Skip to content
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

[amazonechocontrol] last spoken text channel #235

Merged
merged 4 commits into from
Dec 2, 2021

Conversation

Trinitus01
Copy link
Contributor

changed: last voice command via customer history record
added: last spoken text channel

Signed-off-by: Tom Blum trinitus01@googlemail.com

added: last spoken text channel

Signed-off-by: Tom Blum <trinitus01@googlemail.com>
Copy link
Member

@J-N-K J-N-K left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. Please add the new channel to README, too.

@@ -120,82 +121,44 @@

// DeviceTypeIds to human readable description
// originally found here: https://github.com/Apollon77/ioBroker.alexa2/blob/master/main.js
public static final Map<String, String> DEVICE_TYPES = Map.<String, String> ofEntries( //
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please revert this change.

String json = makeRequestAndReturnString(
"https://" + amazonSite + "/alexa-privacy/apd/rvh/customer-history-records?startTime="
+ (startTime != null ? startTime : "") + "&endTime=" + (endTime != null ? endTime : "")
// + "&recordType=VOICE_HISTORY"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove commented code

Comment on lines 789 to 799

/*
* DEPRECATED
* connection.getActivities(10, pushActivity.timestamp).stream().filter(activity -> search.equals(activity.id))
* .findFirst()
* .ifPresent(currentActivity -> currentActivity.getSourceDeviceIds().stream()
* .map(sourceDeviceId -> findEchoHandlerBySerialNumber(sourceDeviceId.serialNumber))
* .filter(Objects::nonNull).forEach(echoHandler -> Objects.requireNonNull(echoHandler)
* .handlePushActivity(currentActivity)));
*/

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove commented code. If it is needed later, it can be retrieved from the git history.

Comment on lines 802 to 803
Long startTimestamp = timestamp - 30000;
Long endTimestamp = timestamp + 30000;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Long startTimestamp = timestamp - 30000;
Long endTimestamp = timestamp + 30000;
long startTimestamp = timestamp - 30000;
long endTimestamp = timestamp + 30000;

if (customerHistoryRecord != null) {
String recordKey = customerHistoryRecord.recordKey;
if (recordKey != null && search.equals(recordKey)) {
EchoHandler echoHandler = findEchoHandlerBySerialNumber(recordKey.split("#")[3]);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this safe? If recordKey.split returns less than four parts, this will result in an IndexOutOfBoundsException

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It depends on the data of the response, so i will add a check.

Signed-off-by: Tom Blum <trinitus01@googlemail.com>
removed: commented code
removed: deprecated method
changed: use primitives where possible
removed: check for null
added: check for length

Signed-off-by: Tom Blum <trinitus01@googlemail.com>
Signed-off-by: Tom Blum <trinitus01@googlemail.com>
@J-N-K J-N-K merged commit 2868761 into smarthomej:3.2.x Dec 2, 2021
@J-N-K J-N-K added the enhancement New feature or request label Dec 2, 2021
@J-N-K J-N-K added this to the 3.1.8 milestone Dec 2, 2021
J-N-K added a commit that referenced this pull request Dec 2, 2021
* changed: last voice command via customer history record
* added: last spoken text channel

Signed-off-by: Tom Blum <trinitus01@googlemail.com>
Signed-off-by: Jan N. Klug <jan.n.klug@rub.de>
@Trinitus01 Trinitus01 deleted the AECB_activityText_wakeWord branch December 4, 2021 19:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants