Bump brother and pysnmplib backend libraries (#89100)

* Bump brother and pysnmplib

* Fix tests
This commit is contained in:
Maciej Bieniek 2023-03-05 12:40:12 +01:00 committed by GitHub
parent 62b0603b76
commit 6dc99d2ad8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 10 additions and 13 deletions

View file

@ -8,7 +8,7 @@
"iot_class": "local_polling",
"loggers": ["brother", "pyasn1", "pysmi", "pysnmp"],
"quality_scale": "platinum",
"requirements": ["brother==2.2.0"],
"requirements": ["brother==2.3.0"],
"zeroconf": [
{
"type": "_printer._tcp.local.",

View file

@ -5,5 +5,5 @@
"documentation": "https://www.home-assistant.io/integrations/snmp",
"iot_class": "local_polling",
"loggers": ["pyasn1", "pysmi", "pysnmp"],
"requirements": ["pysnmplib==5.0.20"]
"requirements": ["pysnmplib==5.0.21"]
}

View file

@ -145,7 +145,7 @@ async def async_setup_platform(
ContextData(),
]
get_result = await getCmd(*request_args, ObjectType(ObjectIdentity(baseoid)))
errindication, _, _, _ = await get_result
errindication, _, _, _ = get_result
if errindication and not accept_errors:
_LOGGER.error("Please check the details in the configuration file")
@ -207,7 +207,7 @@ class SnmpData:
get_result = await getCmd(
*self._request_args, ObjectType(ObjectIdentity(self._baseoid))
)
errindication, errstatus, errindex, restable = await get_result
errindication, errstatus, errindex, restable = get_result
if errindication and not self._accept_errors:
_LOGGER.error("SNMP error: %s", errindication)

View file

@ -261,7 +261,7 @@ class SnmpSwitch(SwitchEntity):
get_result = await getCmd(
*self._request_args, ObjectType(ObjectIdentity(self._baseoid))
)
errindication, errstatus, errindex, restable = await get_result
errindication, errstatus, errindex, restable = get_result
if errindication:
_LOGGER.error("SNMP error: %s", errindication)

View file

@ -480,7 +480,7 @@ boto3==1.20.24
broadlink==0.18.3
# homeassistant.components.brother
brother==2.2.0
brother==2.3.0
# homeassistant.components.brottsplatskartan
brottsplatskartan==0.0.1
@ -1982,7 +1982,7 @@ pysmarty==0.8
pysml==0.0.8
# homeassistant.components.snmp
pysnmplib==5.0.20
pysnmplib==5.0.21
# homeassistant.components.snooz
pysnooz==0.8.3

View file

@ -393,7 +393,7 @@ boschshcpy==0.2.35
broadlink==0.18.3
# homeassistant.components.brother
brother==2.2.0
brother==2.3.0
# homeassistant.components.brunt
brunt==1.2.0
@ -1435,7 +1435,7 @@ pysmartthings==0.7.6
pysml==0.0.8
# homeassistant.components.snmp
pysnmplib==5.0.20
pysnmplib==5.0.21
# homeassistant.components.snooz
pysnooz==0.8.3

View file

@ -1,6 +1,5 @@
"""SNMP sensor tests."""
import asyncio
from unittest.mock import MagicMock, Mock, patch
import pytest
@ -16,11 +15,9 @@ def hlapi_mock():
"""Mock out 3rd party API."""
mock_data = MagicMock()
mock_data.prettyPrint = Mock(return_value="13.5")
future = asyncio.get_event_loop().create_future()
future.set_result((None, None, None, [[mock_data]]))
with patch(
"homeassistant.components.snmp.sensor.getCmd",
return_value=future,
return_value=(None, None, None, [[mock_data]]),
):
yield