def METHOD_NAME(device_config: BatterX):
    def create_bat_component(component_config: BatterXBatSetup):
        return bat.BatterXBat(device_config.id, component_config)
    def create_counter_component(component_config: BatterXCounterSetup):
        return counter.BatterXCounter(device_config.id, component_config)
    def create_inverter_component(component_config: BatterXInverterSetup):
        return inverter.BatterXInverter(device_config.id, component_config)
    def create_external_inverter_component(component_config: BatterXExternalInverterSetup):
        return external_inverter.BatterXExternalInverter(device_config.id, component_config)
    def update_components(components: Iterable[batterx_component_classes]):
        resp_json = req.get_http_session().get(
                    'http://' + device_config.configuration.ip_address + '/api.php?get=currentstate',
                    timeout=5).json()
        for component in components:
            component.update(resp_json)
    return ConfigurableDevice(
        device_config=device_config,
        component_factory=ComponentFactoryByType(
            bat=create_bat_component,
            counter=create_counter_component,
            inverter=create_inverter_component,
            external_inverter=create_external_inverter_component,
        ),
        component_updater=MultiComponentUpdater(update_components)
    )