Skip to content

Commit

Permalink
* new version, see changelog
Browse files Browse the repository at this point in the history
  • Loading branch information
Apollon77 committed Jul 9, 2022
1 parent cc4c7b7 commit e79bd5b
Show file tree
Hide file tree
Showing 3 changed files with 454 additions and 72 deletions.
21 changes: 21 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,27 @@ Thank you for that work.
* docu docu docu (sorry ... will come)

## Changelog:

### __WORK IN PROGRESS__
* (Apollon77) Adjust Alarm methods to use the new API from Amazon. Also createNotification() and parseValue4Notification() now returns the new format for Alarms
* (Apollon77) Enhance createNotification() to also support adding reccurence information
* (Apollon77) Notification objects will also have a delete method now
* (Apollon77) Notifications can be cancelled now
* (Apollon77) Adjust logging when no callback is provided again, now logs also the body
* (Apollon77) Add methods:
* getUsersMe()
* getHousehold()
* getNotificationSounds()
* getDeviceNotificationState()
* setDeviceNotificationVolume()
* setDeviceNotificationDefaultSound()
* getDeviceNotificationDefaultSound()
* getAscendingAlarmState()
* setDeviceAscendingAlarmState()
* getRoutineSkillCatalog() to request the Skill catalog that can be used in Sequence Commands
* cancelNotification()
* setNotification() and setNotificationV2()

### 5.2.0 (2022-07-06)
* (Apollon77) Query API endpoints (including new method getEndpoints()) from Amazon on start and use this API endpoint for the calls
* (Apollon77) Enhance getDevicePreferences() to request preferences for one device
Expand Down
90 changes: 88 additions & 2 deletions alexa-remote.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ declare module "alexa-remote2" {

export type Status = "ON" | "OFF";

export type Notification = {
export type Notification = Partial<{
alarmTime: number;
createdDate: number;
deferredAtTime: number | null;
Expand All @@ -119,7 +119,41 @@ declare module "alexa-remote2" {
triggerTime: number;
type: string;
version: string;
};
rRuleData: {
byMonthDays: string[],
byMonths: string[],
byWeekDays: string[],
flexibleRecurringPatternType: 'EVERY_X_WEEKS' | 'EVERY_X_MONTHS' | 'EVERY_X_DAYS' | 'EVERY_X_YEARS' | 'X_TIMES_A_WEEK' | 'X_TIMES_A_MONTH' | 'X_TIMES_A_DAY' | 'X_TIMES_A_YEAR',
frequency: 'DAILY' | 'WEEKLY' | 'MONTHLY' | 'YEARLY' | null,
intervals: number[],
nextTriggerTimes: string[],
notificationTimes: string[],
offset: number[],
recurEndDate: string | null,
recurEndTime: string | null,
recurStartDate: string | null,
recurStartTime: string | null,
recurrenceRules: string[]
},
}>;

type NotificationV2 = Partial<{
trigger: {
scheduledTime: string,
recurrence: {
freq: 'DAILY' | 'WEEKLY' | 'MONTHLY' | 'YEARLY'
byDay: string[],
byMonth: string[],
interval: number
}
},
endpointId: string,
assets: [{
type: string,
assetId: string
}],
extensions: []
}>;

type GetContactsOptions = Partial<{
includePreferencesByLevel: string;
Expand Down Expand Up @@ -230,6 +264,12 @@ declare module "alexa-remote2" {

initNotifications(callback: CallbackWithError): void;

setNotification(notification: Notification, callback: CallbackWithErrorAndBody): void

setNotificationV2(notificationIndex: String, notification: NotificationV2, callback: CallbackWithErrorAndBody): void

cancelNotification(notification: Notification | NotificationV2, callback: CallbackWithErrorAndBody): void

initWakewords(callback: CallbackWithError): void;

initDeviceState(callback: CallbackWithError): void;
Expand Down Expand Up @@ -266,6 +306,10 @@ declare module "alexa-remote2" {
/// Public
checkAuthentication(callback: CallbackWithErrorAndBody): void;

getUsersMe(callback: CallbackWithErrorAndBody): void;

getHousehold(callback: CallbackWithErrorAndBody): void;

getDevices(callback: CallbackWithErrorAndBody): void;

getCards(
Expand Down Expand Up @@ -319,6 +363,36 @@ declare module "alexa-remote2" {

getNotifications(cached: boolean, callback: CallbackWithErrorAndBody): void;

getNotificationSounds(
serialOrName: SerialOrName,
alertType: 'Timer' | 'Alarm' | CallbackWithErrorAndBody,
callback?: CallbackWithErrorAndBody
): void

setDeviceNotificationDefaultSound(
serialOrName: SerialOrName,
notificationType: 'Alarm',
soundId: string,
callback: CallbackWithErrorAndBody
): void

getDeviceNotificationDefaultSound(
serialOrName: SerialOrName,
notificationType: 'Alarm' | 'Timer',
callback: CallbackWithErrorAndBody
): void

getAscendingAlarmState(
serialOrName: SerialOrName | CallbackWithErrorAndBody,
callback?: CallbackWithErrorAndBody
): void

setDeviceAscendingAlarmState(
serialOrName: SerialOrName,
ascendingAlarmEnabled: boolean,
callback: CallbackWithErrorAndBody
): void

getSkills(callback: CallbackWithErrorAndBody): void;

getRoutineSoundList(callback: CallbackWithErrorAndBody): void;
Expand Down Expand Up @@ -363,6 +437,12 @@ declare module "alexa-remote2" {
callback: CallbackWithErrorAndBody
): void;

setDeviceNotificationVolume(
serialOrName: SerialOrName,
volumeLevel: number,
callback: CallbackWithErrorAndBody
): void;

getBluetooth(cached: boolean, callback: CallbackWithErrorAndBody): void;

tuneinSearchRaw(query: string, callback: CallbackWithErrorAndBody): void;
Expand Down Expand Up @@ -474,6 +554,12 @@ declare module "alexa-remote2" {
callback: CallbackWithErrorAndBody
): void;

getRoutineSkillCatalog(
catalogId: string | CallbackWithErrorAndBody,
limit?: number | CallbackWithErrorAndBody,
callback?: CallbackWithErrorAndBody
): void

getMusicProviders(callback: CallbackWithErrorAndBody): void;

playMusicProvider(
Expand Down
Loading

0 comments on commit e79bd5b

Please sign in to comment.