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

FlexMeasures / flexmeasures / 30279279096
83%
main: 83%

Build:
Build:
LAST BUILD BRANCH: test-1947-multi-session-same-sensor
DEFAULT BRANCH: main
Ran 27 Jul 2026 03:30PM UTC
Jobs 1
Files 171
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

27 Jul 2026 03:16PM UTC coverage: 82.949% (+0.002%) from 82.947%
30279279096

push

github

Flix6x
fix: don't unwrap a single-entry flex-model list for asset-level scheduling

An asset-level scheduling trigger whose flex-model list contains a single
device entry without a top-level "sensor" key (e.g. a battery referencing
its power sensor only via a nested output reference, like
{"consumption": {"sensor": N}, "state-of-charge": {"sensor": M}})
crashed before scheduling with:

    AttributeError: 'NoneType' object has no attribute 'generic_asset'

collect_flex_config unwrapped any single-entry flex-model list without a
top-level "sensor" key into a bare dict, which downstream is deserialized
in single-sensor mode - resolving the device against self.sensor, which is
None for asset-level scheduling. The same entry in a multi-entry list
scheduled fine, because multi-device (asset) mode resolves nested output
sensor references (see _resolve_power_sensor).

Only unwrap when scheduling a specific sensor (self.sensor is not None);
for asset-level scheduling, keep the list form (multi-device mode) even
for a single device entry. As a fail-safe, single-sensor (dict) flex-model
deserialization without a sensor now raises a clear ValueError naming the
flex-model entry, so the AttributeError cannot recur through any code path.

Discovered during PR #2360 (whose regression test is multi-device for
exactly this reason).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WtuVTVfL4fQ9QSqbLXmAGD
Signed-off-by: F.N. Claessen <claessen@seita.nl>

3 of 3 new or added lines in 2 files covered. (100.0%)

15995 of 19283 relevant lines covered (82.95%)

0.83 hits per line

Jobs
ID Job ID Ran Files Coverage
1 30279279096.1 27 Jul 2026 03:30PM UTC 171
82.95
GitHub Action Run
Source Files on build 30279279096
  • Tree
  • List 171
  • Changed 2
  • Source Changed 2
  • Coverage Changed 2
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #30279279096
  • b6427d1a on github
  • Prev Build on main (#30252413625)
  • Next Build on fix/single-entry-nested-sensor-flex-model (#30279336038)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc