@@ -32,7 +32,7 @@ def new(cls, config: ComponentConfig, dependencies: Mapping[ResourceName, Resour
3232 @classmethod
3333 def validate_config (cls , config : ComponentConfig ) -> Sequence [str ]:
3434 if "multiplier" in config .attributes .fields :
35- if not isinstance ( config .attributes .fields ["multiplier" ], float ):
35+ if not config .attributes .fields ["multiplier" ]. HasField ( "number_value" ):
3636 raise Exception ("Multiplier must be a float." )
3737 multiplier = config .attributes .fields ["multiplier" ].number_value
3838 if multiplier == 0 :
@@ -43,6 +43,7 @@ async def get_readings(self, extra: Optional[Dict[str, Any]] = None, **kwargs) -
4343 return {"signal" : 1 * self .multiplier }
4444
4545 async def do_command (self , command : Mapping [str , ValueTypes ], * , timeout : Optional [float ] = None , ** kwargs ) -> Mapping [str , ValueTypes ]:
46+ LOGGER .info (f"received { command = } ." )
4647 return command
4748
4849 def reconfigure (self , config : ComponentConfig , dependencies : Mapping [ResourceName , ResourceBase ]):
@@ -55,7 +56,7 @@ def reconfigure(self, config: ComponentConfig, dependencies: Mapping[ResourceNam
5556 async def close (self ):
5657 # This is a completely optional function to include. This will be called when the resource is removed from the config or the module
5758 # is shutting down.
58- LOGGER .debug (f"{ self .name } is closed." )
59+ LOGGER .info (f"{ self .name } is closed." )
5960
6061
6162async def main ():
0 commit comments