code
stringlengths
227
324k
indentifier
stringlengths
171
323k
lang
stringclasses
2 values
be positive '30074': InvalidOrder, # can't create the stop order, because you expect the order will be triggered when the LastPrice(or IndexPrice、 MarkPrice, determined by trigger_by) is raising to stop_px, but the LastPrice(or IndexPrice、 MarkPrice) is already equal to or greater than stop_px, please adjust base_price...
be positive '30074': InvalidOrder, # can't create the stop order, because you expect the order will be triggered when the LastPrice(or IndexPrice、 MarkPrice, determined by trigger_by) is raising to stop_px, but the LastPrice(or IndexPrice、 MarkPrice) is already equal to or greater than stop_px, please adjust base_price...
python
deposit = False withdraw = False for j in range(0, len(chains)): chain = chains[j] networkId = self.safe_string(chain, 'chain') networkCode = self.network_id_to_code(networkId) precision = self.parse_number(self.parse_precision(self.safe_string(chain, 'minAccuracy'))) minPrecision = precision if (minPrecision is None) ...
deposit = False withdraw = False for j in range(0, len(chains)): chain = chains[j] networkId = self.safe_string(chain, 'chain') networkCode = self.network_id_to_code(networkId) precision = self.parse_number(self.parse_precision(self.safe_string(chain, 'minAccuracy'))) minPrecision = precision if (minPrecision is None) ...
python
= False for j in range(0, len(chains)): chain = chains[j] networkId = self.safe_string(chain, 'chain') networkCode = self.network_id_to_code(networkId) precision = self.parse_number(self.parse_precision(self.safe_string(chain, 'minAccuracy'))) minPrecision = precision if (minPrecision is None) else min(minPrecision, pr...
= False for j in range(0, len(chains)): chain = chains[j] networkId = self.safe_string(chain, 'chain') networkCode = self.network_id_to_code(networkId) precision = self.parse_number(self.parse_precision(self.safe_string(chain, 'minAccuracy'))) minPrecision = precision if (minPrecision is None) else min(minPrecision, pr...
python
networkId = self.safe_string(chain, 'chain') networkCode = self.network_id_to_code(networkId) precision = self.parse_number(self.parse_precision(self.safe_string(chain, 'minAccuracy'))) minPrecision = precision if (minPrecision is None) else min(minPrecision, precision) depositAllowed = self.safe_integer(chain, 'chainD...
networkId = self.safe_string(chain, 'chain') networkCode = self.network_id_to_code(networkId) precision = self.parse_number(self.parse_precision(self.safe_string(chain, 'minAccuracy'))) minPrecision = precision if (minPrecision is None) else min(minPrecision, precision) depositAllowed = self.safe_integer(chain, 'chainD...
python
networkCode = self.network_id_to_code(networkId) precision = self.parse_number(self.parse_precision(self.safe_string(chain, 'minAccuracy'))) minPrecision = precision if (minPrecision is None) else min(minPrecision, precision) depositAllowed = self.safe_integer(chain, 'chainDeposit') == 1 deposit = depositAllowed if (de...
networkCode = self.network_id_to_code(networkId) precision = self.parse_number(self.parse_precision(self.safe_string(chain, 'minAccuracy'))) minPrecision = precision if (minPrecision is None) else min(minPrecision, precision) depositAllowed = self.safe_integer(chain, 'chainDeposit') == 1 deposit = depositAllowed if (de...
python
== 1 withdraw = withdrawAllowed if (withdrawAllowed) else withdraw withdrawFeeString = self.safe_string(chain, 'withdrawFee') if withdrawFeeString is not None: minWithdrawFeeString = withdrawFeeString if (minWithdrawFeeString is None) else Precise.string_min(withdrawFeeString, minWithdrawFeeString) minNetworkWithdrawSt...
== 1 withdraw = withdrawAllowed if (withdrawAllowed) else withdraw withdrawFeeString = self.safe_string(chain, 'withdrawFee') if withdrawFeeString is not None: minWithdrawFeeString = withdrawFeeString if (minWithdrawFeeString is None) else Precise.string_min(withdrawFeeString, minWithdrawFeeString) minNetworkWithdrawSt...
python
= withdrawAllowed if (withdrawAllowed) else withdraw withdrawFeeString = self.safe_string(chain, 'withdrawFee') if withdrawFeeString is not None: minWithdrawFeeString = withdrawFeeString if (minWithdrawFeeString is None) else Precise.string_min(withdrawFeeString, minWithdrawFeeString) minNetworkWithdrawString = self.sa...
= withdrawAllowed if (withdrawAllowed) else withdraw withdrawFeeString = self.safe_string(chain, 'withdrawFee') if withdrawFeeString is not None: minWithdrawFeeString = withdrawFeeString if (minWithdrawFeeString is None) else Precise.string_min(withdrawFeeString, minWithdrawFeeString) minNetworkWithdrawString = self.sa...
python
"""Tests for the SmartThings component init module.""" from collections.abc import Callable, Coroutine from datetime import datetime, timedelta from http import HTTPStatus from typing import Any from unittest.mock import Mock, patch from uuid import uuid4 from aiohttp import ClientConnectionError, ClientResponseError f...
"""Tests for the SmartThings component init module.""" from collections.abc import Callable, Coroutine from datetime import datetime, timedelta from http import HTTPStatus from typing import Any from unittest.mock import Mock, patch from uuid import uuid4 from aiohttp import ClientConnectionError, ClientResponseError f...
python
component init module.""" from collections.abc import Callable, Coroutine from datetime import datetime, timedelta from http import HTTPStatus from typing import Any from unittest.mock import Mock, patch from uuid import uuid4 from aiohttp import ClientConnectionError, ClientResponseError from pysmartthings import Inst...
component init module.""" from collections.abc import Callable, Coroutine from datetime import datetime, timedelta from http import HTTPStatus from typing import Any from unittest.mock import Mock, patch from uuid import uuid4 from aiohttp import ClientConnectionError, ClientResponseError from pysmartthings import Inst...
python
config_entries from homeassistant.components import cloud, smartthings from homeassistant.components.smartthings.const import ( CONF_CLOUDHOOK_URL, CONF_INSTALLED_APP_ID, CONF_REFRESH_TOKEN, DATA_BROKERS, DOMAIN, EVENT_BUTTON, PLATFORMS, SIGNAL_SMARTTHINGS_UPDATE, ) from homeassistant.config_entries import ConfigEntryS...
config_entries from homeassistant.components import cloud, smartthings from homeassistant.components.smartthings.const import ( CONF_CLOUDHOOK_URL, CONF_INSTALLED_APP_ID, CONF_REFRESH_TOKEN, DATA_BROKERS, DOMAIN, EVENT_BUTTON, PLATFORMS, SIGNAL_SMARTTHINGS_UPDATE, ) from homeassistant.config_entries import ConfigEntryS...
python
import async_process_ha_core_config from homeassistant.exceptions import ConfigEntryNotReady from homeassistant.helpers.dispatcher import async_dispatcher_connect from tests.common import MockConfigEntry async def test_migration_creates_new_flow( hass: HomeAssistant, smartthings_mock, config_entry ) -> None: """Test mi...
import async_process_ha_core_config from homeassistant.exceptions import ConfigEntryNotReady from homeassistant.helpers.dispatcher import async_dispatcher_connect from tests.common import MockConfigEntry async def test_migration_creates_new_flow( hass: HomeAssistant, smartthings_mock, config_entry ) -> None: """Test mi...
python
is initiated when there are API errors. 401 (unauthorized): Occurs when the access token is no longer valid. 403 (forbidden/not found): Occurs when the app or installed app could not be retrieved/found (likely deleted?) """ config_entry.add_to_hass(hass) request_info = Mock(real_url="http://example.com") smartthings_mo...
is initiated when there are API errors. 401 (unauthorized): Occurs when the access token is no longer valid. 403 (forbidden/not found): Occurs when the app or installed app could not be retrieved/found (likely deleted?) """ config_entry.add_to_hass(hass) request_info = Mock(real_url="http://example.com") smartthings_mo...
python
not in hass.data[DOMAIN][DATA_BROKERS] # Assert platforms unloaded await hass.async_block_till_done() assert forward_mock.call_count == len(PLATFORMS) async def test_remove_entry( hass: HomeAssistant, config_entry, smartthings_mock ) -> None: """Test that the installed app and app are removed up.""" # Act await smartth...
not in hass.data[DOMAIN][DATA_BROKERS] # Assert platforms unloaded await hass.async_block_till_done() assert forward_mock.call_count == len(PLATFORMS) async def test_remove_entry( hass: HomeAssistant, config_entry, smartthings_mock ) -> None: """Test that the installed app and app are removed up.""" # Act await smartth...
python
assert smartthings_mock.delete_installed_app.call_count == 1 assert smartthings_mock.delete_app.call_count == 1 async def test_remove_entry_cloudhook( hass: HomeAssistant, config_entry, smartthings_mock ) -> None: """Test that the installed app, app, and cloudhook are removed up.""" hass.config.components.add("cloud") ...
assert smartthings_mock.delete_installed_app.call_count == 1 assert smartthings_mock.delete_app.call_count == 1 async def test_remove_entry_cloudhook( hass: HomeAssistant, config_entry, smartthings_mock ) -> None: """Test that the installed app, app, and cloudhook are removed up.""" hass.config.components.add("cloud") ...
python
mock_async_is_logged_in, patch.object(cloud, "async_delete_cloudhook") as mock_async_delete_cloudhook, ): await smartthings.async_remove_entry(hass, config_entry) # Assert assert smartthings_mock.delete_installed_app.call_count == 1 assert smartthings_mock.delete_app.call_count == 1 assert mock_async_is_logged_in.call_...
mock_async_is_logged_in, patch.object(cloud, "async_delete_cloudhook") as mock_async_delete_cloudhook, ): await smartthings.async_remove_entry(hass, config_entry) # Assert assert smartthings_mock.delete_installed_app.call_count == 1 assert smartthings_mock.delete_app.call_count == 1 assert mock_async_is_logged_in.call_...
python
is not removed if in use by another config entry.""" # Arrange config_entry.add_to_hass(hass) data = config_entry.data.copy() data[CONF_INSTALLED_APP_ID] = str(uuid4()) entry2 = MockConfigEntry(version=2, domain=DOMAIN, data=data) entry2.add_to_hass(hass) # Act await smartthings.async_remove_entry(hass, config_entry) #...
is not removed if in use by another config entry.""" # Arrange config_entry.add_to_hass(hass) data = config_entry.data.copy() data[CONF_INSTALLED_APP_ID] = str(uuid4()) entry2 = MockConfigEntry(version=2, domain=DOMAIN, data=data) entry2.add_to_hass(hass) # Act await smartthings.async_remove_entry(hass, config_entry) #...
python