zigpy / zigpy-znp

TI CC2531, CC13x2, CC26x2 radio support for Zigpy and ZHA
GNU General Public License v3.0
145 stars 40 forks source link

Log an error instead of crashing when loading state from a bad CC2531 #120

Closed puddly closed 2 years ago

puddly commented 2 years ago

Some users have been using CC2531 adapters that were flashed with Z-Stack 3 without being erased. Their TCLK NVRAM entry is technically too big but Z-Stack seems to still run. The ADDRMGR table, however, is too small. I'm not sure exactly how Z-Stack deals with that situation but it's out of scope for zigpy-znp to automatically do a complete network backup, an NVRAM erase, and a network restore to fix this problem. Instead, an error will be logged on startup.

https://github.com/home-assistant/core/issues/61921

codecov-commenter commented 2 years ago

Codecov Report

Merging #120 (a1436bf) into dev (03ee732) will decrease coverage by 0.02%. The diff coverage is 91.66%.

Impacted file tree graph

@@            Coverage Diff             @@
##              dev     #120      +/-   ##
==========================================
- Coverage   98.73%   98.71%   -0.03%     
==========================================
  Files          44       44              
  Lines        3876     3880       +4     
==========================================
+ Hits         3827     3830       +3     
- Misses         49       50       +1     
Impacted Files Coverage Δ
zigpy_znp/api.py 97.82% <90.00%> (-0.23%) :arrow_down:
zigpy_znp/tools/network_backup.py 97.91% <100.00%> (-0.05%) :arrow_down:
zigpy_znp/znp/security.py 95.18% <100.00%> (-0.08%) :arrow_down:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 03ee732...a1436bf. Read the comment docs.