File tree Expand file tree Collapse file tree 2 files changed +14
-5
lines changed
custom_components/homeassistantedupage Expand file tree Collapse file tree 2 files changed +14
-5
lines changed Original file line number Diff line number Diff line change @@ -73,7 +73,7 @@ async def get_notifications(self):
73
73
74
74
try :
75
75
all_notifications = await self .hass .async_add_executor_job (self .api .get_notifications )
76
- _LOGGER .info (f"EDUPAGE Notifications found %s" , all_notifications )
76
+ _LOGGER .debug (f"EDUPAGE Notifications found %s" , all_notifications )
77
77
return all_notifications
78
78
except Exception as e :
79
79
raise UpdateFailed (F"EDUPAGE error updating get_notifications() data from API: { e } " )
Original file line number Diff line number Diff line change @@ -88,8 +88,13 @@ def extra_state_attributes(self):
88
88
if not self ._grades :
89
89
return {"info" : "no grades yet" }
90
90
91
- attributes = {"student" : self ._student_name }
92
- attributes = {"unique_id" : self ._unique_id }
91
+ attributes = {}
92
+
93
+ attributes = {
94
+ "student" : self .coordinator .data .get ("student" , {}),
95
+ "unique_id" : self ._unique_id
96
+ }
97
+
93
98
for i , grade in enumerate (self ._grades ):
94
99
attributes [f"grade_{ i + 1 } _title" ] = grade .title
95
100
attributes [f"grade_{ i + 1 } _grade_n" ] = grade .grade_n
@@ -132,8 +137,12 @@ def state(self):
132
137
def extra_state_attributes (self ):
133
138
"""Return additional attributes."""
134
139
135
- attributes = {"student" : self ._student_name }
136
- attributes = {"unique_id" : self ._unique_id }
140
+ attributes = {}
141
+
142
+ attributes = {
143
+ "student" : self .coordinator .data .get ("student" , {}),
144
+ "unique_id" : self ._unique_id
145
+ }
137
146
138
147
for i , event in enumerate (self ._notifications ):
139
148
if event .event_type == EventType .HOMEWORK :
You can’t perform that action at this time.
0 commit comments