Skip to content

Commit 4d60c10

Browse files
committed
Fix only return bills if requested
1 parent c0889e2 commit 4d60c10

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

custom_components/fireflyiii_integration/calendar.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -43,18 +43,20 @@ async def async_setup_entry(
4343
if config_entry.options:
4444
config.update(config_entry.options)
4545

46-
coordinator = config[COORDINATOR]
46+
coordinator: FireflyiiiCoordinator = config[COORDINATOR]
4747

4848
user_locale = get_hass_locale(hass)
4949

5050
bills = []
51-
obj = FireflyiiiBillCalendarEntity(
52-
coordinator,
53-
FIREFLYIII_SENSOR_DESCRIPTIONS[FireflyiiiObjectType.BILLS],
54-
locale=user_locale,
55-
)
5651

57-
bills.append(obj)
52+
if coordinator.user_data.get_bills:
53+
obj = FireflyiiiBillCalendarEntity(
54+
coordinator,
55+
FIREFLYIII_SENSOR_DESCRIPTIONS[FireflyiiiObjectType.BILLS],
56+
locale=user_locale,
57+
)
58+
59+
bills.append(obj)
5860

5961
calendars = []
6062
calendars.extend(bills)

0 commit comments

Comments
 (0)