Exemple #1
0
def test_96():
    assert float_equals(UAS_IDS[0x96](b("8000")),
                        Unit.Quantity(-3276.8, Unit.celsius))
    assert float_equals(UAS_IDS[0x96](b("FFFF")),
                        Unit.Quantity(-0.1, Unit.celsius))
    assert float_equals(UAS_IDS[0x96](b("0000")),
                        Unit.Quantity(0, Unit.celsius))
    assert float_equals(UAS_IDS[0x96](b("0001")),
                        Unit.Quantity(0.1, Unit.celsius))
    assert float_equals(UAS_IDS[0x96](b("7FFF")),
                        Unit.Quantity(3276.7, Unit.celsius))
Exemple #2
0
def test_16():
    assert UAS_IDS[0x16](b("0000")) == Unit.Quantity(-40, Unit.celsius)
    assert UAS_IDS[0x16](b("0001")) == Unit.Quantity(-39.9, Unit.celsius)
    assert UAS_IDS[0x16](b("00DC")) == Unit.Quantity(-18, Unit.celsius)
    assert UAS_IDS[0x16](b("0190")) == Unit.Quantity(0, Unit.celsius)
    assert UAS_IDS[0x16](b("FFFF")) == Unit.Quantity(6513.5, Unit.celsius)
def test_temp():
    assert d.temp(m("4100" + "00")) == Unit.Quantity(-40, Unit.celsius)
    assert d.temp(m("4100" + "FF")) == Unit.Quantity(215, Unit.celsius)
    assert d.temp(m("4100" + "03E8")) == Unit.Quantity(960, Unit.celsius)