Skip to content

termux-battery-status float delimiter changed after v50 -> v51 #763

@mrkeuz

Description

@mrkeuz

After update to termux-api v51 termux-battery-status output JSON changed float format and replace dot to comma as delimiter for temperature field (maybe other). So previous parsers cannot work with such JSON. It is also common to use a dot in floating point numbers.

Previous:

{
  "health": "GOOD",
  "percentage": 47,
  "plugged": "UNPLUGGED",
  "status": "DISCHARGING",
  "temperature": 27.100000381469727,
  "current": -60700
}

Current:

{
  "present": true,
  "technology": "Li-ion",
  "health": "GOOD",
  "plugged": "UNPLUGGED",
  "status": "DISCHARGING",
  "temperature": "27,4",
  "voltage": 3996,
  "current": -285300,
  "current_average": -267900,
  "percentage": 77,
  "level": 77,
  "scale": 100,
  "charge_counter": 2268420,
  "energy": null
}

Steps to reproduce

  • Run termux-battery-status

Expected behavior
Dot as delimiter for floats in json output.

Additional information

  • termux-api application version: 0.51.0 (f-droid)
  • termux-api package version (installed through apt): 0.59.1
  • Android OS version: 13
  • Device model: F+ R570E

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions