-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathveratemps.py
More file actions
35 lines (26 loc) · 945 Bytes
/
veratemps.py
File metadata and controls
35 lines (26 loc) · 945 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
'''
Created on 31 Jul 2016
@author: steph
'''
import requests
import ast
import logging
from variables import Variables
module_logger = logging.getLogger("main.veratemps")
class VeraVirtualTemps(object):
'''
classdocs
'''
def veraSendTemp(self, roomID, temp):
logger = logging.getLogger("main.veratemps.veraSendTemps")
veraSendCommand = Variables().readVariables(['VeraUpdateTemps'])
try:
sendString = veraSendCommand.format(roomID, temp)
logger.debug("Sending to Vera {}".format (sendString))
_ = requests.get(sendString, timeout=5)
except Exception, err:
logger.info("vera send fault{}".format (err))
def veraRoomDict(self, roomString):
newString = roomString.replace(";", ",")
roomDict = ast.literal_eval(newString)
return roomDict