diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..19c896d --- /dev/null +++ b/.gitignore @@ -0,0 +1,7 @@ +################################################################################ +# Diese .gitignore-Datei wurde von Microsoft(R) Visual Studio automatisch erstellt. +################################################################################ + +/.vs/sonos/v16/.suo +/.vs/ProjectSettings.json +/.vs/slnx.sqlite diff --git a/src/SonosUPnP.cpp b/src/SonosUPnP.cpp index 4700511..f6cd2d0 100644 --- a/src/SonosUPnP.cpp +++ b/src/SonosUPnP.cpp @@ -59,6 +59,7 @@ const char p_RadioMetaFullStart[] PROGMEM = SONOS_RADIO_META_FULL_START; const char p_RadioMetaFullEnd[] PROGMEM = SONOS_RADIO_META_FULL_END; const char p_BecomeCoordinatorOfStandaloneGroup[] PROGMEM = SONOS_TAG_BECOME_COORDINATOR_OF_STANDALONE_GROUP; const char p_SetLEDState[] PROGMEM = SONOS_TAG_SET_LED_STATE; +const char p_ConfigureSleepTimer[] PROGMEM = SONOS_TAG_CONFIGURE_SLEEP_TIMER; const char p_AddURIToQueue[] PROGMEM = SONOS_TAG_ADD_URI_TO_QUEUE; const char p_SavedQueues[] PROGMEM = SONOS_SAVED_QUEUES; @@ -282,6 +283,12 @@ void SonosUPnP::setStatusLight(IPAddress speakerIP, bool state) SONOS_TAG_DESIRED_LED_STATE, state ? "On" : "Off"); } +void SonosUPnP::NewSleepTimerDuration(IPAddress speakerIP, uint8_t hour, uint8_t minute, uint8_t second) +{ + char time[11]; + sprintf_P(time, p_TimeFormatTemplate, hour, minute, second); + upnpSet(speakerIP, UPNP_AV_TRANSPORT, p_ConfigureSleepTimer, SONOS_TAG_NEW_SLEEP_TIMER_DURATION, time); + void SonosUPnP::addPlaylistToQueue(IPAddress speakerIP, uint16_t playlistIndex) { char path[45]; diff --git a/src/SonosUPnP.h b/src/SonosUPnP.h index bfce396..49adc7e 100644 --- a/src/SonosUPnP.h +++ b/src/SonosUPnP.h @@ -123,6 +123,9 @@ #define SONOS_TAG_SET_LED_STATE "SetLEDState" #define SONOS_TAG_DESIRED_LED_STATE "DesiredLEDState" +#define SONOS_TAG_CONFIGURE_SLEEP_TIMER "ConfigureSleepTimer" +#define SONOS_TAG_NEW_SLEEP_TIMER_DURATION "NewSleepTimerDuration" + // Playlist & Queue /* @@ -307,6 +310,7 @@ class SonosUPnP void addPlaylistToQueue(IPAddress speakerIP, uint16_t playlistIndex); void addTrackToQueue(IPAddress speakerIP, const char *scheme, const char *address); void removeAllTracksFromQueue(IPAddress speakerIP); + void NewSleepTimerDuration(IPAddress speakerIP, uint8_t hour, uint8_t minute, uint8_t second); #ifndef SONOS_WRITE_ONLY_MODE