mirror of
https://github.com/cyberjunky/home-assistant-garmin_connect.git
synced 2026-01-07 20:13:57 -05:00
Preserve more values, remove debug lines
This commit is contained in:
@@ -261,10 +261,6 @@ class GarminConnectDataUpdateCoordinator(DataUpdateCoordinator):
|
||||
(today - timedelta(days=30)).isoformat(),
|
||||
today.isoformat(),
|
||||
)
|
||||
_LOGGER.debug(
|
||||
"Blood pressure API response: type=%s",
|
||||
type(bp_response).__name__,
|
||||
)
|
||||
# API returns dict with measurementSummaries containing measurements
|
||||
if bp_response and isinstance(bp_response, dict):
|
||||
summaries = bp_response.get("measurementSummaries", [])
|
||||
@@ -282,9 +278,6 @@ class GarminConnectDataUpdateCoordinator(DataUpdateCoordinator):
|
||||
"measurementTimestampLocal"
|
||||
),
|
||||
}
|
||||
_LOGGER.debug(
|
||||
"Blood pressure data parsed: %s", blood_pressure_data
|
||||
)
|
||||
except Exception as err:
|
||||
_LOGGER.debug("Blood pressure data not available: %s", err)
|
||||
|
||||
|
||||
@@ -1079,6 +1079,7 @@ BLOOD_PRESSURE_SENSORS: tuple[GarminConnectSensorEntityDescription, ...] = (
|
||||
native_unit_of_measurement="mmHg",
|
||||
state_class=SensorStateClass.MEASUREMENT,
|
||||
icon="mdi:heart-pulse",
|
||||
preserve_value=True,
|
||||
),
|
||||
GarminConnectSensorEntityDescription(
|
||||
key="bpDiastolic",
|
||||
@@ -1086,6 +1087,7 @@ BLOOD_PRESSURE_SENSORS: tuple[GarminConnectSensorEntityDescription, ...] = (
|
||||
native_unit_of_measurement="mmHg",
|
||||
state_class=SensorStateClass.MEASUREMENT,
|
||||
icon="mdi:heart-pulse",
|
||||
preserve_value=True,
|
||||
),
|
||||
GarminConnectSensorEntityDescription(
|
||||
key="bpPulse",
|
||||
@@ -1093,6 +1095,7 @@ BLOOD_PRESSURE_SENSORS: tuple[GarminConnectSensorEntityDescription, ...] = (
|
||||
native_unit_of_measurement="bpm",
|
||||
state_class=SensorStateClass.MEASUREMENT,
|
||||
icon="mdi:heart",
|
||||
preserve_value=True,
|
||||
),
|
||||
GarminConnectSensorEntityDescription(
|
||||
key="bpMeasurementTime",
|
||||
@@ -1100,6 +1103,7 @@ BLOOD_PRESSURE_SENSORS: tuple[GarminConnectSensorEntityDescription, ...] = (
|
||||
device_class=SensorDeviceClass.TIMESTAMP,
|
||||
icon="mdi:clock-outline",
|
||||
value_fn=lambda data: data.get("bpMeasurementTime"),
|
||||
preserve_value=True,
|
||||
),
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user