Closed Nerivec closed 3 months ago
Great progress!
@kirovilya let me know if this is OK for you
Very good! I like. But I wonβt be able to check its functionality in the next few days...
@Koenkk Is the logger passed to the Adapter class viable to log to the tab/file instead of limiting everything to debug mode (off 99.9% of the time)? I couldn't find it being used much throughout herdsman, except in z-stack manager, I was wondering if it was actually hooked up upstream and could replace a plain console.log
?
Could use something a bit more flexible though, I think; to be able to use it in utility classes & such without passing that logger around like crazy.
Some more...
const
to avoid "magic numbers" in code (extensively documented to quickly identify changes with new EZSP updates -that's why the commit looks so long...-).PS: I'm by no means a Jest expert, I'm sure the tests can be improved, but at least for now it's checking a few critical things. We'll definitely need some more... π
@Nerivec for the logger we can do the same as in https://github.com/Koenkk/zigbee-herdsman-converters/commit/6c4475c4fd13fd4b6b069c90ecf1cfef071d5f96 + https://github.com/Koenkk/zigbee2mqtt/commit/f83709d96c4a98b2c5f34a2e06fe2ea26f9cb9d5
Sounds good. I'll let you do the base changes the way you see fit, and I'll update the EZSP part once it's done. Let's do that after this is merged though, if you end up removing the logger passed around in controller/adapter in favor of the new system, it will conflict with this. I'd prefer avoiding dealing with conflicts with such a large commit π
@Nerivec is this PR going to address https://github.com/Koenkk/zigbee-herdsman/issues/856 ?
Changes are all EZSP/UART-level (protocols handling), the rest is general cleanup. It doesn't change the Z2M-level logic. I'll post a reply in the original thread.
Since this PR might be a bit risky, I will wait until https://github.com/Koenkk/zigbee2mqtt/issues/21162 is fixed so that I can publish a new hotfix release.
If a hotfix is planned for release, then for sure, wait. I fully expect a couple of hotfixes to have to be done after this is merged in dev. So many setups to support...
@Koenkk I'm going to table this PR for now. I've been made aware of a couple of bugs affecting the current release version (EZSP only), that need fixing (this update doesn't solve them either... just my luck). I've identified one, a race condition (I guess it's running too fast now... π), but the second one remains a mystery at the moment, I don't want this pushed on top (or pushing on top of this) since it doesn't fix it and it's massive. Couldn't reproduce either in my limited test env, but definitely in the affected machine, so...
I'll come back to this if that's alright with you. I'll also walk it in smaller PRs, should be safer.
EDIT: Forgot to mention. Do you mind adding @serialport/binding-mock
as a dev dep in herdsman in your next commit? I've been using it as mock serial to test EZSP locally, it avoids a lot of grunt work mocking everything by hand.
Do you mind adding @serialport/binding-mock as a dev dep in herdsman in your next commit?
No problem, would you like me to add it or will you add it in the next pr?
You can go ahead and do it. I'm still trying to fix that damn bug. π
Done!
I was waiting for the new release to put out this one. It's mostly cleanup, but a few changes in behavior & fixes (below at the top).
preJoining
not awaited inpermitJoin
.RETRY_QUEUE_SIZE=16
config IDs to set on NCP.toString
function,toString(true)
, makes things cleaner since it's used a lot.console.log
to have them in regular logs.I think I covered all the changes...
@kirovilya Let me know if you catch anything.
PS: After this is merged & available in dev branch, please report your observations in the EZSP Testing discussion.