Skip to content

Commit

Permalink
fix: sensor code spacing (#10)
Browse files Browse the repository at this point in the history
  • Loading branch information
yo-han authored Jan 2, 2023
1 parent 1613a6c commit 4ac9a82
Showing 1 changed file with 21 additions and 21 deletions.
42 changes: 21 additions & 21 deletions custom_components/carelink/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,26 +161,26 @@ async def _async_update_data(self):
data[SENSOR_KEY_LASTSG_MGDL] = None
data[SENSOR_KEY_LASTSG_TIMESTAMP] = None

# Sensors

data[SENSOR_KEY_PUMP_BATTERY_LEVEL] = recent_data.setdefault(
"medicalDeviceBatteryLevelPercent", UNAVAILABLE)
data[SENSOR_KEY_CONDUIT_BATTERY_LEVEL] = recent_data.setdefault(
"conduitBatteryLevel", UNAVAILABLE)
data[SENSOR_KEY_SENSOR_BATTERY_LEVEL] = recent_data.setdefault(
"gstBatteryLevel", UNAVAILABLE)
data[SENSOR_KEY_SENSOR_DURATION_HOURS] = recent_data.setdefault(
"sensorDurationHours", UNAVAILABLE)
data[SENSOR_KEY_SENSOR_DURATION_MINUTES] = recent_data.setdefault(
"sensorDurationMinutes", UNAVAILABLE)
data[SENSOR_KEY_RESERVOIR_LEVEL] = recent_data.setdefault(
"reservoirLevelPercent", UNAVAILABLE)
data[SENSOR_KEY_RESERVOIR_AMOUNT] = recent_data.setdefault(
"reservoirAmount", UNAVAILABLE)
data[SENSOR_KEY_RESERVOIR_REMAINING_UNITS] = recent_data.setdefault(
"reservoirRemainingUnits", UNAVAILABLE)
data[SENSOR_KEY_LASTSG_TREND] = recent_data.setdefault(
"lastSGTrend", UNAVAILABLE)
# Sensors

data[SENSOR_KEY_PUMP_BATTERY_LEVEL] = recent_data.setdefault(
"medicalDeviceBatteryLevelPercent", UNAVAILABLE)
data[SENSOR_KEY_CONDUIT_BATTERY_LEVEL] = recent_data.setdefault(
"conduitBatteryLevel", UNAVAILABLE)
data[SENSOR_KEY_SENSOR_BATTERY_LEVEL] = recent_data.setdefault(
"gstBatteryLevel", UNAVAILABLE)
data[SENSOR_KEY_SENSOR_DURATION_HOURS] = recent_data.setdefault(
"sensorDurationHours", UNAVAILABLE)
data[SENSOR_KEY_SENSOR_DURATION_MINUTES] = recent_data.setdefault(
"sensorDurationMinutes", UNAVAILABLE)
data[SENSOR_KEY_RESERVOIR_LEVEL] = recent_data.setdefault(
"reservoirLevelPercent", UNAVAILABLE)
data[SENSOR_KEY_RESERVOIR_AMOUNT] = recent_data.setdefault(
"reservoirAmount", UNAVAILABLE)
data[SENSOR_KEY_RESERVOIR_REMAINING_UNITS] = recent_data.setdefault(
"reservoirRemainingUnits", UNAVAILABLE)
data[SENSOR_KEY_LASTSG_TREND] = recent_data.setdefault(
"lastSGTrend", UNAVAILABLE)

if "amount" in recent_data["activeInsulin"]:
# Active insulin sensor
Expand Down Expand Up @@ -215,7 +215,7 @@ async def _async_update_data(self):
data[SENSOR_KEY_ACTIVE_INSULIN] = None
data[SENSOR_KEY_ACTIVE_INSULIN_ATTRS] = {}

data[SENSOR_KEY_ACTIVE_BASAL_PATTERN] = recent_data["basel"].setdefault(
data[SENSOR_KEY_ACTIVE_BASAL_PATTERN] = recent_data["basal"].setdefault(
"activeBasalPattern", UNAVAILABLE)
data[SENSOR_KEY_AVG_GLUCOSE_MMOL] = float(
round(recent_data.setdefault(
Expand Down

0 comments on commit 4ac9a82

Please sign in to comment.