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

derliebemarcus / homeassistant_teltonika_rms / 28290060867
98%

Build:
DEFAULT BRANCH: main
Ran 27 Jun 2026 01:11PM UTC
Jobs 1
Files 21
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 Jun 2026 01:04PM UTC coverage: 98.357% (-0.1%) from 98.504%
28290060867

push

github

web-flow
fix: align device inventory with current RMS schema (#79)

## Summary

- accept the current RMS device status contract (`0`, `1`, `2`, or
`null`) while retaining compatibility with legacy string statuses
- normalize the documented status semantics so `2` is pending rather
than truthy/online and `null` is offline
- make device IDs optional at contract-validation level because the
OpenAPI schema does not mark device properties as required
- use the documented `/devices` pagination parameters `limit` and
`offset`
- follow `meta.total` without the former implicit 20-page/1,000-device
truncation
- stop safely when RMS ignores `offset` and repeats a page
- de-duplicate overlapping pages and retain an explicit `max_pages`
limit for connection validation
- add contract, status-semantics, and pagination edge-case tests

## Root cause

The current RMS OpenAPI specification defines `device_body.status` as a
nullable integer:

- `0`: offline
- `1`: online
- `2`: pending
- `null`: offline

The integration required `status: str | None`. Pydantic therefore
rejected normal `/devices` responses and raised `RMS schema changed for
devices_list` during Home Assistant setup.

Even after accepting integers, passing numeric status through generic
truthiness would make `2` appear online. Device-list and device-detail
responses are now normalized to stable textual values before Home
Assistant consumes them.

The same specification documents `limit` plus `offset` for `/devices`
and returns `meta.total`. The existing client sent an undocumented
`page` parameter. Its old `max_pages=20` default would also truncate
inventories above 1,000 devices; the specification itself uses
`meta.total: 1420` as an example.

## Additional schema audit

No further strict response-type mismatches were found in the Pydantic
fields currently validated against `/devices` and `/devices/{id}`. The
remaining declared fields are aligned with the specification or
deliberately broader for compatibility.

... (continued)

79 of 82 new or added lines in 3 files covered. (96.34%)

1 existing line in 1 file now uncovered.

1975 of 2008 relevant lines covered (98.36%)

0.98 hits per line

Uncovered Changes

Lines Coverage ∆ File
3
95.38
custom_components/teltonika_rms/api_devices.py

Coverage Regressions

Lines Coverage ∆ File
1
96.86
-0.22% custom_components/teltonika_rms/api.py
Jobs
ID Job ID Ran Files Coverage
1 28290060867.1 27 Jun 2026 01:11PM UTC 21
98.36
GitHub Action Run
Source Files on build 28290060867
  • Tree
  • List 21
  • Changed 3
  • Source Changed 2
  • Coverage Changed 3
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #28290060867
  • 00763c7a on github
  • Prev Build on main (#28288859315)
  • Next Build on main (#28292241343)
  • 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