Skip to content

Commit a47795e

Browse files
authored
Merge pull request #64 from claudegel/call
Fix blocking call warning
2 parents 3aff8cf + f8fe5a4 commit a47795e

File tree

6 files changed

+9
-9
lines changed

6 files changed

+9
-9
lines changed

custom_components.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"sinope": {
3-
"version": "1.6.6",
3+
"version": "1.6.7",
44
"local_location": "/custom_components/sinope/__init__.py",
55
"remote_location": "https://github.com/claudegel/sinope-gt125/tree/master/custom_components/__init__.py",
66
"visit_repo": "https://github.com/claudegel/sinope-gt125",

custom_components/sinope/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343

4444
#REQUIREMENTS = ['PY_Sinope==0.1.7']
4545
REQUIREMENTS = ['crc8==0.1.0']
46-
VERSION = '1.6.6'
46+
VERSION = '1.6.7'
4747

4848
DATA_DOMAIN = 'data_' + DOMAIN
4949

custom_components/sinope/climate.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ async def async_setup_platform(
206206
data = hass.data[sinope.DATA_DOMAIN]
207207
CONF_file = CONFDIR + "sinope_devices.json"
208208
dev_list = []
209-
with open(CONF_file) as f:
209+
with await hass.async_add_executor_job(open, CONF_file) as f:
210210
for line in f:
211211
dev_list.append(json.loads(line))
212212
f.close()
@@ -228,7 +228,7 @@ async def async_setup_platform(
228228
if os.path.exists(CONFDIR+'sinope_devices_2.json') == True:
229229
CONF_file_2 = CONFDIR + "sinope_devices_2.json"
230230
dev_list_2 = []
231-
with open(CONF_file_2) as g:
231+
with await hass.async_add_executor_job(open, CONF_file_2) as g:
232232
for line in g:
233233
dev_list_2.append(json.loads(line))
234234
g.close()

custom_components/sinope/light.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ async def async_setup_platform(
143143
data = hass.data[sinope.DATA_DOMAIN]
144144
CONF_file = CONFDIR + "sinope_devices.json"
145145
dev_list = []
146-
with open(CONF_file) as f:
146+
with await hass.async_add_executor_job(open, CONF_file) as f:
147147
for line in f:
148148
dev_list.append(json.loads(line))
149149
f.close()
@@ -168,7 +168,7 @@ async def async_setup_platform(
168168
if os.path.exists(CONFDIR+'sinope_devices_2.json') == True:
169169
CONF_file_2 = CONFDIR + "sinope_devices_2.json"
170170
dev_list_2 = []
171-
with open(CONF_file_2) as g:
171+
with await hass.async_add_executor_job(open, CONF_file_2) as g:
172172
for line in g:
173173
dev_list_2.append(json.loads(line))
174174
g.close()

custom_components/sinope/manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@
55
"dependencies": [],
66
"codeowners": ["@claudegel"],
77
"requirements": ["crc8==0.1.0"],
8-
"version": "1.6.6"
8+
"version": "1.6.7"
99
}

custom_components/sinope/switch.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ async def async_setup_platform(
109109
data = hass.data[sinope.DATA_DOMAIN]
110110
CONF_file = CONFDIR + "sinope_devices.json"
111111
dev_list = []
112-
with open(CONF_file) as f:
112+
with await hass.async_add_executor_job(open, CONF_file) as f:
113113
for line in f:
114114
dev_list.append(json.loads(line))
115115
f.close()
@@ -131,7 +131,7 @@ async def async_setup_platform(
131131
if os.path.exists(CONFDIR+'sinope_devices_2.json') == True:
132132
CONF_file_2 = CONFDIR + "sinope_devices_2.json"
133133
dev_list_2 = []
134-
with open(CONF_file_2) as g:
134+
with await hass.async_add_executor_job(open, CONF_file_2) as g:
135135
for line in g:
136136
dev_list_2.append(json.loads(line))
137137
g.close()

0 commit comments

Comments
 (0)