-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
porting to v2 #6
base: master
Are you sure you want to change the base?
Conversation
new: 讓使用者自定要使用V1版本還是V2版本
|
幫我加一下 CHANGELOG.md ,記錄一下你這次更新加了什麼,之前沒記的就算了。 |
要請你把前端的部份 (css, js, html) 另外開一個 branch哦, |
可以先切回 master 開一個新的 branch 後,再用 cherry-pick 把要的前端 commit 撿過去就好 |
OK 收到~我改一下 |
新增IOTTALK_VERSION的說明
upload sa.py (flake8 ok)
delete app.py
刪除25行的註解
|
||
### Changed | ||
|
||
- IoTtalk-v2可使用的dashboard(dynamic) (#a2fe8a6) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
這句是什麼意思?CHANGELOG 裡儘量放明確一點的文字,最好是能一看就知道意思。
然後如果是過程中的變動,不是最後結果的就不用放了,
比如這句 dynamic 跟下面的 static,這是在做一樣的事,最後的結果是 dynamic 的話,那 static 就不需要放了。
CHANGELOG.md
Outdated
|
||
### Changed | ||
|
||
- rename `app0330.py` to `app.py` (#e145710) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CHANGELOG 的對象是最後要使用系統的人,像這種開發訊息就不需要放在 CHANGELOG 了,
放在 commit log 中就可以
config.py
Outdated
@@ -18,7 +18,12 @@ | |||
|
|||
# IoTtalk server's 'IP' or 'DomainName' only, without any protocol 'http://' or 'https://'. | |||
# ex: '8.8.8.8' or 'google.com', | |||
# if you want to use IoTtalk V1 : |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CSM_HOST 的註解應該跟 IOTTALK_VERSION 分開,因為不管 v1還是 v2 都需要 CSM_HOST。
IOTTALK_VERSION 的說明,應該是指出使用者連接的 CSM 所使用的 IoTtalk version,然後說明接受的值為 1 或 2,default 為 1 這樣
da/sa.py
Outdated
'dm_name': 'DataServer', | ||
'odf_list': [], | ||
'is_sim': False} | ||
alert_range = {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
alert_range
的東西先拿掉好了,目前用不到
da/sa.py
Outdated
session = db.get_session() | ||
|
||
for field in (session.query(db.models.field).all()): | ||
profile = {'d_name': field.name + '_DataServer', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
不需要 profile了吧,這是 v1 的用法,應該可以直接建立各個變數塞進 SaClass 中
da/sa.py
Outdated
|
||
for field in (session.query(db.models.field).all()): | ||
profile = {'d_name': field.name + '_DataServer', | ||
'dm_name': 'DataServer', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dm_name
、d_name
你這樣指定一次,可是沒有用到,又在 SaClass 中指定一次,
統一在這邊指定塞進 SaClass 中吧
da/sa.py
Outdated
profile = {'d_name': field.name + '_DataServer', | ||
'dm_name': 'DataServer', | ||
'odf_list': [], | ||
'is_sim': False} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is_sim
應該用不到?
da/sa.py
Outdated
alert_range = {} | ||
query_df = (session.query(db.models.field_sensor) | ||
.select_from(db.models.field_sensor) | ||
.join(db.models.sensor) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
只取 field_sensor
的資料的話,有需要 join sensor
嗎?
self.interval={} Co-authored-by: Ksoy <[email protected]>
modify da.app to da.sa
add idf_list in SaClass,rename d_name to device_name,rename dm_name to device_model
在最後一行新增了Dashboard V2版的使用方法,說明如何使用能連接IoTtalk v2的Dashboard。
1.前置
2.創建一個Class取名為SaClass,放入iottalkpy/dai所需之參數及function
3.動態產生以當前odf為名的odf_function
4.server.py裡的_start_da裡的from da.DAI import main as da,改成from da.sa import main as da