Update 适配器.md

This commit is contained in:
2018-09-23 21:16:47 +08:00
parent a9770d2353
commit 838c7406b5

View File

@@ -2,13 +2,13 @@
## 内容
- [数据结构 - 对象和状态](#对象和状态)
- [适配器的目录结构r](#directory-structure-of-adapter)
- [文件命名](#file-naming)
- [io-package.json 的结构](#structure-of-io-packagejson)
- [适配器的目录结构](#适配器的目录结构)
- [文件命名](#文件命名)
- [io-package.json 的结构](#io-package.json的结构)
- [Common fields](#common-fields)
- [Object fields](#object-fields)
- [Instance object fields](#instance-object-fields)
- [package.json 的结构](#packagejson)
- [package.json 的结构](#package.json的结构)
- [部署](#deploying)
- [How to create own adapter](#how-to-create-own-adapter)
- [Structure of main.js](#structure-of-mainjs)
@@ -164,7 +164,6 @@ Explanation of memory states can be found [here](http://stackoverflow.com/questi
If adapter has mode 'none' or 'once', then alive, uptime, ... objects will not be created.
## Directory structure of adapter
## 适配器的目录结构
Adapter package must have some mandatory directories and files:
@@ -187,7 +186,6 @@ Adapter package must have some mandatory directories and files:
注意lib / utils.js是所有适配器的公共文件用于检测js-controller的位置以及相应的iobroker.js-controller / lib / adapter.js路径。大多数实际的utils.js都可以在这里下载。请勿更改此文件。
## File naming
## 文件命名
Adapter must must follow some naming convention to be accepted and started by ioBroker controller.
@@ -200,7 +198,6 @@ Adapter must must follow some naming convention to be accepted and started by io
3. The start file of adapter must have name _main.js_ or _adapterName.js_.
4. Name of adapter must be unique, lowercase, with no special characters and without spaces. "-", "_" are allowed in the name of adapter.
## Structure of io-package.json
## io-package.json结构
io-package.json is used by js-controller to show information about adapter and to know how to treat it.
@@ -260,7 +257,6 @@ If no entry exists for the current language, the description in english will be
E.g. "http://%ip%:%port%" will be shown as "http://192.168.0.1:8080", where "192.168.0.1" is IP address from "web" adapter and 8080 is value from "system.adapter.adapterName.X => native.port".
### Object fields
### 对象字段
objects - static objects for all instances of adapter (xxx.object)
@@ -354,7 +350,6 @@ Will be expanded to
by creation of first instance.
## package.json
## package.json结构
package.json是npm数据包标准描述文件完整描述可以在[https://docs.npmjs.com/files/package.json](https://docs.npmjs.com/files/package.json).下找到。