From 68b98aa89cd9647062a30935aa3dd01597f253ba Mon Sep 17 00:00:00 2001
From: Jan David Mol <mol@astron.nl>
Date: Tue, 15 Jun 2021 04:12:15 +0200
Subject: [PATCH] L2SS-244: Return a scalar if given a scalar

---
 devices/clients/opcua_connection.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/devices/clients/opcua_connection.py b/devices/clients/opcua_connection.py
index f6915250d..0f7ca6dc4 100644
--- a/devices/clients/opcua_connection.py
+++ b/devices/clients/opcua_connection.py
@@ -199,7 +199,8 @@ class ProtocolAttribute:
         value = numpy.array(self.node.get_value())
 
         if self.dim_y + self.dim_x == 1:
-            return numpy.array([value])
+            # scalar
+            return value
         elif self.dim_y != 0:
             value = numpy.array(numpy.split(value, indices_or_sections=self.dim_y))
         elif self.dim_y + self.dim_x == 1:
-- 
GitLab