{"id":23042485,"url":"https://github.com/andrewsayre/pyheos","last_synced_at":"2025-08-14T22:32:21.534Z","repository":{"id":34241422,"uuid":"172836334","full_name":"andrewsayre/pyheos","owner":"andrewsayre","description":"An async python library for controlling HEOS devices through the HEOS CLI Protocol","archived":false,"fork":false,"pushed_at":"2024-05-14T23:37:59.000Z","size":184,"stargazers_count":13,"open_issues_count":9,"forks_count":9,"subscribers_count":7,"default_branch":"dev","last_synced_at":"2024-05-15T18:33:13.928Z","etag":null,"topics":["heos","heos-api","heos-cli","heos-control"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/andrewsayre.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-02-27T03:30:04.000Z","updated_at":"2024-05-14T23:38:02.000Z","dependencies_parsed_at":"2024-05-15T15:52:59.417Z","dependency_job_id":"677cdccc-8399-42bf-acb4-8f35dbb78ca8","html_url":"https://github.com/andrewsayre/pyheos","commit_stats":{"total_commits":100,"total_committers":3,"mean_commits":"33.333333333333336","dds":"0.42000000000000004","last_synced_commit":"345d25ec4a004dadbc69ceb7b015fca8130c8da5"},"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrewsayre%2Fpyheos","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrewsayre%2Fpyheos/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrewsayre%2Fpyheos/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrewsayre%2Fpyheos/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/andrewsayre","download_url":"https://codeload.github.com/andrewsayre/pyheos/tar.gz/refs/heads/dev","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":229874153,"owners_count":18137724,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["heos","heos-api","heos-cli","heos-control"],"created_at":"2024-12-15T20:32:41.067Z","updated_at":"2025-08-14T22:32:21.507Z","avatar_url":"https://github.com/andrewsayre.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ![pyheos](assets/pyheos-logo.png \"pyheos - An asynchronous Python library for controlling Denon and Marantz products with HEOS® Built-in\")\n\n[![CI Status](https://github.com/andrewsayre/pyheos/workflows/CI/badge.svg)](https://github.com/andrewsayre/pyheos/actions)\n[![codecov](https://codecov.io/github/andrewsayre/pyheos/graph/badge.svg?token=PV4P3AN7Z1)](https://codecov.io/github/andrewsayre/pyheos)\n[![image](https://img.shields.io/pypi/v/pyheos.svg)](https://pypi.org/project/pyheos/)\n[![image](https://img.shields.io/pypi/pyversions/pyheos.svg)](https://pypi.org/project/pyheos/)\n[![image](https://img.shields.io/pypi/l/pyheos.svg)](https://pypi.org/project/pyheos/)\n\nAn asynchronous Python library for controlling Denon and Marantz products with HEOS® Built-in through the HEOS CLI Protocol (version 1.21 for HEOS firmware 3.40 or newer).\n\n## Installation\n\n```bash\npip install pyheos\n```\n\n## Getting Started\n\n### `Heos` class\n\nThe `Heos` class is the implementation providing control to all HEOS compatible devices on the local network through a single network connection. It is suggested to connect to a device that is hard-wired.\n\n#### `pyheos.Heos.create_and_connect(host: str, **kwargs) -\u003e Heos`\n\nCoroutine that accepts the host and options arguments (as defined in the `pyheos.HeosOptions` below), creates an instance of `Heos` and connects, returning the instance.\n\n#### `pyheos.Heos(options: HeosOptions)`\n\n- `options: HeosOptions`: An instance of HeosOptions that encapsulates options and configuration (see below)\n\n#### `pyheos.Heos.connect() -\u003e None`\n\nConnect to the specified host. This method is a coroutine.\n\n#### `pyheos.Heos.disconnect() -\u003e None`\n\nDisconnect from the specified host. This method is a coroutine.\n\n#### `pyheos.Heos.get_players(*, refresh)`\n\nRetrieve the available players as a `dict[int, pyheos.Heos.HeosPlayer]` where the key represents the `player_id` and the value the `HeosPlayer` instance. This method is a coroutine. This method will populate the `players` property and will begin tracking changes to the players.\n\n- `refresh`: Set to `True` to retrieve the latest available players from the CLI. The default is `False` and will return the previous loaded players.\n\n### `HeosOptions` class\n\nThis class encapsulates the options and configuration for connecting to a HEOS system.\n\n#### `pyheos.HeosOptions(host, *, timeout, heart_beat, heart_beat_interval, dispatcher, auto_reconnect, auto_reconnect_delay, auto_reconnect_max_attempts, credentials)`\n\n- `host: str`: A host name or IP address of a HEOS-capable device. This parameter is required.\n- `timeout: float`: The timeout in seconds for opening a connection and issuing commands to the device. Default is `pyheos.const.DEFAULT_TIMEOUT = 15.0`. This parameter is required.\n- `heart_beat: bool`: Set to `True` to enable heart beat messages, `False` to disable. Used in conjunction with `heart_beat_delay`. The default is `True`.\n- `heart_beat_interval: float`: The interval in seconds between heart beat messages. Used in conjunction with `heart_beat`. Default is `pyheos.const.DEFAULT_HEART_BEAT = 10.0`\n- `events: bool`: Set to `True` to enable event updates, `False` to disable. The default is `True`.\n- `all_progress_events: bool`: Set to `True` to receive media progress events, `False` to only receive media changed events. The default is `True`.\n- `dispatcher: pyheos.Dispatcher | None`: The dispatcher instance to use for event callbacks. If not provided, an internally created instance will be used.\n- `auto_failover: bool`: Set to True to automatically failover to other hosts if the connection is lost. The default is False. Used in conjunction with `auto_failover_hosts`.\n- `auto_failover_hosts: Sequence[str]`: A sequence of host names or IP addresses of other hosts in the HEOS system. The default is an empty list, which will be populated automatically from the system information.\n- `auto_reconnect: bool`: Set to `True` to automatically reconnect if the connection is lost. The default is `False`. Used in conjunction with `auto_reconnect_delay`.\n- `auto_reconnect_delay: float`: The number of seconds to wait before attempting to reconnect upon a connection failure. The default is `DEFAULT_RECONNECT_DELAY = 1.0`. Used in conjunction with `auto_reconnect`.\n- `auto_reconnect_max_attempts: float`: The maximum number of reconnection attempts before giving up. Set to `0` for unlimited attempts. The default is `0` (unlimited).\n- `credentials`: credentials to use to automatically sign-in to the HEOS account upon successful connection. If not provided, the account will not be signed in.\n\n##### Example:\n\n```python\nimport pyheos\n\nheos = await Heos.create_and_connect('172.16.0.1', auto_reconnect=True)\n\nplayers = await heos.get_players()\n...\nawait heos.disconnect()\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandrewsayre%2Fpyheos","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fandrewsayre%2Fpyheos","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandrewsayre%2Fpyheos/lists"}