UniversalDevicesInc-PG3 / udi-poly-notification

Polyglot v2 NodeServer for Notifications
MIT License
2 stars 1 forks source link

Support setting custom sounds #20

Closed jimboca closed 3 years ago

jimboca commented 3 years ago

https://pushover.net/api#sounds

MrBill12 commented 3 years ago

no different than other message attributes such as 'priority', except that when the node server starts it has to get the list of available sounds from Pushover to populate the list of available sounds:

` In most cases, applications choosing to override the default sound should offer the user the option to pick a sound from the list above. Rather than hard-coding the list of sounds (since more may be added in the future), an API call may be made to retrieve the list of current sounds and their descriptions by sending a GET request to:

https://api.pushover.net/1/sounds.json?token=(your app token) `

jimboca commented 3 years ago

Yes, that's what I planned to do, I already do that for others settings and build the ISY profile on the fly at each restart.

Reminder to me: Confirm order will never change which will mess up programs.

jimboca commented 3 years ago

Another reminder, check that the sound numbers will never change even if Pushover returns them in a different order. Also, maybe start looping thru and make sure the ones listed before Pushover default are added to the end of the list, not the beginning...

2021-06-26 14:54:04,883 Controller polyinterface      INFO     Pushover:l_info: pushover_1704:Service Pushover 1704:get: got {'status': True, 'code': 200, 'data': {'sounds': {'Door_Open': 'Door Open', 'Quack': 'Quack', 'YouveGotMail': "You've Got Mail", 'pushover': 'Pushover (default)', 'bike': 'Bike', 'bugle': 'Bugle', 'cashregister': 'Cash Register', 'classical': 'Classical', 'cosmic': 'Cosmic', 'falling': 'Falling', 'gamelan': 'Gamelan', 'incoming': 'Incoming', 'intermission': 'Intermission', 'magic': 'Magic', 'mechanical': 'Mechanical', 'pianobar': 'Piano Bar', 'siren': 'Siren', 'spacealarm': 'Space Alarm', 'tugboat': 'Tug Boat', 'alien': 'Alien Alarm (long)', 'climb': 'Climb (long)', 'persistent': 'Persistent (long)', 'echo': 'Pushover Echo (long)', 'updown': 'Up Down (long)', 'vibrate': 'Vibrate Only', 'none': 'None (silent)'}, 'status': 1, 'request': '77cc66ad-a409-41bf-a75d-11e35c77b34c'}}