diff --git a/custom_components/lock-manager/__init__.py b/custom_components/lock-manager/__init__.py index 4d3a9e3..4d3daea 100644 --- a/custom_components/lock-manager/__init__.py +++ b/custom_components/lock-manager/__init__.py @@ -41,14 +41,16 @@ async def async_setup_entry(hass, config_entry): VERSION, ISSUE_URL, ) + generate_package = None # grab the bool before we change it - generate_package = config_entry.data[CONF_GENERATE] + if CONF_GENERATE in config_entry.data.keys(): + generate_package = config_entry.data[CONF_GENERATE] - # extract the data and manipulate it - config = {k: v for k, v in config_entry.data.items()} - config.pop(CONF_GENERATE) - config_entry.data = config + # extract the data and manipulate it + config = {k: v for k, v in config_entry.data.items()} + config.pop(CONF_GENERATE) + config_entry.data = config config_entry.options = config_entry.data config_entry.add_update_listener(update_listener) @@ -189,7 +191,7 @@ async def _generate_package(service): ) # if the use turned on the bool generate the files - if generate_package: + if generate_package is not None: servicedata = {"lockname": config_entry.options[CONF_LOCK_NAME]} await hass.services.async_call(DOMAIN, SERVICE_GENERATE_PACKAGE, servicedata) diff --git a/custom_components/lock-manager/const.py b/custom_components/lock-manager/const.py index 5654fe0..f287482 100644 --- a/custom_components/lock-manager/const.py +++ b/custom_components/lock-manager/const.py @@ -1,5 +1,5 @@ DOMAIN = "lock-manager" -VERSION = "0.0.22" +VERSION = "0.0.23" ISSUE_URL = "https://github.com/FutureTense/lock-manager" # Configuration Properties diff --git a/custom_components/lock-manager/lock_manager.yaml b/custom_components/lock-manager/lock_manager.yaml index adfb264..70a1440 100644 --- a/custom_components/lock-manager/lock_manager.yaml +++ b/custom_components/lock-manager/lock_manager.yaml @@ -7,12 +7,6 @@ input_number: step: 1 unit_of_measurement: "Openings Left" - LOCKNAME_pin_TEMPLATENUM: - name: "PIN" - mode: box - min: 4 - max: 8 - ################# input_datetime: ############## input_datetime: end_date_LOCKNAME_TEMPLATENUM: @@ -92,6 +86,9 @@ input_text: LOCKNAME_name_TEMPLATENUM: name: "Name" + LOCKNAME_pin_TEMPLATENUM: + name: "PIN" + ################# input_boolean: ################ input_boolean: notify_LOCKNAME_TEMPLATENUM: