From 3f2f614e1e1b7fecd7daaba176a84b31d4c76b68 Mon Sep 17 00:00:00 2001 From: Ryan Winter Date: Mon, 27 Feb 2023 12:46:36 -0800 Subject: [PATCH] fix error if keys dont exist --- custom_components/rainforest_emu_2/__init__.py | 2 +- custom_components/rainforest_emu_2/manifest.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/custom_components/rainforest_emu_2/__init__.py b/custom_components/rainforest_emu_2/__init__.py index 12c5c9a..ecbf19f 100755 --- a/custom_components/rainforest_emu_2/__init__.py +++ b/custom_components/rainforest_emu_2/__init__.py @@ -77,7 +77,7 @@ def __init__( self._current_usage = None self._current_usage_start_date = dt.utc_from_timestamp(0) - self._emu2 = Emu2(properties[ATTR_DEVICE_PATH], properties[CONF_HOST], properties[CONF_PORT]) + self._emu2 = Emu2(properties.get(ATTR_DEVICE_PATH, ""), properties.get(CONF_HOST, ""), properties.get(CONF_PORT, 0)) self._emu2.register_process_callback(self._process_update) self._serial_loop_task = self._hass.loop.create_task(self._emu2.serial_read()) diff --git a/custom_components/rainforest_emu_2/manifest.json b/custom_components/rainforest_emu_2/manifest.json index 62ba392..843c9ae 100755 --- a/custom_components/rainforest_emu_2/manifest.json +++ b/custom_components/rainforest_emu_2/manifest.json @@ -9,7 +9,7 @@ "pyserial-asyncio==0.6" ], "iot_class": "local_polling", - "version": "1.3.1", + "version": "1.3.2", "config_flow": true, "usb": [ {