1st Simple Python Task - not working as expected

Posted on
Sun Apr 10, 2016 10:41 am
Busta999 offline
User avatar
Posts: 714
Joined: Mar 30, 2016
Location: Wales UK

Re: 1st Simple Python Task - not working as expected

DaveL17 wrote:
Hi Jon!

Agree with you completely in principle.

But with your example, it occurs to me that--if the original variable contains a string, let's say--the var.get() will return the number 40.0 instead of throwing an error. In Busta999's case, the number 40.0 is the adjustment factor and not the value to be adjusted. So the result of the script (if there's not a valid temperature to start with) will always be zero. Maybe, instead of using:
Code: Select all
var.getValue(float, default=40.00)

Use:
Code: Select all
var.getValue(float, default=-999.00)

or something like that. Then it would yield a (hopefully!) nonsense result which could trigger inquiry.

Your point is well taken! :D
Dave


Thx I have put this on into it - so far both the sensors, indoor and outdoor are working as expected.

With this offset I can play around a control page.

Thanks everyone.

Who is online

Users browsing this forum: CliveS and 5 guests