fix / add serial_number to get-detectors route
This commit is contained in:
@@ -32,7 +32,7 @@ class DetectorSerializer(serializers.ModelSerializer):
|
||||
|
||||
class Meta:
|
||||
model = Sensor
|
||||
fields = ('detector_id', 'type', 'name', 'object', 'status', 'zone', 'floor', 'notifications')
|
||||
fields = ('detector_id', 'type', 'serial_number', 'name', 'object', 'status', 'zone', 'floor', 'notifications')
|
||||
|
||||
def get_detector_id(self, obj):
|
||||
return obj.name or f"{obj.sensor_type.code}-{obj.id}"
|
||||
|
||||
Reference in New Issue
Block a user