feat(sfm): Series-4 identify, status and settings into the shared models

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44
This commit is contained in:
serversdownandClaude Opus 5.5 committed 2026-10-21 01:15:43 -04:00
1 parent 8e7333b899
commit ece9ec79e3
2 files changed
+85 -1

No files matched your search

+31
View File
@@ -179,3 +179,34 @@ def test_a_failure_mid_request_hangs_up():
with pytest.raises(NoAnswer):
s.run(lambda c: c.get_state())
assert not s.is_open
# ── operations ────────────────────────────────────────────────────────────────
from sfm.device_access.s4 import s4_identify, s4_settings, s4_status # noqa: E402
def test_s4_identify():
info = s4_identify(FakeMicromateClient(monitoring=True), "UM20147")
assert (info.serial, info.series, info.model, info.monitoring) == ("UM20147", 4, "MM/ISEE/S", True)
assert info.active_setup == "test2.MMB"
assert info.firmware is None and info.detail["firmware_line"] == "thor"
def test_s4_status_includes_the_cheap_event_count():
st = s4_status(FakeMicromateClient(events=5), "UM20147")
assert (st.series, st.monitoring, st.battery_volts, st.event_count) == (4, False, 3.8, 5)
assert (st.memory_total_bytes, st.memory_free_bytes) == (15_000_000, 14_799_296)
assert st.device_time == "2026-10-20T18:07:58"
def test_s4_settings_maps_the_decoded_setup():
s = s4_settings(FakeMicromateClient(), "UM20147")
assert (s.series, s.setup_name, s.record_mode) == (4, "test2.MMB", "Histogram Combo")
assert (s.sample_rate, s.record_time_s, s.histogram_interval_s) == (1024, 10.0, 2)
assert s.geo_trigger_ips == pytest.approx(0.5, abs=1e-6)
assert list(s.notes) == ["Location", "Client", "Company", "General Notes"]
assert s.detail["pretrigger_s"] == 1.0
assert s.detail["mic_type"] == "linear"
assert s.detail["mic_trigger_db"] == pytest.approx(131.0, abs=0.01)
assert s.detail["geo_trigger_ips_per_channel"] == pytest.approx([0.5, 0.5, 0.5], abs=1e-6)