From c2e645f45f8ae627c8b29227435788df3f56ea37 Mon Sep 17 00:00:00 2001 From: Antoine Prieels Date: Mon, 21 Oct 2019 06:48:24 +0000 Subject: [PATCH] [FIX] hw_drivers: Add manufacturer to scales At the moment the weight is read from all scales automatically. The problem is that Adam scales beep every time we read the weight, making them almost unusable in a shop. We set the manufacturer on the IoT Device to be able to identify those scales and get the weight manually instead of reading it automatically. closes odoo/odoo#39107 Taskid: 2089995 X-original-commit: 5bde93951b29c18d8361bd5ca759a8b2e190573a Signed-off-by: pimodoo --- addons/hw_drivers/drivers/SerialScaleDriver.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/addons/hw_drivers/drivers/SerialScaleDriver.py b/addons/hw_drivers/drivers/SerialScaleDriver.py index be04ce06384..42dbd6a9f2d 100644 --- a/addons/hw_drivers/drivers/SerialScaleDriver.py +++ b/addons/hw_drivers/drivers/SerialScaleDriver.py @@ -208,6 +208,10 @@ class Toledo8217Driver(ScaleDriver): """Driver for the Toldedo 8217 serial scale.""" _protocol = Toledo8217Protocol + def __init__(self, device): + super().__init__(device) + self._device_manufacturer = 'Toledo' + @classmethod def supported(cls, device): """Checks whether the device, which port info is passed as argument, is supported by the driver. @@ -245,6 +249,7 @@ class AdamEquipmentDriver(ScaleDriver): super().__init__(device) self._is_reading = False self._last_weight_time = 0 + self._device_manufacturer = 'Adam' def _check_last_weight_time(self): """The ADAM doesn't make the difference between a value of 0 and "the same value as last time":