[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 <pimodoo@users.noreply.github.com>
This commit is contained in:
Antoine Prieels
2019-10-21 09:57:15 +00:00
committed by fw-bot
parent 5d835f1f50
commit c2e645f45f
@@ -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":