ChristianTremblay / pyhaystack

Pyhaystack is a module that allow python programs to connect to a haystack server project-haystack.org. Connection can be established with Niagara Platform running the nhaystack, Skyspark and Widesky. For this to work with Anaconda IPython Notebook in Windows, be sure to use "python setup.py install" using the Anaconda Command Prompt in Windows. If not, module will be installed for System path python but won't work in the environment of Anaconda IPython Notebook. You will need hszinc 1.3+ for this to work.
Apache License 2.0
74 stars 32 forks source link

dump function fills empty cells with `N` #58

Closed candronikos closed 6 years ago

candronikos commented 6 years ago

Hello,

I noticed that empty cells are treated as null values when a dump is done.

Is it possible to have a null type for zinc to differentiate it from an empty cell?

ver:"2.0"
air,zone,temp,point,sp,fan,kind,his,id,writable,envizi,tz,dis,supply,defaultVal,sensor,return,nubeCur,cur,connRef,nubeConnRef,nubeWrite,nubeHis,pressure
M,M,M,M,M,M,"Number",M,@U02,M,"ZAT_SP","Sydney","ZAT Setpoint",N,N,N,N,N,N,N,N,N,N,N
M,N,M,M,M,M,"Number",M,@UO1,M,"SAT_SP","Sydney","SAT Setpoint",M,N,N,N,N,N,N,N,N,N,N
M,N,M,M,M,M,"Number",M,@AC1_SAT_SP,N,"AC1_SATSP","Sydney","SAT_SP",M,0,N,N,N,N,N,N,N,N,N
M,N,M,M,N,M,"Number",M,@UI2,N,"SAT!","Sydney","SAT",M,N,M,N,N,N,N,N,N,N,N
M,N,M,M,M,M,"Number",M,@AC1_SAT_SP1,N,"AC1_SATSP","Sydney","SAT_SP",M,0,N,N,N,N,N,N,N,N,N
M,N,M,M,N,M,"Number",M,@UI3,N,"RAT","Sydney","RAT",N,N,M,M,N,N,N,N,N,N,N
M,M,M,M,N,M,"Number",M,@UI4,N,"ZAT","Sydney","ZAT",N,N,M,N,N,N,N,N,N,N,N
M,N,M,M,M,M,"Number",M,@UO1_point,M,"SAT_SP","Sydney","SAT Setpoint",M,0,N,N,"@UO1",M,"@nubeConnId","@nubeConnId","@UO1","@UO1",N
M,N,N,M,N,M,"Number",M,@UI1,N,"SAP","Sydney","SASP",M,N,M,N,N,N,N,N,N,N,M

EDIT: Added example zinc output

sjlongland commented 6 years ago

An empty cell is a null… they're fundamentally representing the same thing.

candronikos commented 6 years ago

Ok, I actually tested this theory in skyspark and what your saying adds up:

> {a:1}.has("a")
> true
> {a:null}.has("a")
> false