π The fast, Pythonic way to build MCP servers and clients.
fix phue2 import in smart_home example (#2999)
nate nowack5da65096fcef
diff --git a/examples/smart_home/src/smart_home/hub.py b/examples/smart_home/src/smart_home/hub.pyindex 1840327bd..827eae159 100644--- a/examples/smart_home/src/smart_home/hub.py+++ b/examples/smart_home/src/smart_home/hub.py@@ -1,5 +1,5 @@from mcp.types import ToolAnnotations-from phue2 import Bridge+from phue import Bridgefrom fastmcp import FastMCPfrom smart_home.lights.server import lights_mcpdiff --git a/examples/smart_home/src/smart_home/lights/hue_utils.py b/examples/smart_home/src/smart_home/lights/hue_utils.pyindex 1758f2841..4ec5e7106 100644--- a/examples/smart_home/src/smart_home/lights/hue_utils.py+++ b/examples/smart_home/src/smart_home/lights/hue_utils.py@@ -1,7 +1,7 @@from typing import Any-from phue2 import Bridge-from phue2.exceptions import PhueException+from phue import Bridge+from phue.exceptions import PhueExceptionfrom smart_home.settings import settings@@ -23,12 +23,12 @@ def _get_bridge() -> Bridge | None:def handle_phue_error(light_or_group: str, operation: str, error: Exception) -> dict[str, Any]:- """Creates a standardized error response for phue2 operations."""+ """Creates a standardized error response for phue operations."""base_info = {"target": light_or_group, "operation": operation, "success": False}if isinstance(error, KeyError):base_info["error"] = f"Target '{light_or_group}' not found"elif isinstance(error, PhueException):- base_info["error"] = f"phue2 error during {operation}: {error}"+ base_info["error"] = f"phue error during {operation}: {error}"else:base_info["error"] = f"Unexpected error during {operation}: {error}"return base_infodiff --git a/examples/smart_home/src/smart_home/lights/server.py b/examples/smart_home/src/smart_home/lights/server.pyindex db4c41a6a..c2c835d2d 100644--- a/examples/smart_home/src/smart_home/lights/server.py+++ b/examples/smart_home/src/smart_home/lights/server.py@@ -8,7 +8,7 @@from typing import Annotated, Any, Literal, TypedDictfrom mcp.types import ToolAnnotations-from phue2.exceptions import PhueException+from phue.exceptions import PhueExceptionfrom pydantic import Fieldfrom typing_extensions import NotRequired