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

Added Sonos snapshot feature #2240

Merged
merged 4 commits into from
Jun 9, 2016

Conversation

dansullivan86
Copy link
Contributor

@dansullivan86 dansullivan86 commented Jun 5, 2016

Description:
This exposes soco snapshot and restore features.
Enabling the ability to have a Sonos player play something then return to its previous state. My use case is to play a door bell sound effect, but I also envisage it being useful for things like TTS.

Pull request in home-assistant.io with documentation (if applicable): home-assistant/home-assistant.io#

Example entry for configuration.yaml (if applicable):

script:
  doorbell:
    alias: Door Bell Automation
    sequence:
      - alias: Snapshot Sonos
        service: media_player.sonos_snapshot
        data:
          entity_id: media_player.lounge
      - alias: Door Bell Play Sound
        service: media_player.play_media
        data:
          entity_id: media_player.lounge
          media_content_id: http://192.168.1.41:8123/local/doorbell.mp3
          media_content_type: audio/mp3
      - delay:
          seconds: 6    
      - alias: Restore Sonos      
        service: media_player.sonos_restore
        data:
          entity_id: media_player.lounge

Checklist:

If user exposed functionality or configuration variables are added/changed:

If code communicates with devices:

  • Local tests with tox run successfully. Your PR cannot be merged unless tests pass
  • New dependencies have been added to the REQUIREMENTS variable (example).
  • New dependencies are only imported inside functions that use them (example).
  • New dependencies have been added to requirements_all.txt by running script/gen_requirements_all.py.
  • New files were added to .coveragerc.

If the code does not interact with devices:

  • Local tests with tox run successfully. Your PR cannot be merged unless tests pass
  • Tests have been added to verify that the new code works.

device.snapshot(service)
device.update_ha_state(True)

def restore(service):

Choose a reason for hiding this comment

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

farcy v1.1

  • D210: No whitespaces allowed surrounding docstring text

@arsaboo
Copy link
Contributor

arsaboo commented Jun 6, 2016

Wow....this will be great to announce (aka....notifications) on Sonos!

@balloob
Copy link
Member

balloob commented Jun 9, 2016

Looks good! 🐬

@balloob balloob merged commit ce829d1 into home-assistant:dev Jun 9, 2016
@home-assistant home-assistant locked and limited conversation to collaborators Mar 17, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants