Keep GPIO command scopes and cover room text limits and existing UI dispatch
This commit is contained in:
1 parent
465425c37a
commit
b2bbb92287
8 files changed
+15
-13
No files matched your search
@@ -143,6 +143,9 @@ struct MyMesh {
|
||||
bool hasOutbound(){return false;}
|
||||
void markConnectionActive(const ContactInfo&){}
|
||||
void queueMessage(const ContactInfo&,int,mesh::Packet*,uint32_t,const void*,int,const char*){}
|
||||
// This harness exercises radio/local identity dispatch. Notification parsing
|
||||
// and permissions run against the real controller in their native suite.
|
||||
bool handleNotificationCommand(const char*,char*,size_t){return false;}
|
||||
};
|
||||
'''
|
||||
|
||||
|
||||
@@ -46,6 +46,7 @@ struct StrHelper {
|
||||
};
|
||||
struct ChannelDetails { char name[32]; };
|
||||
struct Mesh {
|
||||
bool notificationButton() { return false; }
|
||||
bool dual_radio_active=false;
|
||||
bool isDualRadioActive() const { return dual_radio_active; }
|
||||
bool getChannel(int channel,ChannelDetails& details) const {
|
||||
|
||||
@@ -22,6 +22,9 @@ const vip = {...builder.EXAMPLES.vip, id: "01".repeat(32), remote: "on"};
|
||||
assert.ok(builder.commands(vip).includes("set notify.remote contact:" + vip.id + " on"));
|
||||
const room = {...vip, kind: "room"};
|
||||
assert.ok(builder.commands(room).includes("set notify.remote room:" + room.id + " on"));
|
||||
const longPost = {...vip, led: Array(9).fill("60000").join(","), repeat: "65535"};
|
||||
assert.equal(builder.notificationText(longPost).length, 151);
|
||||
assert.throws(() => builder.notificationText({...longPost, kind: "room"}), /150 characters for a room post/);
|
||||
assert.throws(() => builder.commands({...builder.EXAMPLES.food, remote: "on"}));
|
||||
assert.throws(() => builder.commands({...vip, id: "1234"}));
|
||||
const encoded = builder.encodeCommand("notify.stop", "A7");
|
||||
|
||||
Reference in new issue
Block a user