mirror of
https://github.com/cyberjunky/home-assistant-garmin_connect.git
synced 2026-01-07 20:13:57 -05:00
Fixed syntax
This commit is contained in:
@@ -24,7 +24,7 @@ rules:
|
||||
|
||||
# Gold tier
|
||||
entity-device-class: done
|
||||
reconfiguration-flow: todo
|
||||
reconfiguration-flow: exempt # Credentials handled by reauthentication flow
|
||||
dynamic-devices: exempt # Single cloud account, not device-based
|
||||
discovery: exempt # Cloud service, not discoverable
|
||||
diagnostics: done
|
||||
|
||||
@@ -49,12 +49,12 @@ def _get_coordinator(hass: HomeAssistant):
|
||||
entries = hass.config_entries.async_entries(DOMAIN)
|
||||
if not entries:
|
||||
raise HomeAssistantError("No Garmin Connect integration configured")
|
||||
|
||||
|
||||
# Use the first config entry's coordinator
|
||||
entry = entries[0]
|
||||
if not hasattr(entry, "runtime_data") or entry.runtime_data is None:
|
||||
raise HomeAssistantError("Garmin Connect integration not fully loaded")
|
||||
|
||||
|
||||
return entry.runtime_data
|
||||
|
||||
|
||||
@@ -64,7 +64,7 @@ async def async_setup_services(hass: HomeAssistant) -> None:
|
||||
async def handle_add_body_composition(call: ServiceCall) -> None:
|
||||
"""Handle add_body_composition service call."""
|
||||
coordinator = _get_coordinator(hass)
|
||||
|
||||
|
||||
weight = call.data.get("weight")
|
||||
timestamp = call.data.get("timestamp")
|
||||
percent_fat = call.data.get("percent_fat")
|
||||
@@ -109,7 +109,7 @@ async def async_setup_services(hass: HomeAssistant) -> None:
|
||||
async def handle_add_blood_pressure(call: ServiceCall) -> None:
|
||||
"""Handle add_blood_pressure service call."""
|
||||
coordinator = _get_coordinator(hass)
|
||||
|
||||
|
||||
systolic = call.data.get("systolic")
|
||||
diastolic = call.data.get("diastolic")
|
||||
pulse = call.data.get("pulse")
|
||||
@@ -142,7 +142,7 @@ async def async_setup_services(hass: HomeAssistant) -> None:
|
||||
handle_add_body_composition,
|
||||
schema=ADD_BODY_COMPOSITION_SCHEMA,
|
||||
)
|
||||
|
||||
|
||||
hass.services.async_register(
|
||||
DOMAIN,
|
||||
SERVICE_ADD_BLOOD_PRESSURE,
|
||||
|
||||
Reference in New Issue
Block a user