• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

ByteOps-swe / MVP / 8459207372

27 Mar 2024 10:01PM UTC coverage: 80.968% (-0.3%) from 81.25%
8459207372

push

github

Barutta02
Merge branch 'main' of https://github.com/ByteOps-swe/MVP

1740 of 2149 relevant lines covered (80.97%)

0.81 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

88.24
/PythonSensorsSimulator/Model/Simulators/temperature_simulator.py
1
import random
1✔
2
from .simulator import simulator
1✔
3
from .sensor_types import sensor_types
1✔
4

5
class temperature_simulator(simulator):
1✔
6
    __count = 0
1✔
7

8
    def __init__(self, latitude: float, longitude: float, cella: str = "Centro", initial_temperature=20):
1✔
9
        temperature_simulator.__count += 1
1✔
10
        super().__init__(
1✔
11
            latitude,
12
            longitude,
13
            cella,
14
            f"Tmp{temperature_simulator.__count}",
15
            initial_temperature,
16
            sensor_types.TEMPERATURE.value
17
        )
18

19
    def _generate_measure(self) -> None:
1✔
20
        variation = random.uniform(-0.5, 0.5)
1✔
21
        new_measurement = self._misurazione + variation
1✔
22
        if -15 <= new_measurement <= 45:
1✔
23
            self._misurazione = new_measurement
1✔
24
        if self._misurazione < -15:
1✔
25
            self._misurazione += 0.5
×
26
        if self._misurazione > 45:
1✔
27
            self._misurazione -= 0.5
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc