Skip to content

CLI to pair, connect, and perform automations for events for Apple TVs

Notifications You must be signed in to change notification settings

bstein/appletv-automate

Repository files navigation

appletv-automate

This repository includes a Python CLI to pair, connect, and perform automations for events for Apple TVs on your local network by utilizing the pyatv library.

Some barebones listeners classes are included. There is also a basic function named publish_event_to_ifttt_webhooks() in utils.py which enables IFTTT Webhooks integrations.

The motivation behind this project was to enable running IFTTT applets when an Apple TV powered on or off. However, it has been written in a way which should make it extensible for other purposes. For example, you could perform some action when a movie starts playing. Please refer to the pyatv documentation for information about available listeners.

Requirements

  • Python 3.7+
  • Additional libraries defined in requirements.txt
  • OpenSSL compiled with support for ed25519 in order to connect to MRP devices (more info)

Getting Started

  1. Clone this repository:

    git clone https://github.com/bstein/appletv-automate.git
    
  2. Install dependencies:

    pip install -r requirements.txt
    
  3. Copy config-sample.py to config.py and update IFTTT_API_KEY, should you wish to use it.

  4. Open main.py and find the # TODO comment. By default, the PowerListener is uncommented. Comment/uncomment the other listeners based on which ones you would like to use. You will likely want to tweak the listener classes to fit your needs, but you may use them as-is for now.

  5. Start main.py

    python main.py
    

About

CLI to pair, connect, and perform automations for events for Apple TVs

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages