Skip to content
This repository has been archived by the owner on Mar 26, 2021. It is now read-only.

Commit

Permalink
Добавить last_value stub refs #7
Browse files Browse the repository at this point in the history
  • Loading branch information
wolf1996 committed Jun 30, 2018
1 parent 1e7697c commit bdfc93c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 2 additions & 0 deletions python/gateway/gateway/resources_v2/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@

log = logging.getLogger("flask.app")


#TODO: отрефакторить это чтобы избавиться от копипасты
class Relations(Resource):
def __init__(self, **kwargs):
self.data_chan = kwargs['data']
Expand Down
6 changes: 4 additions & 2 deletions python/gateway/gateway/views_v2/objects_lvl.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def _get_msg(self):
class SensorInfo(BaseMesssage):
error_code = 0
http_code = 200
def __init__(self, id, controller_id, name, activation_date, deactivation_date, sensor_type, company):
def __init__(self, id, controller_id, name, activation_date, deactivation_date, sensor_type, company, last_value=0):
super(SensorInfo, self).__init__(self)
self.id = id
self.name = name
Expand All @@ -64,6 +64,7 @@ def __init__(self, id, controller_id, name, activation_date, deactivation_date,
self.sensor_type = sensor_type
self.company = company
self.controller_id = controller_id
self.last_value = last_value

def _get_msg(self):
return dict(id = self.id,
Expand All @@ -72,7 +73,8 @@ def _get_msg(self):
deactivation_date = self.deactivation_date,
sensor_type = self.sensor_type,
controller_id = self.controller_id,
company = self.company)
company = self.company,
last_value = self.last_value)

class ObjList(BaseMesssage):
error_code = 0
Expand Down

0 comments on commit bdfc93c

Please sign in to comment.