mirror of
https://github.com/PrefectHQ/fastmcp.git
synced 2026-08-21 21:14:17 +02:00
example: allow any str for bridge IP
This commit is contained in:
parent
bfa8ec43c1
commit
2ff72476b1
3 changed files with 4 additions and 4 deletions
|
|
@ -16,7 +16,7 @@ def hub_status() -> str:
|
|||
"""Checks the status of the main hub and connections."""
|
||||
try:
|
||||
bridge = Bridge(
|
||||
ip=str(settings.hue_bridge_ip),
|
||||
ip=settings.hue_bridge_ip,
|
||||
username=settings.hue_bridge_username,
|
||||
save_config=False,
|
||||
)
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ def _get_bridge() -> Bridge | None:
|
|||
"""Attempts to connect to the Hue bridge using settings."""
|
||||
try:
|
||||
return Bridge(
|
||||
ip=str(settings.hue_bridge_ip),
|
||||
ip=settings.hue_bridge_ip,
|
||||
username=settings.hue_bridge_username,
|
||||
save_config=False,
|
||||
)
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
from pydantic import AnyHttpUrl, Field
|
||||
from pydantic import Field
|
||||
from pydantic_settings import BaseSettings, SettingsConfigDict
|
||||
|
||||
|
||||
class Settings(BaseSettings):
|
||||
model_config = SettingsConfigDict(env_file=".env", extra="ignore")
|
||||
|
||||
hue_bridge_ip: AnyHttpUrl = Field(default=...)
|
||||
hue_bridge_ip: str = Field(default=...)
|
||||
hue_bridge_username: str = Field(default=...)
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue