Skip to content

Commit

Permalink
Fixed config flow and renamed sensor
Browse files Browse the repository at this point in the history
  • Loading branch information
PTST committed Feb 23, 2024
1 parent 295abd0 commit 7b13d14
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions custom_components/libreview/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ async def async_step_init(
if self.entry.data.get(CONF_SENSOR_DURATION) is not None:
default_duration = int(self.entry.data.get(CONF_SENSOR_DURATION))

default_show_trend = 14
default_show_trend = False
if self.entry.data.get(CONF_SHOW_TREND_ARROW) is not None:
default_show_trend = bool(self.entry.data.get(CONF_SHOW_TREND_ARROW))

Expand Down Expand Up @@ -121,7 +121,7 @@ async def async_step_options(
data_schema=vol.Schema(
{vol.Required(CONF_UOM): vol.In(GlucoseUnitOfMeasurement),
vol.Required(CONF_SENSOR_DURATION, default=14): int,
vol.Required(CONF_SHOW_TREND_ARROW, default=default_show_trend): bool},
vol.Required(CONF_SHOW_TREND_ARROW, default=False): bool},
),
)

Expand Down
2 changes: 1 addition & 1 deletion custom_components/libreview/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ def trend_arrow(self) -> int:
def name(self) -> str:
"""Return the name of the entity."""
name = f"{self.connection.first_name } {self.connection.last_name}"
return f"{name} Glucose Measurement"
return f"{name} glucose level"

@property
def native_value(self) -> int | float | None:
Expand Down

0 comments on commit 7b13d14

Please sign in to comment.