@@ -45,14 +45,14 @@ def get_owners(self, owner_type: ThingType = None):
45
45
46
46
class _BooleanAttribute (BooleanAttribute , _Attribute ):
47
47
48
- def __init__ (self , iid : str , type_ : BooleanAttributeType , value : bool ):
49
- super (_BooleanAttribute , self ).__init__ (iid )
48
+ def __init__ (self , iid : str , is_inferred : bool , type_ : BooleanAttributeType , value : bool ):
49
+ super (_BooleanAttribute , self ).__init__ (iid , is_inferred )
50
50
self ._type = type_
51
51
self ._value = value
52
52
53
53
@staticmethod
54
54
def of (thing_proto : concept_proto .Thing ):
55
- return _BooleanAttribute (concept_proto_reader .iid (thing_proto .iid ), concept_proto_reader .attribute_type (thing_proto .type ), thing_proto .value .boolean )
55
+ return _BooleanAttribute (concept_proto_reader .iid (thing_proto .iid ), thing_proto . inferred , concept_proto_reader .attribute_type (thing_proto .type ), thing_proto .value .boolean )
56
56
57
57
def get_type (self ) -> "BooleanAttributeType" :
58
58
return self ._type
@@ -61,13 +61,13 @@ def get_value(self):
61
61
return self ._value
62
62
63
63
def as_remote (self , transaction ):
64
- return _RemoteBooleanAttribute (transaction , self .get_iid (), self .get_type (), self .get_value ())
64
+ return _RemoteBooleanAttribute (transaction , self .get_iid (), self .is_inferred (), self . get_type (), self .get_value ())
65
65
66
66
67
67
class _RemoteBooleanAttribute (RemoteBooleanAttribute , _RemoteAttribute ):
68
68
69
- def __init__ (self , transaction , iid : str , type_ , value : bool ):
70
- super (_RemoteBooleanAttribute , self ).__init__ (transaction , iid )
69
+ def __init__ (self , transaction , iid : str , is_inferred : bool , type_ , value : bool ):
70
+ super (_RemoteBooleanAttribute , self ).__init__ (transaction , iid , is_inferred )
71
71
self ._type = type_
72
72
self ._value = value
73
73
@@ -78,19 +78,19 @@ def get_value(self):
78
78
return self ._value
79
79
80
80
def as_remote (self , transaction ):
81
- return _RemoteBooleanAttribute (transaction , self .get_iid (), self .get_type (), self .get_value ())
81
+ return _RemoteBooleanAttribute (transaction , self .get_iid (), self .is_inferred (), self . get_type (), self .get_value ())
82
82
83
83
84
84
class _LongAttribute (LongAttribute , _Attribute ):
85
85
86
- def __init__ (self , iid : str , type_ : LongAttributeType , value : int ):
87
- super (_LongAttribute , self ).__init__ (iid )
86
+ def __init__ (self , iid : str , is_inferred : bool , type_ : LongAttributeType , value : int ):
87
+ super (_LongAttribute , self ).__init__ (iid , is_inferred )
88
88
self ._type = type_
89
89
self ._value = value
90
90
91
91
@staticmethod
92
92
def of (thing_proto : concept_proto .Thing ):
93
- return _LongAttribute (concept_proto_reader .iid (thing_proto .iid ), concept_proto_reader .attribute_type (thing_proto .type ), thing_proto .value .long )
93
+ return _LongAttribute (concept_proto_reader .iid (thing_proto .iid ), thing_proto . inferred , concept_proto_reader .attribute_type (thing_proto .type ), thing_proto .value .long )
94
94
95
95
def get_type (self ) -> "LongAttributeType" :
96
96
return self ._type
@@ -99,13 +99,13 @@ def get_value(self):
99
99
return self ._value
100
100
101
101
def as_remote (self , transaction ):
102
- return _RemoteLongAttribute (transaction , self .get_iid (), self .get_type (), self .get_value ())
102
+ return _RemoteLongAttribute (transaction , self .get_iid (), self .is_inferred (), self . get_type (), self .get_value ())
103
103
104
104
105
105
class _RemoteLongAttribute (RemoteLongAttribute , _RemoteAttribute ):
106
106
107
- def __init__ (self , transaction , iid : str , type_ , value : int ):
108
- super (_RemoteLongAttribute , self ).__init__ (transaction , iid )
107
+ def __init__ (self , transaction , iid : str , is_inferred : bool , type_ , value : int ):
108
+ super (_RemoteLongAttribute , self ).__init__ (transaction , iid , is_inferred )
109
109
self ._type = type_
110
110
self ._value = value
111
111
@@ -116,19 +116,19 @@ def get_value(self):
116
116
return self ._value
117
117
118
118
def as_remote (self , transaction ):
119
- return _RemoteLongAttribute (transaction , self .get_iid (), self .get_type (), self .get_value ())
119
+ return _RemoteLongAttribute (transaction , self .get_iid (), self .is_inferred (), self . get_type (), self .get_value ())
120
120
121
121
122
122
class _DoubleAttribute (DoubleAttribute , _Attribute ):
123
123
124
- def __init__ (self , iid : str , type_ : DoubleAttributeType , value : float ):
125
- super (_DoubleAttribute , self ).__init__ (iid )
124
+ def __init__ (self , iid : str , is_inferred : bool , type_ : DoubleAttributeType , value : float ):
125
+ super (_DoubleAttribute , self ).__init__ (iid , is_inferred )
126
126
self ._type = type_
127
127
self ._value = value
128
128
129
129
@staticmethod
130
130
def of (thing_proto : concept_proto .Thing ):
131
- return _DoubleAttribute (concept_proto_reader .iid (thing_proto .iid ), concept_proto_reader .attribute_type (thing_proto .type ), thing_proto .value .double )
131
+ return _DoubleAttribute (concept_proto_reader .iid (thing_proto .iid ), thing_proto . inferred , concept_proto_reader .attribute_type (thing_proto .type ), thing_proto .value .double )
132
132
133
133
def get_type (self ) -> "DoubleAttributeType" :
134
134
return self ._type
@@ -137,13 +137,13 @@ def get_value(self):
137
137
return self ._value
138
138
139
139
def as_remote (self , transaction ):
140
- return _RemoteDoubleAttribute (transaction , self .get_iid (), self .get_type (), self .get_value ())
140
+ return _RemoteDoubleAttribute (transaction , self .get_iid (), self .is_inferred (), self . get_type (), self .get_value ())
141
141
142
142
143
143
class _RemoteDoubleAttribute (RemoteDoubleAttribute , _RemoteAttribute ):
144
144
145
- def __init__ (self , transaction , iid : str , type_ : DoubleAttributeType , value : float ):
146
- super (_RemoteDoubleAttribute , self ).__init__ (transaction , iid )
145
+ def __init__ (self , transaction , iid : str , is_inferred : bool , type_ : DoubleAttributeType , value : float ):
146
+ super (_RemoteDoubleAttribute , self ).__init__ (transaction , iid , is_inferred )
147
147
self ._type = type_
148
148
self ._value = value
149
149
@@ -154,19 +154,19 @@ def get_value(self):
154
154
return self ._value
155
155
156
156
def as_remote (self , transaction ):
157
- return _RemoteDoubleAttribute (transaction , self .get_iid (), self .get_type (), self .get_value ())
157
+ return _RemoteDoubleAttribute (transaction , self .get_iid (), self .is_inferred (), self . get_type (), self .get_value ())
158
158
159
159
160
160
class _StringAttribute (StringAttribute , _Attribute ):
161
161
162
- def __init__ (self , iid : str , type_ : StringAttributeType , value : str ):
163
- super (_StringAttribute , self ).__init__ (iid )
162
+ def __init__ (self , iid : str , is_inferred : bool , type_ : StringAttributeType , value : str ):
163
+ super (_StringAttribute , self ).__init__ (iid , is_inferred )
164
164
self ._type = type_
165
165
self ._value = value
166
166
167
167
@staticmethod
168
168
def of (thing_proto : concept_proto .Thing ):
169
- return _StringAttribute (concept_proto_reader .iid (thing_proto .iid ), concept_proto_reader .attribute_type (thing_proto .type ), thing_proto .value .string )
169
+ return _StringAttribute (concept_proto_reader .iid (thing_proto .iid ), thing_proto . inferred , concept_proto_reader .attribute_type (thing_proto .type ), thing_proto .value .string )
170
170
171
171
def get_type (self ) -> "StringAttributeType" :
172
172
return self ._type
@@ -175,13 +175,13 @@ def get_value(self):
175
175
return self ._value
176
176
177
177
def as_remote (self , transaction ):
178
- return _RemoteStringAttribute (transaction , self .get_iid (), self .get_type (), self .get_value ())
178
+ return _RemoteStringAttribute (transaction , self .get_iid (), self .is_inferred (), self . get_type (), self .get_value ())
179
179
180
180
181
181
class _RemoteStringAttribute (RemoteStringAttribute , _RemoteAttribute ):
182
182
183
- def __init__ (self , transaction , iid : str , type_ : StringAttributeType , value : str ):
184
- super (_RemoteStringAttribute , self ).__init__ (transaction , iid )
183
+ def __init__ (self , transaction , iid : str , is_inferred : bool , type_ : StringAttributeType , value : str ):
184
+ super (_RemoteStringAttribute , self ).__init__ (transaction , iid , is_inferred )
185
185
self ._type = type_
186
186
self ._value = value
187
187
@@ -192,19 +192,19 @@ def get_value(self):
192
192
return self ._value
193
193
194
194
def as_remote (self , transaction ):
195
- return _RemoteStringAttribute (transaction , self .get_iid (), self .get_type (), self .get_value ())
195
+ return _RemoteStringAttribute (transaction , self .get_iid (), self .is_inferred (), self . get_type (), self .get_value ())
196
196
197
197
198
198
class _DateTimeAttribute (DateTimeAttribute , _Attribute ):
199
199
200
- def __init__ (self , iid : str , type_ : DateTimeAttributeType , value : datetime ):
201
- super (_DateTimeAttribute , self ).__init__ (iid )
200
+ def __init__ (self , iid : str , is_inferred : bool , type_ : DateTimeAttributeType , value : datetime ):
201
+ super (_DateTimeAttribute , self ).__init__ (iid , is_inferred )
202
202
self ._type = type_
203
203
self ._value = value
204
204
205
205
@staticmethod
206
206
def of (thing_proto : concept_proto .Thing ):
207
- return _DateTimeAttribute (concept_proto_reader .iid (thing_proto .iid ), concept_proto_reader .attribute_type (thing_proto .type ), datetime .fromtimestamp (float (thing_proto .value .date_time ) / 1000.0 ))
207
+ return _DateTimeAttribute (concept_proto_reader .iid (thing_proto .iid ), thing_proto . inferred , concept_proto_reader .attribute_type (thing_proto .type ), datetime .fromtimestamp (float (thing_proto .value .date_time ) / 1000.0 ))
208
208
209
209
def get_type (self ) -> "DateTimeAttributeType" :
210
210
return self ._type
@@ -213,13 +213,13 @@ def get_value(self):
213
213
return self ._value
214
214
215
215
def as_remote (self , transaction ):
216
- return _RemoteDateTimeAttribute (transaction , self .get_iid (), self .get_type (), self .get_value ())
216
+ return _RemoteDateTimeAttribute (transaction , self .get_iid (), self .is_inferred (), self . get_type (), self .get_value ())
217
217
218
218
219
219
class _RemoteDateTimeAttribute (RemoteDateTimeAttribute , _RemoteAttribute ):
220
220
221
- def __init__ (self , transaction , iid : str , type_ : DateTimeAttributeType , value : datetime ):
222
- super (_RemoteDateTimeAttribute , self ).__init__ (transaction , iid )
221
+ def __init__ (self , transaction , iid : str , is_inferred : bool , type_ : DateTimeAttributeType , value : datetime ):
222
+ super (_RemoteDateTimeAttribute , self ).__init__ (transaction , iid , is_inferred )
223
223
self ._type = type_
224
224
self ._value = value
225
225
@@ -230,4 +230,4 @@ def get_value(self):
230
230
return self ._value
231
231
232
232
def as_remote (self , transaction ):
233
- return _RemoteDateTimeAttribute (transaction , self .get_iid (), self .get_type (), self .get_value ())
233
+ return _RemoteDateTimeAttribute (transaction , self .get_iid (), self .is_inferred (), self . get_type (), self .get_value ())
0 commit comments