From 6f6f5743cfd2e693043d6a162eed4dc8343851bb Mon Sep 17 00:00:00 2001 From: John-Paul Compagnone Date: Thu, 21 Dec 2023 01:33:46 -0500 Subject: [PATCH 1/3] add get_config to ePIC backend --- pyasic/config/__init__.py | 7 +++++++ pyasic/config/fans.py | 11 +++++++++++ pyasic/config/mining.py | 13 +++++++++++++ pyasic/config/pools.py | 16 ++++++++++++++++ pyasic/config/temperature.py | 18 ++++++++++++++++++ pyasic/miners/backends/epic.py | 18 ++++++++++++++++++ 6 files changed, 83 insertions(+) diff --git a/pyasic/config/__init__.py b/pyasic/config/__init__.py index 3962abb1..180acee4 100644 --- a/pyasic/config/__init__.py +++ b/pyasic/config/__init__.py @@ -160,6 +160,13 @@ class MinerConfig: temperature=TemperatureConfig.from_bosminer(toml_conf), power_scaling=PowerScalingConfig.from_bosminer(toml_conf), ) + + @classmethod + def from_epic(cls, web_conf: dict) -> "MinerConfig": + return cls(pools=PoolConfig.from_epic(web_conf), + fan_mode=FanModeConfig.from_epic(web_conf), + temperature=TemperatureConfig.from_epic(web_conf), + mining_mode=MiningModeConfig.from_epic(web_conf)) def merge(a: dict, b: dict) -> dict: diff --git a/pyasic/config/fans.py b/pyasic/config/fans.py index 02cb127e..7ddd629d 100644 --- a/pyasic/config/fans.py +++ b/pyasic/config/fans.py @@ -115,6 +115,17 @@ class FanModeConfig(MinerConfigOption): return cls.normal() else: return cls.default() + + @classmethod + def from_epic(cls, web_conf: dict): + if web_conf.get("Fans") is not None: + fan_mode = web_conf["Fans"]["Fan Mode"] + if fan_mode.get("Manual") is not None: + return cls.manual(speed=fan_mode.get("Manual")) + else: + return cls.normal() + else: + return cls.default() @classmethod def from_bosminer(cls, toml_conf: dict): diff --git a/pyasic/config/mining.py b/pyasic/config/mining.py index 010d556e..3e35f4d5 100644 --- a/pyasic/config/mining.py +++ b/pyasic/config/mining.py @@ -185,6 +185,19 @@ class MiningModeConfig(MinerConfigOption): elif int(work_mode) == 3: return cls.low() return cls.default() + + @classmethod + def from_epic(cls, web_conf: dict): + if web_conf.get("PerpetualTune") is not None: + work_mode = web_conf["PerpetualTune"] + if work_mode["Running"] == True: + if web_conf["PerpetualTune"]["Algorithm"].get("VoltageOptimizer") is not None: + return cls.hashrate_tuning(web_conf["PerpetualTune"]["Algorithm"]["VoltageOptimizer"].get("Target")) + else: + return cls.hashrate_tuning() + else: + return cls.normal() + return cls.default() @classmethod def from_bosminer(cls, toml_conf: dict): diff --git a/pyasic/config/pools.py b/pyasic/config/pools.py index e90c1fa6..3d3c9d85 100644 --- a/pyasic/config/pools.py +++ b/pyasic/config/pools.py @@ -107,6 +107,10 @@ class Pool(MinerConfigValue): @classmethod def from_api(cls, api_pool: dict) -> "Pool": return cls(url=api_pool["URL"], user=api_pool["User"], password="x") + + @classmethod + def from_epic(cls, api_pool: dict) -> "Pool": + return cls(url=api_pool["pool"].replace("stratum+tcp://", ""), user=api_pool["login"], password=api_pool["password"]) @classmethod def from_am_modern(cls, web_pool: dict) -> "Pool": @@ -236,6 +240,13 @@ class PoolGroup(MinerConfigValue): for pool in api_pool_list: pools.append(Pool.from_api(pool)) return cls(pools=pools) + + @classmethod + def from_epic(cls, api_pool_list: list) -> "PoolGroup": + pools = [] + for pool in api_pool_list: + pools.append(Pool.from_epic(pool)) + return cls(pools=pools) @classmethod def from_am_modern(cls, web_pool_list: list) -> "PoolGroup": @@ -333,6 +344,11 @@ class PoolConfig(MinerConfigValue): pool_data = sorted(pool_data, key=lambda x: int(x["POOL"])) return cls([PoolGroup.from_api(pool_data)]) + + @classmethod + def from_epic(cls, web_conf: dict) -> "PoolConfig": + pool_data = web_conf["StratumConfigs"] + return cls([PoolGroup.from_epic(pool_data)]) @classmethod def from_am_modern(cls, web_conf: dict) -> "PoolConfig": diff --git a/pyasic/config/temperature.py b/pyasic/config/temperature.py index d875104b..2082d89d 100644 --- a/pyasic/config/temperature.py +++ b/pyasic/config/temperature.py @@ -56,3 +56,21 @@ class TemperatureConfig(MinerConfigValue): hot=temp_control.get("hot_temp"), danger=temp_control.get("dangerous_temp"), ) + @classmethod + def from_epic(cls, web_conf: dict) -> "TemperatureConfig": + ## we only have a target temp if we are in auto-fan mode, so + ## we need to check for that + if web_conf.get("Misc") is not None: + target_temp = web_conf["Misc"]["Shutdown Temp"] + hot_temp = web_conf["Misc"]["Shutdown Temp"] + dangerous_temp = web_conf["Misc"]["Shutdown Temp"] + + if web_conf["Fans"]["Fan Mode"].get("Auto") is not None: + target_temp = web_conf["Fans"]["Fan Mode"]["Auto"]["Target Temperature"] + + if web_conf.get("Misc") is not None: + return cls( + target=target_temp, + hot=hot_temp, + danger=dangerous_temp + ) diff --git a/pyasic/miners/backends/epic.py b/pyasic/miners/backends/epic.py index f40a93b1..13d576d1 100644 --- a/pyasic/miners/backends/epic.py +++ b/pyasic/miners/backends/epic.py @@ -18,6 +18,7 @@ from typing import List, Optional, Tuple, Union from pyasic.data import Fan, HashBoard from pyasic.data.error_codes import MinerErrorData, X19Error +from pyasic.config import MinerConfig, MiningModeConfig from pyasic.errors import APIError from pyasic.logger import logger from pyasic.miners.backends.bmminer import BMMiner @@ -73,7 +74,24 @@ class ePIC(BMMiner): if self.model is not None: return self.model + " (ePIC)" return "? (ePIC)" + + async def get_config(self) -> MinerConfig: + summary = None + try: + summary = await self.web.summary() + except APIError as e: + logger.warning(e) + except LookupError: + pass + if summary is not None: + cfg = MinerConfig.from_epic(summary) + else: + cfg = MinerConfig() + + self.config = cfg + return self.config + async def restart_backend(self) -> bool: data = await self.web.restart_epic() if data: From 07f92557c6e9d9de6a1ebd52d681b5b112bad7ad Mon Sep 17 00:00:00 2001 From: John-Paul Compagnone Date: Thu, 21 Dec 2023 01:38:10 -0500 Subject: [PATCH 2/3] cover chiptune case --- pyasic/config/mining.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyasic/config/mining.py b/pyasic/config/mining.py index 3e35f4d5..78c5bb2e 100644 --- a/pyasic/config/mining.py +++ b/pyasic/config/mining.py @@ -194,7 +194,7 @@ class MiningModeConfig(MinerConfigOption): if web_conf["PerpetualTune"]["Algorithm"].get("VoltageOptimizer") is not None: return cls.hashrate_tuning(web_conf["PerpetualTune"]["Algorithm"]["VoltageOptimizer"].get("Target")) else: - return cls.hashrate_tuning() + return cls.hashrate_tuning(web_conf["PerpetualTune"]["Algorithm"]["ChipTune"].get("Target")) else: return cls.normal() return cls.default() From 2e28060e051435a71d4bc48056a1e80a8f916a17 Mon Sep 17 00:00:00 2001 From: John-Paul Compagnone Date: Sat, 23 Dec 2023 15:01:42 -0500 Subject: [PATCH 3/3] fixes, changes, and formatting --- pyasic/config/__init__.py | 12 +- pyasic/config/fans.py | 6 +- pyasic/config/mining.py | 26 ++- pyasic/config/pools.py | 10 +- pyasic/config/temperature.py | 23 +-- pyasic/data/__init__.py | 6 +- pyasic/miners/backends/bosminer.py | 2 +- pyasic/miners/backends/epic.py | 6 +- pyasic/web/bosminer/__init__.py | 16 +- .../bosminer/proto/braiins/bos/v1/__init__.py | 180 ++++++++++-------- 10 files changed, 166 insertions(+), 121 deletions(-) diff --git a/pyasic/config/__init__.py b/pyasic/config/__init__.py index 180acee4..ebe72ad9 100644 --- a/pyasic/config/__init__.py +++ b/pyasic/config/__init__.py @@ -160,13 +160,15 @@ class MinerConfig: temperature=TemperatureConfig.from_bosminer(toml_conf), power_scaling=PowerScalingConfig.from_bosminer(toml_conf), ) - + @classmethod def from_epic(cls, web_conf: dict) -> "MinerConfig": - return cls(pools=PoolConfig.from_epic(web_conf), - fan_mode=FanModeConfig.from_epic(web_conf), - temperature=TemperatureConfig.from_epic(web_conf), - mining_mode=MiningModeConfig.from_epic(web_conf)) + return cls( + pools=PoolConfig.from_epic(web_conf), + fan_mode=FanModeConfig.from_epic(web_conf), + temperature=TemperatureConfig.from_epic(web_conf), + mining_mode=MiningModeConfig.from_epic(web_conf), + ) def merge(a: dict, b: dict) -> dict: diff --git a/pyasic/config/fans.py b/pyasic/config/fans.py index 7ddd629d..0f6ba357 100644 --- a/pyasic/config/fans.py +++ b/pyasic/config/fans.py @@ -115,16 +115,16 @@ class FanModeConfig(MinerConfigOption): return cls.normal() else: return cls.default() - + @classmethod def from_epic(cls, web_conf: dict): - if web_conf.get("Fans") is not None: + try: fan_mode = web_conf["Fans"]["Fan Mode"] if fan_mode.get("Manual") is not None: return cls.manual(speed=fan_mode.get("Manual")) else: return cls.normal() - else: + except KeyError: return cls.default() @classmethod diff --git a/pyasic/config/mining.py b/pyasic/config/mining.py index 78c5bb2e..ccb43fe9 100644 --- a/pyasic/config/mining.py +++ b/pyasic/config/mining.py @@ -185,19 +185,29 @@ class MiningModeConfig(MinerConfigOption): elif int(work_mode) == 3: return cls.low() return cls.default() - + @classmethod def from_epic(cls, web_conf: dict): - if web_conf.get("PerpetualTune") is not None: - work_mode = web_conf["PerpetualTune"] - if work_mode["Running"] == True: - if web_conf["PerpetualTune"]["Algorithm"].get("VoltageOptimizer") is not None: - return cls.hashrate_tuning(web_conf["PerpetualTune"]["Algorithm"]["VoltageOptimizer"].get("Target")) + try: + work_mode = web_conf["PerpetualTune"]["Running"] + if work_mode: + if ( + web_conf["PerpetualTune"]["Algorithm"].get("VoltageOptimizer") + is not None + ): + return cls.hashrate_tuning( + web_conf["PerpetualTune"]["Algorithm"]["VoltageOptimizer"][ + "Target" + ] + ) else: - return cls.hashrate_tuning(web_conf["PerpetualTune"]["Algorithm"]["ChipTune"].get("Target")) + return cls.hashrate_tuning( + web_conf["PerpetualTune"]["Algorithm"]["ChipTune"]["Target"] + ) else: return cls.normal() - return cls.default() + except KeyError: + return cls.default() @classmethod def from_bosminer(cls, toml_conf: dict): diff --git a/pyasic/config/pools.py b/pyasic/config/pools.py index 3d3c9d85..ab739d86 100644 --- a/pyasic/config/pools.py +++ b/pyasic/config/pools.py @@ -107,10 +107,12 @@ class Pool(MinerConfigValue): @classmethod def from_api(cls, api_pool: dict) -> "Pool": return cls(url=api_pool["URL"], user=api_pool["User"], password="x") - + @classmethod def from_epic(cls, api_pool: dict) -> "Pool": - return cls(url=api_pool["pool"].replace("stratum+tcp://", ""), user=api_pool["login"], password=api_pool["password"]) + return cls( + url=api_pool["pool"], user=api_pool["login"], password=api_pool["password"] + ) @classmethod def from_am_modern(cls, web_pool: dict) -> "Pool": @@ -240,7 +242,7 @@ class PoolGroup(MinerConfigValue): for pool in api_pool_list: pools.append(Pool.from_api(pool)) return cls(pools=pools) - + @classmethod def from_epic(cls, api_pool_list: list) -> "PoolGroup": pools = [] @@ -344,7 +346,7 @@ class PoolConfig(MinerConfigValue): pool_data = sorted(pool_data, key=lambda x: int(x["POOL"])) return cls([PoolGroup.from_api(pool_data)]) - + @classmethod def from_epic(cls, web_conf: dict) -> "PoolConfig": pool_data = web_conf["StratumConfigs"] diff --git a/pyasic/config/temperature.py b/pyasic/config/temperature.py index 2082d89d..816c061f 100644 --- a/pyasic/config/temperature.py +++ b/pyasic/config/temperature.py @@ -56,21 +56,18 @@ class TemperatureConfig(MinerConfigValue): hot=temp_control.get("hot_temp"), danger=temp_control.get("dangerous_temp"), ) + @classmethod def from_epic(cls, web_conf: dict) -> "TemperatureConfig": - ## we only have a target temp if we are in auto-fan mode, so - ## we need to check for that - if web_conf.get("Misc") is not None: - target_temp = web_conf["Misc"]["Shutdown Temp"] + dangerous_temp = None + try: hot_temp = web_conf["Misc"]["Shutdown Temp"] - dangerous_temp = web_conf["Misc"]["Shutdown Temp"] - - if web_conf["Fans"]["Fan Mode"].get("Auto") is not None: + except KeyError: + hot_temp = None + # Need to do this in two blocks to avoid KeyError if one is missing + try: target_temp = web_conf["Fans"]["Fan Mode"]["Auto"]["Target Temperature"] + except KeyError: + target_temp = None - if web_conf.get("Misc") is not None: - return cls( - target=target_temp, - hot=hot_temp, - danger=dangerous_temp - ) + return cls(target=target_temp, hot=hot_temp, danger=dangerous_temp) diff --git a/pyasic/data/__init__.py b/pyasic/data/__init__.py index b3d02cf3..15d3ff48 100644 --- a/pyasic/data/__init__.py +++ b/pyasic/data/__init__.py @@ -161,9 +161,9 @@ class MinerData: percent_expected_wattage: float = field(init=False) nominal: bool = field(init=False) config: MinerConfig = None - errors: List[ - Union[WhatsminerError, BraiinsOSError, X19Error, InnosiliconError] - ] = field(default_factory=list) + errors: List[Union[WhatsminerError, BraiinsOSError, X19Error, InnosiliconError]] = ( + field(default_factory=list) + ) fault_light: Union[bool, None] = None efficiency: int = field(init=False) is_mining: bool = True diff --git a/pyasic/miners/backends/bosminer.py b/pyasic/miners/backends/bosminer.py index cc8bc6cf..e949133b 100644 --- a/pyasic/miners/backends/bosminer.py +++ b/pyasic/miners/backends/bosminer.py @@ -537,7 +537,7 @@ class BOSMiner(BaseMiner): pass try: - async with (await self._get_ssh_connection()) as conn: + async with await self._get_ssh_connection() as conn: if conn is not None: data = await conn.run("cat /proc/sys/kernel/hostname") host = data.stdout.strip() diff --git a/pyasic/miners/backends/epic.py b/pyasic/miners/backends/epic.py index 13d576d1..9a40a9d1 100644 --- a/pyasic/miners/backends/epic.py +++ b/pyasic/miners/backends/epic.py @@ -74,12 +74,12 @@ class ePIC(BMMiner): if self.model is not None: return self.model + " (ePIC)" return "? (ePIC)" - + async def get_config(self) -> MinerConfig: summary = None try: summary = await self.web.summary() - except APIError as e: + except APIError as e: logger.warning(e) except LookupError: pass @@ -91,7 +91,7 @@ class ePIC(BMMiner): self.config = cfg return self.config - + async def restart_backend(self) -> bool: data = await self.web.restart_epic() if data: diff --git a/pyasic/web/bosminer/__init__.py b/pyasic/web/bosminer/__init__.py index aad5de2c..da8ab954 100644 --- a/pyasic/web/bosminer/__init__.py +++ b/pyasic/web/bosminer/__init__.py @@ -189,11 +189,13 @@ class BOSMinerGQLAPI: await client.post( url, json={ - "query": 'mutation{auth{login(username:"' - + "root" - + '", password:"' - + self.pwd - + '"){__typename}}}' + "query": ( + 'mutation{auth{login(username:"' + + "root" + + '", password:"' + + self.pwd + + '"){__typename}}}' + ) }, ) @@ -233,7 +235,9 @@ class BOSMinerLuCIAPI: login = {"luci_username": self.username, "luci_password": self.pwd} url = f"http://{self.ip}/cgi-bin/luci" headers = { - "User-Agent": "BTC Tools v0.1", # only seems to respond if this user-agent is set + "User-Agent": ( + "BTC Tools v0.1" + ), # only seems to respond if this user-agent is set "Content-Type": "application/x-www-form-urlencoded", } await session.post(url, headers=headers, data=login) diff --git a/pyasic/web/bosminer/proto/braiins/bos/v1/__init__.py b/pyasic/web/bosminer/proto/braiins/bos/v1/__init__.py index 5166d971..a9890179 100644 --- a/pyasic/web/bosminer/proto/braiins/bos/v1/__init__.py +++ b/pyasic/web/bosminer/proto/braiins/bos/v1/__init__.py @@ -2357,17 +2357,21 @@ class ActionsServiceBase(ServiceBase): RebootRequest, RebootResponse, ), - "/braiins.bos.v1.ActionsService/SetLocateDeviceStatus": grpclib.const.Handler( - self.__rpc_set_locate_device_status, - grpclib.const.Cardinality.UNARY_UNARY, - SetLocateDeviceStatusRequest, - LocateDeviceStatusResponse, + "/braiins.bos.v1.ActionsService/SetLocateDeviceStatus": ( + grpclib.const.Handler( + self.__rpc_set_locate_device_status, + grpclib.const.Cardinality.UNARY_UNARY, + SetLocateDeviceStatusRequest, + LocateDeviceStatusResponse, + ) ), - "/braiins.bos.v1.ActionsService/GetLocateDeviceStatus": grpclib.const.Handler( - self.__rpc_get_locate_device_status, - grpclib.const.Cardinality.UNARY_UNARY, - GetLocateDeviceStatusRequest, - LocateDeviceStatusResponse, + "/braiins.bos.v1.ActionsService/GetLocateDeviceStatus": ( + grpclib.const.Handler( + self.__rpc_get_locate_device_status, + grpclib.const.Cardinality.UNARY_UNARY, + GetLocateDeviceStatusRequest, + LocateDeviceStatusResponse, + ) ), } @@ -2644,17 +2648,21 @@ class PerformanceServiceBase(ServiceBase): GetTunerStateRequest, GetTunerStateResponse, ), - "/braiins.bos.v1.PerformanceService/ListTargetProfiles": grpclib.const.Handler( - self.__rpc_list_target_profiles, - grpclib.const.Cardinality.UNARY_UNARY, - ListTargetProfilesRequest, - ListTargetProfilesResponse, + "/braiins.bos.v1.PerformanceService/ListTargetProfiles": ( + grpclib.const.Handler( + self.__rpc_list_target_profiles, + grpclib.const.Cardinality.UNARY_UNARY, + ListTargetProfilesRequest, + ListTargetProfilesResponse, + ) ), - "/braiins.bos.v1.PerformanceService/SetDefaultPowerTarget": grpclib.const.Handler( - self.__rpc_set_default_power_target, - grpclib.const.Cardinality.UNARY_UNARY, - SetDefaultPowerTargetRequest, - SetPowerTargetResponse, + "/braiins.bos.v1.PerformanceService/SetDefaultPowerTarget": ( + grpclib.const.Handler( + self.__rpc_set_default_power_target, + grpclib.const.Cardinality.UNARY_UNARY, + SetDefaultPowerTargetRequest, + SetPowerTargetResponse, + ) ), "/braiins.bos.v1.PerformanceService/SetPowerTarget": grpclib.const.Handler( self.__rpc_set_power_target, @@ -2662,41 +2670,53 @@ class PerformanceServiceBase(ServiceBase): SetPowerTargetRequest, SetPowerTargetResponse, ), - "/braiins.bos.v1.PerformanceService/IncrementPowerTarget": grpclib.const.Handler( - self.__rpc_increment_power_target, - grpclib.const.Cardinality.UNARY_UNARY, - IncrementPowerTargetRequest, - SetPowerTargetResponse, + "/braiins.bos.v1.PerformanceService/IncrementPowerTarget": ( + grpclib.const.Handler( + self.__rpc_increment_power_target, + grpclib.const.Cardinality.UNARY_UNARY, + IncrementPowerTargetRequest, + SetPowerTargetResponse, + ) ), - "/braiins.bos.v1.PerformanceService/DecrementPowerTarget": grpclib.const.Handler( - self.__rpc_decrement_power_target, - grpclib.const.Cardinality.UNARY_UNARY, - DecrementPowerTargetRequest, - SetPowerTargetResponse, + "/braiins.bos.v1.PerformanceService/DecrementPowerTarget": ( + grpclib.const.Handler( + self.__rpc_decrement_power_target, + grpclib.const.Cardinality.UNARY_UNARY, + DecrementPowerTargetRequest, + SetPowerTargetResponse, + ) ), - "/braiins.bos.v1.PerformanceService/SetDefaultHashrateTarget": grpclib.const.Handler( - self.__rpc_set_default_hashrate_target, - grpclib.const.Cardinality.UNARY_UNARY, - SetDefaultHashrateTargetRequest, - SetHashrateTargetResponse, + "/braiins.bos.v1.PerformanceService/SetDefaultHashrateTarget": ( + grpclib.const.Handler( + self.__rpc_set_default_hashrate_target, + grpclib.const.Cardinality.UNARY_UNARY, + SetDefaultHashrateTargetRequest, + SetHashrateTargetResponse, + ) ), - "/braiins.bos.v1.PerformanceService/SetHashrateTarget": grpclib.const.Handler( - self.__rpc_set_hashrate_target, - grpclib.const.Cardinality.UNARY_UNARY, - SetHashrateTargetRequest, - SetHashrateTargetResponse, + "/braiins.bos.v1.PerformanceService/SetHashrateTarget": ( + grpclib.const.Handler( + self.__rpc_set_hashrate_target, + grpclib.const.Cardinality.UNARY_UNARY, + SetHashrateTargetRequest, + SetHashrateTargetResponse, + ) ), - "/braiins.bos.v1.PerformanceService/IncrementHashrateTarget": grpclib.const.Handler( - self.__rpc_increment_hashrate_target, - grpclib.const.Cardinality.UNARY_UNARY, - IncrementHashrateTargetRequest, - SetHashrateTargetResponse, + "/braiins.bos.v1.PerformanceService/IncrementHashrateTarget": ( + grpclib.const.Handler( + self.__rpc_increment_hashrate_target, + grpclib.const.Cardinality.UNARY_UNARY, + IncrementHashrateTargetRequest, + SetHashrateTargetResponse, + ) ), - "/braiins.bos.v1.PerformanceService/DecrementHashrateTarget": grpclib.const.Handler( - self.__rpc_decrement_hashrate_target, - grpclib.const.Cardinality.UNARY_UNARY, - DecrementHashrateTargetRequest, - SetHashrateTargetResponse, + "/braiins.bos.v1.PerformanceService/DecrementHashrateTarget": ( + grpclib.const.Handler( + self.__rpc_decrement_hashrate_target, + grpclib.const.Cardinality.UNARY_UNARY, + DecrementHashrateTargetRequest, + SetHashrateTargetResponse, + ) ), "/braiins.bos.v1.PerformanceService/SetDPS": grpclib.const.Handler( self.__rpc_set_dps, @@ -2704,23 +2724,29 @@ class PerformanceServiceBase(ServiceBase): SetDpsRequest, SetDpsResponse, ), - "/braiins.bos.v1.PerformanceService/SetPerformanceMode": grpclib.const.Handler( - self.__rpc_set_performance_mode, - grpclib.const.Cardinality.UNARY_UNARY, - SetPerformanceModeRequest, - PerformanceMode, + "/braiins.bos.v1.PerformanceService/SetPerformanceMode": ( + grpclib.const.Handler( + self.__rpc_set_performance_mode, + grpclib.const.Cardinality.UNARY_UNARY, + SetPerformanceModeRequest, + PerformanceMode, + ) ), - "/braiins.bos.v1.PerformanceService/GetActivePerformanceMode": grpclib.const.Handler( - self.__rpc_get_active_performance_mode, - grpclib.const.Cardinality.UNARY_UNARY, - GetPerformanceModeRequest, - PerformanceMode, + "/braiins.bos.v1.PerformanceService/GetActivePerformanceMode": ( + grpclib.const.Handler( + self.__rpc_get_active_performance_mode, + grpclib.const.Cardinality.UNARY_UNARY, + GetPerformanceModeRequest, + PerformanceMode, + ) ), - "/braiins.bos.v1.PerformanceService/RemoveTunedProfiles": grpclib.const.Handler( - self.__rpc_remove_tuned_profiles, - grpclib.const.Cardinality.UNARY_UNARY, - RemoveTunedProfilesRequest, - RemoveTunedProfilesResponse, + "/braiins.bos.v1.PerformanceService/RemoveTunedProfiles": ( + grpclib.const.Handler( + self.__rpc_remove_tuned_profiles, + grpclib.const.Cardinality.UNARY_UNARY, + RemoveTunedProfilesRequest, + RemoveTunedProfilesResponse, + ) ), } @@ -2836,17 +2862,21 @@ class ConfigurationServiceBase(ServiceBase): def __mapping__(self) -> Dict[str, grpclib.const.Handler]: return { - "/braiins.bos.v1.ConfigurationService/GetMinerConfiguration": grpclib.const.Handler( - self.__rpc_get_miner_configuration, - grpclib.const.Cardinality.UNARY_UNARY, - GetMinerConfigurationRequest, - GetMinerConfigurationResponse, + "/braiins.bos.v1.ConfigurationService/GetMinerConfiguration": ( + grpclib.const.Handler( + self.__rpc_get_miner_configuration, + grpclib.const.Cardinality.UNARY_UNARY, + GetMinerConfigurationRequest, + GetMinerConfigurationResponse, + ) ), - "/braiins.bos.v1.ConfigurationService/GetConstraints": grpclib.const.Handler( - self.__rpc_get_constraints, - grpclib.const.Cardinality.UNARY_UNARY, - GetConstraintsRequest, - GetConstraintsResponse, + "/braiins.bos.v1.ConfigurationService/GetConstraints": ( + grpclib.const.Handler( + self.__rpc_get_constraints, + grpclib.const.Cardinality.UNARY_UNARY, + GetConstraintsRequest, + GetConstraintsResponse, + ) ), }