File tree Expand file tree Collapse file tree 2 files changed +8
-6
lines changed
custom_components/battery_notes Expand file tree Collapse file tree 2 files changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -111,8 +111,9 @@ async def async_step_user(
111111 device_id = user_input [CONF_DEVICE_ID ]
112112
113113 if DOMAIN in self .hass .data :
114- coordinator = self .hass .data [DOMAIN ][DATA_UPDATE_COORDINATOR ]
115- await coordinator .async_refresh ()
114+ if DATA_UPDATE_COORDINATOR in self .hass .data [DOMAIN ]:
115+ coordinator = self .hass .data [DOMAIN ][DATA_UPDATE_COORDINATOR ]
116+ await coordinator .async_refresh ()
116117
117118 device_registry = dr .async_get (self .hass )
118119 device_entry = device_registry .async_get (device_id )
@@ -140,9 +141,10 @@ async def async_step_user(
140141 schema = DEVICE_SCHEMA
141142 # If show_all_devices = is specified and true, don't filter
142143 if DOMAIN in self .hass .data :
143- domain_config = self .hass .data [DOMAIN ][DOMAIN_CONFIG ]
144- if domain_config .get (CONF_SHOW_ALL_DEVICES , False ):
145- schema = DEVICE_SCHEMA_ALL
144+ if DOMAIN_CONFIG in self .hass .data [DOMAIN ]:
145+ domain_config = self .hass .data [DOMAIN ][DOMAIN_CONFIG ]
146+ if domain_config .get (CONF_SHOW_ALL_DEVICES , False ):
147+ schema = DEVICE_SCHEMA_ALL
146148
147149 return self .async_show_form (
148150 step_id = "user" ,
Original file line number Diff line number Diff line change 99 "integration_type" : " device" ,
1010 "iot_class" : " calculated" ,
1111 "issue_tracker" : " https://github.com/andrew-codechimp/ha-battery-notes/issues" ,
12- "version" : " 1.3.1 "
12+ "version" : " 1.3.2 "
1313}
You can’t perform that action at this time.
0 commit comments