fix(devices): Cashino printer — ping-only driver (no false status) + Albanian role wording
The Cashino 80mm printer reported wrong status: it ran on the `rongta`
driver, whose readStatus() scrapes the Rongta board's /prn_stat.htm status
page — which the Cashino does not serve — yielding a bogus degraded/page-
error verdict while the printer was online and printing fine. Root cause:
the Cashino is an ESC/POS PRINT clone with no trustworthy STATUS mechanism.
Fix: extract the shared ESC/POS rendering + transport (renderTicket/
renderReport/renderSubscriptionCard/sendRaw/probe + CP852 map + code128/
qrCode) from printer-rongta into drivers/printer-escpos.ts, and add a
dedicated `cashino` driver that reuses that print path but is deliberately
NOT MonitorableDevice (no readStatus). isMonitorable() is then false, so the
device monitor falls back to healthCheck() — a plain TCP reachability ping:
reachable -> ready, unreachable -> offline, never a guessed paper/cover
state it cannot sense. Rongta driver unchanged (still scrapes its page,
still monitorable). Register + re-export cashinoDriver.
Verified at runtime (cashino registered, isMonitorable=false, no readStatus,
healthCheck->offline on unreachable) and live: /api/devices/status shows both
printers ready (lane via ping, booth via page). The live entry-dispenser at
10.0.10.9 was switched rongta->cashino in the operator DB (backed up).
Also fix the Albanian device-role chip wording, which read wrong as a
"{category} {role}" label: access mixed "i përzier" -> "hyrje/dalje"
(it means a barrier spanning both directions); printer lane "korsia" ->
"në korsi"; booth "kabina" -> "në kabinë". English tidied to match
(mixed->entry/exit, lane->at lane, booth->at booth).
Claude-Session: https://claude.ai/code/session_01Xcm6ikLgGoCxxHrxtjkk5V
This commit is contained in:
@@ -35,6 +35,19 @@ This is captured as a device capability: `MonitorableDevice.readStatus(): Printe
|
||||
`isMonitorable()`. A future printer with a different status mechanism just implements the same
|
||||
interface.
|
||||
|
||||
**A clone WITHOUT a trustworthy status mechanism must NOT implement `readStatus`.** The **Cashino**
|
||||
80mm printer prints via the identical ESC/POS stream (shared in `drivers/printer-escpos.ts`) but
|
||||
serves **no** `/prn_stat.htm` page. Running it on the Rongta driver made the monitor scrape a page
|
||||
that isn't there → a bogus `degraded`/page-error verdict even while the printer was fine (the
|
||||
incident that prompted this). Fix: a dedicated `cashino` driver that is **not** `MonitorableDevice`
|
||||
(no `readStatus`), so `isMonitorable()` is false and the monitor falls back to the generic
|
||||
`healthCheck()` — a plain **TCP reachability ping** of the print socket: reachable → `ready`,
|
||||
unreachable → `offline`, and **never** a guessed paper/cover state it cannot sense. This is the
|
||||
correct floor for any ESC/POS printer that can't report consumables: report only what you can
|
||||
actually observe. The shared ESC/POS rendering/transport (`renderTicket`/`renderReport`/
|
||||
`renderSubscriptionCard`/`sendRaw`/`probe`) was extracted to `printer-escpos.ts` so both drivers
|
||||
share the print path and only status differs.
|
||||
|
||||
## Status mapping (fail safe)
|
||||
|
||||
`readStatus()` maps to `ready | degraded | offline`:
|
||||
|
||||
Reference in New Issue
Block a user