* feature: switch almost everything to pydantic BaseModel * feature: swap more dataclasses over to pydantic models * feature: use more model serializers to make data handle better * bug: fix some serialization issues with `None` values * bug: fix some initialization problems with miner mode config * bug: fix new BOS+ pool parsing * bug: fix new BOS+ board temperature parsing serialization error * bug: more misc fixes with serialization, extra methods, and hashrate types * bug: add explicit type conversions to hashrate types * bug: fix epic pool URL parsing * bug: fix positional args in hashboards * bug: fix epic missing url scheme * convert board temp to int --------- Co-authored-by: Upstream Data <brett@upstreamdata.ca> Co-authored-by: John-Paul Compagnone <jpcompagnone@epicblockchain.io>
29 lines
1.5 KiB
Python
29 lines
1.5 KiB
Python
# ------------------------------------------------------------------------------
|
|
# Copyright 2022 Upstream Data Inc -
|
|
# -
|
|
# Licensed under the Apache License, Version 2.0 (the "License"); -
|
|
# you may not use this file except in compliance with the License. -
|
|
# You may obtain a copy of the License at -
|
|
# -
|
|
# http://www.apache.org/licenses/LICENSE-2.0 -
|
|
# -
|
|
# Unless required by applicable law or agreed to in writing, software -
|
|
# distributed under the License is distributed on an "AS IS" BASIS, -
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -
|
|
# See the License for the specific language governing permissions and -
|
|
# limitations under the License. -
|
|
# ------------------------------------------------------------------------------
|
|
from pyasic.data.error_codes.base import BaseMinerError
|
|
|
|
|
|
class X19Error(BaseMinerError):
|
|
"""A Dataclass to handle error codes of X19 miners.
|
|
|
|
Attributes:
|
|
error_message: The error message as a string.
|
|
error_code: The error code as an int. 0 if the message is not assigned a code.
|
|
"""
|
|
|
|
error_message: str
|
|
error_code: int = 0
|