Skip to main content
Glama

Home Assistant MCP Server

by miguelg719
_base.py1.03 kB
from typing import TypeVar, Generic, Dict, Any from ..models.entity import EntityDomain, EntityDescription, BaseEntityState StateT = TypeVar('StateT', bound=BaseEntityState) DescT = TypeVar('DescT', bound=EntityDescription) class BaseService(Generic[StateT, DescT]): domain: EntityDomain tools: Dict[str, Dict[str, Any]] def __init__(self, call_service, get_state): self._call_service = call_service self._get_state = get_state async def call_domain_service(self, service: str, data: dict) -> dict: """Call a service within this domain""" return await self._call_service(self.domain, service, data) async def get_entity_state(self, entity_id: str) -> dict: """Get state for an entity in this domain""" return await self._get_state(f"{self.domain.value}.{entity_id}") @classmethod def get_available_entities(cls) -> Dict[str, DescT]: """Override to provide domain-specific entities""" raise NotImplementedError

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/miguelg719/home-assistant-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server