# Path: pypozyx/definitions/registers.py
# POZYX_TEMPERATURE = 0x80  # Temperature
# 
# POZYX_PRESSURE = 0x50  # Pressure data in mPa
# 
# POZYX_MAX_LIN_ACC = 0x4E  # Return the max linear acceleration and reset it to 0


from pypozyx import *
from pypozyx.definitions.registers import POZYX_TEMPERATURE, POZYX_PRESSURE, POZYX_MAX_LIN_ACC
from time import sleep
    assert temperature == other_temperature, "default temperature objects aren't equal"
    raw_temperature = Data([0], 'b')
    assert raw_temperature == temperature, "temperature not right format of Data([0], 'b')"


def test_raw_temperature_read(pozyx, remote):
    raw_temperature = Data([0], 'b')
    status = pozyx.getRead(POZYX_TEMPERATURE, raw_temperature)
    assert status == POZYX_SUCCESS, "raw read of temperature unsuccessful"
    assert type(raw_temperature[0]) == type(
        1), "temperature value is not an int"


def test_temperature_read(pozyx, remote):
    temperature = Temperature()
    status = pozyx.getTemperature_c(temperature, remote)
    assert status == POZYX_SUCCESS, "getTemperature_c unsuccessful"
    assert type(temperature.value) == type(
        1.0), "temperature value is not a float"
    assert temperature.value > 0, "temperature is freezing"
    assert temperature.value < 150, "temperature is way too hot"
    float_remainder = temperature.value - int(temperature.value)
    assert float_remainder < 0.01, "temperature accuracy not 1 °C"


def test_temperature_conversion(pozyx, remote):
    temperature = Temperature()
    status = pozyx.getTemperature_c(temperature, remote)
    assert status == POZYX_SUCCESS, "getTemperature_c unsuccessful"
    raw_temperature = Data([0], 'b')

# Path: pypozyx/definitions/registers.py
# POZYX_TEMPERATURE = 0x80  # Temperature
# 
# POZYX_PRESSURE = 0x50  # Pressure data in mPa
# 
# POZYX_MAX_LIN_ACC = 0x4E  # Return the max linear acceleration and reset it to 0


# Path: unit_tests/test_sensor.py
from pypozyx import *
from pypozyx.definitions.registers import POZYX_TEMPERATURE, POZYX_PRESSURE, POZYX_MAX_LIN_ACC
from time import sleep

    assert temperature == other_temperature, "default temperature objects aren't equal"
    raw_temperature = Data([0], 'b')
    assert raw_temperature == temperature, "temperature not right format of Data([0], 'b')"


def test_raw_temperature_read(pozyx, remote):
    raw_temperature = Data([0], 'b')
    status = pozyx.getRead(POZYX_TEMPERATURE, raw_temperature)
    assert status == POZYX_SUCCESS, "raw read of temperature unsuccessful"
    assert type(raw_temperature[0]) == type(
        1), "temperature value is not an int"


def test_temperature_read(pozyx, remote):
    temperature = Temperature()
    status = pozyx.getTemperature_c(temperature, remote)
    assert status == POZYX_SUCCESS, "getTemperature_c unsuccessful"
    assert type(temperature.value) == type(
        1.0), "temperature value is not a float"
    assert temperature.value > 0, "temperature is freezing"
    assert temperature.value < 150, "temperature is way too hot"
    float_remainder = temperature.value - int(temperature.value)
    assert float_remainder < 0.01, "temperature accuracy not 1 °C"


def test_temperature_conversion(pozyx, remote):
    temperature = Temperature()
    status = pozyx.getTemperature_c(temperature, remote)
    assert status == POZYX_SUCCESS, "getTemperature_c unsuccessful"
    raw_temperature = Data([0], 'b')

    status = pozyx.getRead(POZYX_TEMPERATURE, raw_temperature)