diff --git a/tangostationcontrol/tangostationcontrol/integration_test/default/statistics/test_writer_sst.py b/tangostationcontrol/tangostationcontrol/integration_test/default/statistics/test_writer_sst.py index b6c9f41f710dbc4038ac33108deabdaf3c0ad813..88382175385a01e3493984fd1a53d026a19bbb02 100644 --- a/tangostationcontrol/tangostationcontrol/integration_test/default/statistics/test_writer_sst.py +++ b/tangostationcontrol/tangostationcontrol/integration_test/default/statistics/test_writer_sst.py @@ -71,11 +71,11 @@ class TestStatisticsWriterSST(BaseIntegrationTestCase): stat = stat_parser.get_statistic('2021-09-20T12:17:40.000+00:00') # same as stat_parser.statistics[0] self.assertIsNotNone(stat) self.assertEqual(121, stat.data_id_signal_input_index) - # RECV attributes are not present since the stats-writer is not connecting to any host - self.assertEqual(stat.rcu_attenuator_dB.tolist(), None) - self.assertEqual(stat.rcu_band_select.tolist(), None) - self.assertEqual(stat.rcu_dth_on.tolist(), None) - + # Test RECV attributes + self.assertListEqual(stat.rcu_attenuator_dB.tolist(), [0] * 96) + self.assertListEqual(stat.rcu_band_select.tolist(), [0] * 96) + self.assertListEqual(stat.rcu_dth_on.tolist(), [False] * 96) + def test_no_tango_SST_statistics(self): with TemporaryDirectory() as tmpdir: diff --git a/tangostationcontrol/tangostationcontrol/statistics/writer.py b/tangostationcontrol/tangostationcontrol/statistics/writer.py index 2ebd324768843accba920ece327ca8f024927950..d824151962aafa3d1834ceb7236f27b5a68007ec 100644 --- a/tangostationcontrol/tangostationcontrol/statistics/writer.py +++ b/tangostationcontrol/tangostationcontrol/statistics/writer.py @@ -153,11 +153,13 @@ def main(): logger.debug("Setting loglevel to DEBUG") # sets the Tango connection in order to retrieve attribute values - if tango_disabled or not host: + if tango_disabled: logger.warning("Tango connection is DISABLED") - device = None + device = None + elif host: + device = DeviceProxy(f"tango://{host}:10000/{args.device}".lower()) if mode == 'SST' else None else: - device = DeviceProxy(f"tango://{host}:10000/{args.device}".lower()) if mode=='SST' else None + device = DeviceProxy(args.device) if mode == 'SST' else None # creates the TCP receiver that is given to the writer receiver = _create_receiver(filename, host, port)