Commit 3084c78 1 parent 0ca70bc commit 3084c78 Copy full SHA for 3084c78
File tree 2 files changed +8
-8
lines changed
custom_components/eldes_alarm
2 files changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -62,8 +62,14 @@ def extra_state_attributes(self):
62
62
def icon (self ):
63
63
"""Return the icon of this sensor."""
64
64
try :
65
- return OUTPUT_ICONS_MAP [self .data ["outputs" ][self .entity_index ]["iconName" ]]
66
- except ValueError :
65
+ iconName = self .data ["outputs" ][self .entity_index ]["iconName" ]
66
+
67
+ if iconName is not None :
68
+ return OUTPUT_ICONS_MAP [iconName ]
69
+
70
+ return OUTPUT_ICONS_MAP ["ICON_1" ]
71
+
72
+ except Exception :
67
73
_LOGGER .info ("Unknown output icon for (%s)" , self .data ['outputs' ][self .entity_index ]['name' ])
68
74
return OUTPUT_ICONS_MAP ["ICON_1" ]
69
75
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " Eldes Alarm" ,
3
- "domains" : [
4
- " alarm_control_panel" ,
5
- " binary_sensor" ,
6
- " sensor" ,
7
- " switch"
8
- ],
9
3
"render_readme" : true
10
4
}
You can’t perform that action at this time.
0 commit comments