File tree 1 file changed +5
-2
lines changed 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -52,7 +52,6 @@ class InvalidStateError(Exception):
52
52
class DoneException (Exception ):
53
53
pass
54
54
55
-
56
55
def timestamp ():
57
56
return int (time .time ())
58
57
@@ -110,9 +109,12 @@ def runnable(self):
110
109
def value (self , value ):
111
110
if value is not None :
112
111
if self .value is not None :
112
+ # This is a workaround for the cloud float/int conversion bug.
113
+ if isinstance (self .value , float ) and isinstance (value , int ):
114
+ value = float (value )
113
115
if not isinstance (self .value , type (value )):
114
116
raise TypeError (
115
- f"record: { self .name } invalid data type. Expected { type (self .value )} not { type (value )} "
117
+ f"{ self .name } set to invalid data type, expected: { type (self .value )} got: { type (value )} "
116
118
)
117
119
self ._updated = True
118
120
self .timestamp = timestamp ()
@@ -375,5 +377,6 @@ async def run(self, user_main=None):
375
377
logging .error (f"task: { name } raised exception: { str (task_except )} ." )
376
378
if name == "mqtt_task" :
377
379
self .create_task ("conn_task" , self .conn_task )
380
+ break # Break after the first task is removed.
378
381
except (CancelledError , InvalidStateError ):
379
382
pass
You can’t perform that action at this time.
0 commit comments