-
Notifications
You must be signed in to change notification settings - Fork 25
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
Conversation
added: last spoken text channel Signed-off-by: Tom Blum <trinitus01@googlemail.com>
There was a problem hiding this 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( // |
There was a problem hiding this comment.
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" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove commented code
|
||
/* | ||
* 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))); | ||
*/ | ||
|
There was a problem hiding this comment.
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.
.../src/main/java/org/smarthomej/binding/amazonechocontrol/internal/handler/AccountHandler.java
Show resolved
Hide resolved
Long startTimestamp = timestamp - 30000; | ||
Long endTimestamp = timestamp + 30000; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Long startTimestamp = timestamp - 30000; | |
Long endTimestamp = timestamp + 30000; | |
long startTimestamp = timestamp - 30000; | |
long endTimestamp = timestamp + 30000; |
.../src/main/java/org/smarthomej/binding/amazonechocontrol/internal/handler/AccountHandler.java
Show resolved
Hide resolved
if (customerHistoryRecord != null) { | ||
String recordKey = customerHistoryRecord.recordKey; | ||
if (recordKey != null && search.equals(recordKey)) { | ||
EchoHandler echoHandler = findEchoHandlerBySerialNumber(recordKey.split("#")[3]); |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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>
* 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>
changed: last voice command via customer history record
added: last spoken text channel
Signed-off-by: Tom Blum trinitus01@googlemail.com