File tree Expand file tree Collapse file tree 2 files changed +6
-0
lines changed 
src/frequenz/client/common Expand file tree Collapse file tree 2 files changed +6
-0
lines changed Original file line number Diff line number Diff line change 88
99# pylint: disable=no-name-in-module 
1010from  frequenz .api .common .v1 .metrics .metric_sample_pb2  import  Metric  as  PBMetric 
11+ from  typing_extensions  import  deprecated 
1112
1213# pylint: enable=no-name-in-module 
1314
@@ -141,6 +142,7 @@ class Metric(enum.Enum):
141142    SENSOR_IRRADIANCE  =  PBMetric .METRIC_SENSOR_IRRADIANCE 
142143
143144    @classmethod  
145+     @deprecated ("Use `frequenz.client.common.enum_proto.enum_from_proto` instead." ) 
144146    def  from_proto (cls , metric : PBMetric .ValueType ) ->  Self :
145147        """Convert a protobuf Metric value to Metric enum. 
146148
Original file line number Diff line number Diff line change 1919    ComponentStateCode  as  PBComponentStateCode ,
2020)
2121from  frequenz .core .id  import  BaseId 
22+ from  typing_extensions  import  deprecated 
2223
2324# pylint: enable=no-name-in-module 
2425
@@ -104,6 +105,7 @@ class ComponentCategory(enum.Enum):
104105    """A Heating, Ventilation, and Air Conditioning (HVAC) system.""" 
105106
106107    @classmethod  
108+     @deprecated ("Use `frequenz.client.common.enum_proto.enum_from_proto` instead." ) 
107109    def  from_proto (
108110        cls , component_category : PBComponentCategory .ValueType 
109111    ) ->  ComponentCategory :
@@ -209,6 +211,7 @@ class ComponentStateCode(enum.Enum):
209211    """The precharger circuit is closed, allowing full current to flow to the main circuit.""" 
210212
211213    @classmethod  
214+     @deprecated ("Use `frequenz.client.common.enum_proto.enum_from_proto` instead." ) 
212215    def  from_proto (
213216        cls , component_state : PBComponentStateCode .ValueType 
214217    ) ->  ComponentStateCode :
@@ -387,6 +390,7 @@ class ComponentErrorCode(enum.Enum):
387390    times.""" 
388391
389392    @classmethod  
393+     @deprecated ("Use `frequenz.client.common.enum_proto.enum_from_proto` instead." ) 
390394    def  from_proto (
391395        cls , component_error_code : PBComponentErrorCode .ValueType 
392396    ) ->  ComponentErrorCode :
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments