I need a clean, well-structured Python module that connects directly to the Home Assistant API, handles authentication, and exposes simple functions for reading and updating entity states, firing events, and subscribing to real-time changes. Everything should be wrapped in reusable classes (ideally async-friendly) so I can drop the code into an existing project without major refactoring. While Home Assistant is the immediate focus, I also keep Google API and Gorq API integrations on the roadmap, so designing the code in a way that lets me add further REST endpoints later would be a bonus. Deliverables • Fully commented Python code (Python 3.10+) that authenticates and performs the core CRUD operations against the Home Assistant API. • A short demo script (CLI or Jupyter notebook) that shows the module in action. • README explaining setup, dependencies, and example calls. Acceptance criteria • I can run the demo script locally, pass in my Home Assistant URL and token, and see entity state updates reflected in the dashboard. • Code follows PEP 8, runs without warnings, and contains docstrings for each public method. • All external calls are wrapped with proper error handling (network timeouts, bad credentials, unavailable endpoints). If you’ve already worked with Home Assistant’s REST endpoints or its WebSocket streaming API, mention it—this project will move quickly once I can review your previous work.