Skip to content

Commit

Permalink
Fix only return bills if requested
Browse files Browse the repository at this point in the history
  • Loading branch information
soloam committed May 3, 2024
1 parent c0889e2 commit 4d60c10
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions custom_components/fireflyiii_integration/calendar.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,18 +43,20 @@ async def async_setup_entry(
if config_entry.options:
config.update(config_entry.options)

coordinator = config[COORDINATOR]
coordinator: FireflyiiiCoordinator = config[COORDINATOR]

user_locale = get_hass_locale(hass)

bills = []
obj = FireflyiiiBillCalendarEntity(
coordinator,
FIREFLYIII_SENSOR_DESCRIPTIONS[FireflyiiiObjectType.BILLS],
locale=user_locale,
)

bills.append(obj)
if coordinator.user_data.get_bills:
obj = FireflyiiiBillCalendarEntity(
coordinator,
FIREFLYIII_SENSOR_DESCRIPTIONS[FireflyiiiObjectType.BILLS],
locale=user_locale,
)

bills.append(obj)

calendars = []
calendars.extend(bills)
Expand Down

0 comments on commit 4d60c10

Please sign in to comment.