38
367
4382
元老级技术达人
查看全部评分
使用道具 举报
55
1404
6331
论坛DIY达人
41
2159
8568
ghostist 发表于 2023-9-18 09:09 两个疑问: 1、为啥不用原生API而用mqtt呢,这么做的好处是? 2、还有原作不包含代码库索引后,在使用上有 ...
trz0332 发表于 2023-9-18 10:47 1、原生api需要在路由器里面绑定mac地址,如果不绑定,路由器重启ip变更后可能会出现2个esphome设备串IP, ...
62
287
5803
mqtt: # .... 其他配置 on_message: topic: climate/send qos: 0 then: - remote_transmitter.transmit_raw: code: !lambda |- std::vector<int> data; DynamicJsonDocument json_document(JSON_ARRAY_SIZE(x.size() / 5)); deserializeJson(json_document, x); JsonArray root = json_document.as<JsonArray>(); int s = -1; for(auto value : root) { s *= -1; data.push_back(value.as<int>() * s); } return data; carrier_frequency: 38k
ryanh7 发表于 2023-9-19 10:51 内存富余的可以这么干,大概会多占用3~4kB内存
0
29
161
注册会员
8
863
5232
论坛元老
本版积分规则 发表回复 回帖后跳转到最后一页
Archiver|手机版|小黑屋|Hassbian ( 晋ICP备17001384号-1 )
GMT+8, 2025-5-12 03:36 , Processed in 0.092628 second(s), 24 queries .
Powered by Discuz! X3.5
© 2001-2025 Discuz! Team.