• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

alandtse / alexa_media_player / 22513477258
23%

Build:
DEFAULT BRANCH: dev
Ran 28 Feb 2026 04:37AM UTC
Jobs 1
Files 19
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

28 Feb 2026 04:36AM UTC coverage: 23.778%. Remained the same
22513477258

push

github

web-flow
docs: clarify cached device mutation contract (#3398)

Issue identified during review of PR
https://github.com/alandtse/alexa_media_player/pull/3390
Reported by: https://github.com/coderabbitai
Requested by: @alandtse

Description:
In custom_components/alexa_media/__init__.py around lines 588-712, the
DataCache documentation states it "stores a direct reference (not a
copy)" and warns callers not to mutate. However, lines 919-946 mutate
individual device dicts in-place (adding bluetooth_state, locale, dnd,
etc.), which modifies the cached reference.

Current behavior:
The code intentionally mutates cached references, which contradicts the
cache's documented contract.

Suggested improvements:
Either:

Deep-copy on cache retrieval: devices = copy.deepcopy(cached_devices)
Add a clear comment acknowledging that mutation is intentional in this
specific case
Impact:
Nitpick - Works correctly in practice because mutations overwrite with
fresh data each cycle, but violates documented contract.

Reference:

PR: https://github.com/alandtse/alexa_media_player/pull/3390
File: custom_components/alexa_media/init.py:588-712

Fixes: #3395 

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **Documentation**
* Clarified how cached device data is handled and guidance on treating
cached values as read-only unless explicitly owned and mutated.

* **Chores**
* Added explanatory comments noting that device records are enriched
in-place during refresh cycles.

Note: No user-facing changes in this release.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

1133 of 4765 relevant lines covered (23.78%)

0.24 hits per line

Jobs
ID Job ID Ran Files Coverage
1 22513477258.1 28 Feb 2026 04:37AM UTC 19
23.78
GitHub Action Run
Source Files on build 22513477258
  • Tree
  • List 19
  • Changed 2
  • Source Changed 2
  • Coverage Changed 2
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #22513477258
  • 40ef8a27 on github
  • Prev Build on v5.14.0 (#22262425303)
  • Next Build on dev (#22513501658)
  • Delete
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc