From 2bb772bbdcc116efad84f7350cb1fe9fb9bdeeb0 Mon Sep 17 00:00:00 2001 From: Robbie Trencheny Date: Thu, 18 Apr 2019 13:46:49 -0700 Subject: [PATCH] Set encoding before connecting (#23204) --- homeassistant/components/mikrotik/device_tracker.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/homeassistant/components/mikrotik/device_tracker.py b/homeassistant/components/mikrotik/device_tracker.py index 0c3b6b313f1f0..3709bc476f5bc 100644 --- a/homeassistant/components/mikrotik/device_tracker.py +++ b/homeassistant/components/mikrotik/device_tracker.py @@ -55,13 +55,13 @@ def __init__(self, config): self.username = config[CONF_USERNAME] self.password = config[CONF_PASSWORD] self.method = config.get(CONF_METHOD) + self.encoding = config[CONF_ENCODING] self.connected = False self.success_init = False self.client = None self.wireless_exist = None self.success_init = self.connect_to_device() - self.encoding = config[CONF_ENCODING] if self.success_init: _LOGGER.info("Start polling Mikrotik (%s) router...", self.host)