Skip to content

Commit

Permalink
Use property setters in Sensor init.
Browse files Browse the repository at this point in the history
  • Loading branch information
dboulware committed Jan 17, 2024
1 parent e5f5ac2 commit 83f7dc9
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions scos_actions/hardware/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
from its_preselector.web_relay import WebRelay

from .gps_iface import GPSInterface
from .mocks.mock_gps import MockGPS
from .mocks.mock_sigan import MockSignalAnalyzer
from .sigan_iface import SignalAnalyzerInterface

Expand All @@ -16,19 +15,20 @@ class Sensor:
def __init__(
self,
signal_analyzer: SignalAnalyzerInterface = MockSignalAnalyzer,
gps: GPSInterface = MockGPS(),
gps: GPSInterface = None,
preselector: Preselector = None,
switches: Dict[str, WebRelay] = {},
location: dict = None,
capabilities: dict = None,
):
self._signal_analyzer = signal_analyzer
self._gps = gps
self._preselector = preselector
self._switches = switches
self._location = location
self.signal_analyzer = signal_analyzer
self.gps = gps
self.preselector = preselector
self.switches = switches
self.location = location
self.capabilities = capabilities
self_start_time = datetime.datetime.utcnow()
# There is no setter for start_time property
self._start_time = datetime.datetime.utcnow()

@property
def signal_analyzer(self) -> SignalAnalyzerInterface:
Expand Down

0 comments on commit 83f7dc9

Please sign in to comment.