xiaomi

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 9, 2025 License: MIT Imports: 19 Imported by: 0

README

Mi Fitness App

For Android is important to install Chinese application version - link. Because default app from GooglePlay won't work with "Eight Electrode Body Composition Scale".

Data

Mi Body Composition Scale S400 (MJTZC01YM)

{
  "basal_metabolism": 1582,
  "bmi": 23.6,
  "body_age": 36,
  "body_fat_rate": 19.6,
  "body_moisture_mass": 35.5,
  "body_score": 82,
  "bone_mass": 2.8,
  "bone_rate": 4.0,
  "bpm": 62,
  "fat_control": -4.0,
  "fat_free_body": 56.1,
  "fat_mass": 13.7,
  "moisture_rate": 51.0,
  "muscle_control": -1.4,
  "muscle_mass": 53.3,
  "muscle_rate": 76.4,
  "protein_mass": 17.2,
  "protein_rate": 24.6,
  "score_standard_type": 1,
  "skeletal_muscle_mass": 24.2,
  "somatotype": 0,
  "standard_weight": 64,
  "standard_weight_v2": 64.4,
  "time": 1732550224,
  "visceral_fat": 11.0,
  "weight": 69.8,
  "weight_control": -5.4,
  "whr": 1.2
}

Xiaomi Eight Electrode Body Composition Scale (XMTZC01YM)

{
    "basal_metabolism": 1632,
    "bmi": 22.4,
    "body_age": 34,
    "body_fat_rate": 12,
    "body_moisture_mass": 43.4,
    "body_score": 90,
    "body_shape": 4,
    "bone_mass": 3.2,
    "bone_rate": 4.8,
    "bpm": 81,
    "fat_control": 2.8,
    "fat_mass": 8,
    "left_lower_limb_fat_mass": 1.4,
    "left_lower_limb_fat_rank": 0,
    "left_lower_limb_muscle_mass": 9.1,
    "left_lower_limb_muscle_rank": 0,
    "left_upper_limb_fat_mass": 0.4,
    "left_upper_limb_fat_rank": -1,
    "left_upper_limb_muscle_mass": 3.2,
    "left_upper_limb_muscle_rank": 0,
    "limbs_fat_balance": 1,
    "limbs_muscle_balance": 0,
    "limbs_skeletal_muscle_index": 8.3,
    "lower_limb_fat_balance": 0,
    "lower_limb_muscle_balance": 0,
    "moisture_rate": 65.3,
    "muscle_control": -5.4,
    "muscle_mass": 55.2,
    "muscle_rate": 83.1,
    "protein_mass": 11.8,
    "protein_rate": 17.8,
    "recommended_calories_intake": 2366,
    "right_lower_limb_fat_mass": 1.4,
    "right_lower_limb_fat_rank": 0,
    "right_lower_limb_muscle_mass": 9.2,
    "right_lower_limb_muscle_rank": 0,
    "right_upper_limb_fat_mass": 0.4,
    "right_upper_limb_fat_rank": -1,
    "right_upper_limb_muscle_mass": 3.2,
    "right_upper_limb_muscle_rank": 0,
    "somatotype": 1,
    "standard_weight": 63,
    "standard_weight_v2": 63.7,
    "time": 1743935472,
    "trunk_fat_mass": 4,
    "trunk_fat_rank": 0,
    "trunk_muscle_mass": 25.1,
    "trunk_muscle_rank": 0,
    "upper_limb_fat_balance": 0,
    "upper_limb_muscle_balance": 0,
    "visceral_fat": 3,
    "weight": 66.4,
    "weight_control": -2.6,
    "whr": 0.8
}

Documentation

Index

Constants

View Source
const (
	AppXiaomiHome = "xiaomiio"
	AppMiFitness  = "miothealth"
)

Variables

This section is empty.

Functions

func Crypt

func Crypt(key, plaintext []byte) ([]byte, error)

func GenNonce

func GenNonce() []byte

func GenSignature64

func GenSignature64(method, url string, values url.Values, signedNonce []byte) string

func GenSignedNonce

func GenSignedNonce(ssecurity, nonce []byte) []byte

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(app string) *Client

func (*Client) GetAllWeights

func (c *Client) GetAllWeights() ([]*core.Weight, error)

func (*Client) GetFamilyMembers

func (c *Client) GetFamilyMembers() (map[int64]string, error)

func (*Client) GetFilterWeights added in v0.2.0

func (c *Client) GetFilterWeights(model string) ([]*core.Weight, error)

func (*Client) Login

func (c *Client) Login(username, password string) error

func (*Client) LoginWithToken

func (c *Client) LoginWithToken(token string) error

func (*Client) OAuth2

func (c *Client) OAuth2(params, username, password string) (string, error)

func (*Client) Request

func (c *Client) Request(apiURL, params string) (data []byte, err error)

func (*Client) Token

func (c *Client) Token() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL