koishi-plugin-prism 0.4.0 → 0.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -0
- package/lib/ha-watch.d.ts +1 -1
- package/lib/ha-watch.js +3 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -155,6 +155,10 @@ npm version minor --no-git-tag-version
|
|
|
155
155
|
|
|
156
156
|
绑定支持 Koishi 提供的各适配器标识,身份值保持字符串,不限定数字格式。店员和账单私聊按「平台标识 + 身份值」认人,相同号码的其他平台不会继承权限或通知。管理员代操作使用目标平台标识,禁止通过当前适配器误操作另一个平台。`/list` 只用当前平台的身份查询昵称,缺失时使用后台名称。源码和 npm 发行包需要分别核对版本。
|
|
157
157
|
|
|
158
|
+
### 0.4.1
|
|
159
|
+
|
|
160
|
+
Bot 作为 Home Assistant 监听者时的心跳从 30 秒改成 60 秒,与机台 IO 一致,平台因此用同一个租约(150 秒)衡量两者。同一个间隔也是向 Home Assistant 发的 `ping`,所以 Home Assistant 停止应答现在最多 60 秒后才发现(原来 30 秒)。
|
|
161
|
+
|
|
158
162
|
### 0.4.0
|
|
159
163
|
|
|
160
164
|
闲置提醒与店内动态合并成一件事:Bot 只有一处「播报群」(`announceChannelIds`),以及五种各自独立的播报开关——设备闲置、开机/关机(含闲置自动关机)、上机、刷卡、投币;频道不再是区分两类消息的依据。投币从「上机」里分出来单独播报,投币同时上机时仍只发一条,按「上机」的措辞。新增 Bot 设置「入场后自动获取门锁密码」(`doorPasswordOnEntry`,默认关闭):打开后 `login`/`入场` 成功后顺带回复门锁临时密码,门锁失败不影响入场。需要配套 PRiSM(平台侧迁移 `0046_bot_announcement_channels.sql`),旧版平台下发的 `idleChannelIds`/`eventChannelIds` 不再被读取,升级平台前不要升级到此版本。
|
package/lib/ha-watch.d.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* The platform hands a bot the Home Assistant addresses to try, a read-only token and the entities it
|
|
5
5
|
* cares about (`ha.watch`). The bot subscribes with `subscribe_entities` and reports `ha.status` (also
|
|
6
|
-
* every
|
|
6
|
+
* every 60 s, as a heartbeat) and `ha.states` back over its platform connection, every report carrying
|
|
7
7
|
* the term of the assignment it answers; that is how the platform tells a current watcher from a
|
|
8
8
|
* replaced one. This is the same job a HINATA IO does, in the same shape, so the platform treats both
|
|
9
9
|
* alike.
|
package/lib/ha-watch.js
CHANGED
|
@@ -10,7 +10,9 @@ exports.parseWatch = parseWatch;
|
|
|
10
10
|
exports.HA_TIMING = {
|
|
11
11
|
connectMs: 10_000,
|
|
12
12
|
authMs: 10_000,
|
|
13
|
-
|
|
13
|
+
// The same beat as a machine's IO: the platform gives a watcher two beats of
|
|
14
|
+
// lease plus slack, and does not care whether the watcher is a bot or a box.
|
|
15
|
+
heartbeatMs: 60_000,
|
|
14
16
|
firstRetryMs: 2_000,
|
|
15
17
|
maxRetryMs: 60_000,
|
|
16
18
|
};
|