From 4018d0a1523e547117cfb1f5c17a57bd5a50d722 Mon Sep 17 00:00:00 2001 From: Jan-Philipp Litza Date: Sun, 7 Mar 2021 13:53:48 +0100 Subject: [PATCH] Correctly close lacrosse on homeassistant stop (#47555) Since lacrosse.close() takes no arguments, but was directly added as a listener to EVENT_HOMEASSISTANT_STOP, the following occured on shutdown: Traceback (most recent call last): File "/usr/lib/python/concurrent/futures/thread.py", line 57, in run result = self.fn(*self.args, **self.kwargs) TypeError: close() takes 1 positional argument but 2 were given --- homeassistant/components/lacrosse/sensor.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/homeassistant/components/lacrosse/sensor.py b/homeassistant/components/lacrosse/sensor.py index 2c7f5d294a9..f65c792ddb0 100644 --- a/homeassistant/components/lacrosse/sensor.py +++ b/homeassistant/components/lacrosse/sensor.py @@ -78,7 +78,7 @@ def setup_platform(hass, config, add_entities, discovery_info=None): _LOGGER.warning("Unable to open serial port: %s", exc) return False - hass.bus.listen_once(EVENT_HOMEASSISTANT_STOP, lacrosse.close) + hass.bus.listen_once(EVENT_HOMEASSISTANT_STOP, lambda event: lacrosse.close()) if CONF_JEELINK_LED in config: lacrosse.led_mode_state(config.get(CONF_JEELINK_LED))