Use serialization TypedDicts to reduce Any instances (#4085)
This commit is contained in:
parent
f2e40742bb
commit
cec29d123b
|
|
@ -78,7 +78,7 @@ class BluetoothConfiguration:
|
||||||
return {'enabled': self.enabled}
|
return {'enabled': self.enabled}
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def parse_arg(arg: dict[str, Any]) -> 'BluetoothConfiguration':
|
def parse_arg(arg: BluetoothConfigSerialization) -> 'BluetoothConfiguration':
|
||||||
return BluetoothConfiguration(arg['enabled'])
|
return BluetoothConfiguration(arg['enabled'])
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -92,7 +92,7 @@ class PowerManagementConfiguration:
|
||||||
}
|
}
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def parse_arg(arg: dict[str, Any]) -> 'PowerManagementConfiguration':
|
def parse_arg(arg: PowerManagementConfigSerialization) -> 'PowerManagementConfiguration':
|
||||||
return PowerManagementConfiguration(
|
return PowerManagementConfiguration(
|
||||||
PowerManagement(arg['power_management']),
|
PowerManagement(arg['power_management']),
|
||||||
)
|
)
|
||||||
|
|
@ -106,7 +106,7 @@ class PrintServiceConfiguration:
|
||||||
return {'enabled': self.enabled}
|
return {'enabled': self.enabled}
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def parse_arg(arg: dict[str, Any]) -> 'PrintServiceConfiguration':
|
def parse_arg(arg: PrintServiceConfigSerialization) -> 'PrintServiceConfiguration':
|
||||||
return PrintServiceConfiguration(arg['enabled'])
|
return PrintServiceConfiguration(arg['enabled'])
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue