wyze_set_color_temp
Adjust the color temperature of Wyze smart lights from warm (2700K) to cool (6500K) to match activities or preferences.
Instructions
Set color temperature for a Wyze light (2700K-6500K)
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| device_mac | Yes | ||
| color_temp | Yes |
Implementation Reference
- src/mcp_wyze_server/server.py:412-437 (handler)The handler function decorated with @mcp.tool(), implementing the logic to set color temperature on a Wyze light device. Validates input range, finds device by MAC, calls Wyze API, and returns status.@mcp.tool() def wyze_set_color_temp(device_mac: str, color_temp: int) -> Dict[str, str]: """Set color temperature for a Wyze light (2700K-6500K)""" try: if not 2700 <= color_temp <= 6500: return {"status": "error", "message": "Color temperature must be between 2700K and 6500K"} client = get_wyze_client() devices = client.devices_list() for device in devices: if device.mac == device_mac and getattr(device, 'product_type', 'Unknown') in ['Light', 'Bulb', 'MeshLight', 'LightStrip']: client.bulbs.set_color_temp( device_mac=device_mac, device_model=getattr(device, 'product_model', 'Unknown'), color_temp=color_temp ) return {"status": "success", "message": f"Set {device.nickname} color temperature to {color_temp}K"} return {"status": "error", "message": f"Light with MAC {device_mac} not found"} except WyzeClientConfigurationError as e: return {"status": "error", "message": f"Configuration error: {str(e)}"} except WyzeRequestError as e: return {"status": "error", "message": f"API error: {str(e)}"} except Exception as e: return {"status": "error", "message": f"Unexpected error: {str(e)}"}