{"id":15962301,"url":"https://github.com/albertogeniola/elmax-api","last_synced_at":"2025-06-20T01:06:35.994Z","repository":{"id":57426064,"uuid":"403064817","full_name":"albertogeniola/elmax-api","owner":"albertogeniola","description":null,"archived":false,"fork":false,"pushed_at":"2024-12-08T00:07:20.000Z","size":6082,"stargazers_count":0,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-31T11:24:13.527Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/albertogeniola.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"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":"2021-09-04T13:34:04.000Z","updated_at":"2024-11-28T20:11:31.000Z","dependencies_parsed_at":"2024-10-27T16:21:49.166Z","dependency_job_id":"abe9ebd5-4dfa-4474-b72f-3c289fdc7b1f","html_url":"https://github.com/albertogeniola/elmax-api","commit_stats":{"total_commits":35,"total_committers":1,"mean_commits":35.0,"dds":0.0,"last_synced_commit":"1fba54b87e4defcc4bc0c43422a77414b89220b8"},"previous_names":[],"tags_count":21,"template":false,"template_full_name":null,"purl":"pkg:github/albertogeniola/elmax-api","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/albertogeniola%2Felmax-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/albertogeniola%2Felmax-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/albertogeniola%2Felmax-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/albertogeniola%2Felmax-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/albertogeniola","download_url":"https://codeload.github.com/albertogeniola/elmax-api/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/albertogeniola%2Felmax-api/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260857365,"owners_count":23073435,"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":[],"created_at":"2024-10-07T16:02:45.063Z","updated_at":"2025-06-20T01:06:30.973Z","avatar_url":"https://github.com/albertogeniola.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Python Elmax API client\n\n![Elmax Logo](docs/elmax-logo.png?raw=true \"Elmax Logo\")\n\nAsynchronous Python API client for interacting with the Elmax Cloud services, via HTTP apis.\n\n![Release Build Status](https://github.com/albertogeniola/elmax-api/workflows/Release/badge.svg?branch=main)\n![Testing Status](https://github.com/albertogeniola/elmax-api/workflows/Testing/badge.svg?branch=main)\n![Documentation](https://github.com/albertogeniola/elmax-api/workflows/Publish%20Documentation/badge.svg?branch=main)\n\n## Installation\n\nUse the package manager pip to install Python Elmax API client:\n\n```bash\n$ pip3 install elmax-api --user\n```\n\nor, to install it globally, use the following command\n\n```bash\n$ pip3 install elmax-api\n```\n\n## Usage\n\n```python\nimport asyncio\n\nfrom elmax_api.http import Elmax\nfrom elmax_api.model.command import SwitchCommand\n\nMY_USERNAME = 'TYPE_HERE_YOUR_ELMAX_EMAIL'\nMY_PASSWORD = 'TYPE_HERE_YOUR_ELMAX_PASSWORD'\n\n\nasync def main():\n    # Instantiate the Elmax API client\n    client = Elmax(username=MY_USERNAME, password=MY_PASSWORD)\n\n    # List panels for your user\n    panels = await client.list_control_panels()\n    print(f\"Found {len(panels)} panels for user {client.get_authenticated_username()}\")\n\n    # Get online panels only\n    online_panels = []\n    for p in panels:\n        status = 'ONLINE' if p.online else 'OFFLINE'\n        print(f\"+ {p.hash}: {status}\")\n        if p.online:\n            online_panels.append(p)\n\n    if len(online_panels) == 0:\n        print(\"Sorry, no panel to work with. Exiting.\")\n        exit(0)\n\n    # Fetch status of first panel\n    p = online_panels[0]\n    panel_status = await client.get_panel_status(control_panel_id=p.hash)\n\n    # Print some zone status\n    for z in panel_status.zones:\n        print(f\"Zone '{z.name}' open: {z.opened}\")\n\n    # Toggle some actuator\n    actuator = panel_status.actuators[0]\n    old_status = actuator.opened\n    print(f\"Actuator {actuator.name} was {'ON' if old_status else 'OFF'}\")\n    print(f\"Switching {'OFF' if old_status else 'ON'} actuator {actuator.name}\")\n    await client.execute_command(endpoint_id=actuator.endpoint_id, command=SwitchCommand.TURN_ON if not old_status else SwitchCommand.TURN_OFF)\n\n    print(\"Waiting a bit...\")\n    await asyncio.sleep(5)\n\n    print(\"Reverting back original actuator status\")\n    await client.execute_command(endpoint_id=actuator.endpoint_id,\n                                 command=SwitchCommand.TURN_ON if old_status else SwitchCommand.TURN_OFF)\n    print(\"Done!\")\n\nif __name__ == '__main__':\n    asyncio.run(main())\n```\n\n## Documentation\nFull API documentation is available on GitHub pages, [here](https://albertogeniola.github.io/elmax-api/).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falbertogeniola%2Felmax-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falbertogeniola%2Felmax-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falbertogeniola%2Felmax-api/lists"}